Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/relay/src/lib/eth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -951,6 +951,7 @@ export class EthImpl implements Eth {
@rpcParamValidationRules({
0: { type: 'transaction', required: true },
1: { type: 'blockParams', required: true },
2: { type: 'stateOverride', required: false },
})
@cache({
skipParams: [{ index: '1', value: constants.NON_CACHABLE_BLOCK_PARAMS }],
Expand Down
8 changes: 8 additions & 0 deletions packages/relay/src/lib/validators/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,14 @@ export const TYPES = {
},
error: 'Expected TracerConfigWrapper which contains a valid TracerType and/or TracerConfig',
},
stateOverride: {
test: (param: any) => {
// Must be an object if provided
// TODO: This validation should be more detailed when state override is officially supported.
return typeof param === 'object' && !Array.isArray(param);
},
error: 'Expected StateOverride object (currently accepting any object structure)',
},
} satisfies {
[paramTypeName: string]: {
test: (param: any) => boolean;
Expand Down
1 change: 1 addition & 0 deletions packages/server/tests/acceptance/rpc_batch3.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2094,6 +2094,7 @@ describe('@api-batch-3 RPC Server Acceptance Tests', function () {
data: '0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE',
},
'latest',
{},
null,
],
eth_getTransactionByHash: ['0x4cc9a77780cf0e6d0dc75373bf00e3437db450ede45cb51b5da936fb46342c99', null],
Expand Down
Loading