@@ -93,14 +93,17 @@ function setupMockJsonRpcClient(
9393}
9494
9595class MockJsonRpcClient implements JsonRpcClient {
96- private _blockNumber = 10 ;
96+ #blockNumber = 10 ;
97+ #transactions: { [ key : string ] : TransactionReceipt } ;
98+ #sendTransaction: ( transactionParams : TransactionParams ) => Promise < string > ;
9799
98100 constructor (
99- private _sendTransaction : (
100- transactionParams : TransactionParams
101- ) => Promise < string > ,
102- private _transactions : { [ key : string ] : TransactionReceipt }
103- ) { }
101+ sendTransaction : ( transactionParams : TransactionParams ) => Promise < string > ,
102+ transactions : { [ key : string ] : TransactionReceipt }
103+ ) {
104+ this . #sendTransaction = sendTransaction ;
105+ this . #transactions = transactions ;
106+ }
104107
105108 public async getChainId ( ) : Promise < number > {
106109 return 31337 ;
@@ -113,7 +116,7 @@ class MockJsonRpcClient implements JsonRpcClient {
113116 }
114117
115118 public async getLatestBlock ( ) : Promise < Block > {
116- const blockNumber = this . _blockNumber ++ ;
119+ const blockNumber = this . #blockNumber ++ ;
117120
118121 return {
119122 hash : `0xblockhash-${ blockNumber } ` ,
@@ -152,7 +155,7 @@ class MockJsonRpcClient implements JsonRpcClient {
152155 public async sendTransaction (
153156 transactionParams : TransactionParams
154157 ) : Promise < string > {
155- return this . _sendTransaction ( transactionParams ) ;
158+ return this . #sendTransaction ( transactionParams ) ;
156159 }
157160
158161 public async sendRawTransaction ( _presignedTx : string ) : Promise < string > {
@@ -181,11 +184,11 @@ class MockJsonRpcClient implements JsonRpcClient {
181184 txHash : string
182185 ) : Promise < TransactionReceipt | undefined > {
183186 assertIgnitionInvariant (
184- txHash in this . _transactions ,
187+ txHash in this . #transactions ,
185188 `No transaction registered in test for the hash ${ txHash } `
186189 ) ;
187190
188- return this . _transactions [ txHash ] ;
191+ return this . #transactions [ txHash ] ;
189192 }
190193
191194 public async getCode ( _address : string ) : Promise < string > {
0 commit comments