Skip to content

Commit c6175e0

Browse files
authored
chore: rename txe_service to rpc_translator (#17087)
Long overdue.
2 parents 77fee76 + c1d6084 commit c6175e0

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

yarn-project/txe/src/txe_service/txe_service.ts renamed to yarn-project/txe/src/rpc_translator.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import { type ContractArtifact, FunctionSelector, NoteSelector } from '@aztec/st
55
import { AztecAddress } from '@aztec/stdlib/aztec-address';
66
import { MerkleTreeId } from '@aztec/stdlib/trees';
77

8-
import type { TXETypedOracle } from '../oracle/txe_typed_oracle.js';
9-
import type { TXESessionStateHandler } from '../txe_session.js';
8+
import type { TXETypedOracle } from './oracle/txe_typed_oracle.js';
9+
import type { TXESessionStateHandler } from './txe_session.js';
1010
import {
1111
type ForeignCallArray,
1212
type ForeignCallSingle,
@@ -21,11 +21,11 @@ import {
2121
toArray,
2222
toForeignCallResult,
2323
toSingle,
24-
} from '../util/encoding.js';
24+
} from './util/encoding.js';
2525

26-
export class TXEService {
26+
export class RPCTranslator {
2727
/**
28-
* Create a new instance of `TXEService` that will translate all TXE RPC calls to and from the foreign
28+
* Create a new instance of `RPCTranslator` that will translate all TXE RPC calls to and from the foreign
2929
* (`ForeignCallSingle`, `ForeignCallResult`, etc.) and native TS types, delegating actual execution of the oracles
3030
* to the different handlers.
3131
* @param stateHandler The handler that will process TXE session state transitions, such as entering a private or

yarn-project/txe/src/txe_session.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ import { TXE } from './oracle/txe_oracle.js';
2323
import { TXEOraclePublicContext } from './oracle/txe_oracle_public_context.js';
2424
import { TXEOracleTopLevelContext } from './oracle/txe_oracle_top_level_context.js';
2525
import type { TXETypedOracle } from './oracle/txe_typed_oracle.js';
26+
import { RPCTranslator } from './rpc_translator.js';
2627
import { TXEStateMachine } from './state_machine/index.js';
27-
import { TXEService } from './txe_service/txe_service.js';
2828
import type { ForeignCallArgs, ForeignCallResult } from './util/encoding.js';
2929
import { TXEAccountDataProvider } from './util/txe_account_data_provider.js';
3030
import { TXEContractDataProvider } from './util/txe_contract_data_provider.js';
@@ -65,7 +65,7 @@ type MethodNames<T> = {
6565
* The name of an oracle function that TXE supports, which are a combination of PXE oracles, non-transpiled AVM opcodes,
6666
* and custom TXE oracles.
6767
*/
68-
export type TXEOracleFunctionName = MethodNames<TXEService>;
68+
export type TXEOracleFunctionName = MethodNames<RPCTranslator>;
6969

7070
export interface TXESessionStateHandler {
7171
setTopLevelContext(): Promise<void>;
@@ -168,7 +168,7 @@ export class TXESession implements TXESessionStateHandler {
168168
* @returns The oracle return values.
169169
*/
170170
processFunction(functionName: TXEOracleFunctionName, inputs: ForeignCallArgs): Promise<ForeignCallResult> {
171-
return (new TXEService(this, this.oracleHandler) as any)[functionName](...inputs);
171+
return (new RPCTranslator(this, this.oracleHandler) as any)[functionName](...inputs);
172172
}
173173

174174
async setTopLevelContext() {

0 commit comments

Comments
 (0)