Skip to content

Commit

Permalink
Merge branch 'main' into dependabot-npm_and_yarn-types-mocha-10.0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiorigam authored Nov 20, 2024
2 parents 5583fc1 + 42cb251 commit e086f51
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { ThorId } from '@vechain/sdk-core';
*/
const ethGetUncleByBlockHashAndIndex = async (
params: unknown[]
): Promise<object> => {
): Promise<object | null> => {
// Input validation
if (
params.length !== 2 ||
Expand All @@ -33,7 +33,7 @@ const ethGetUncleByBlockHashAndIndex = async (
{ params }
);

return await Promise.resolve({});
return await Promise.resolve(null);
};

export { ethGetUncleByBlockHashAndIndex };
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { JSONRPCInvalidParams } from '@vechain/sdk-errors';
*/
const ethGetUncleByBlockNumberAndIndex = async (
params: unknown[]
): Promise<object> => {
): Promise<object | null> => {
// Input validation
if (
params.length !== 2 ||
Expand All @@ -32,7 +32,7 @@ const ethGetUncleByBlockNumberAndIndex = async (
{ params }
);

return await Promise.resolve({});
return await Promise.resolve(null);
};

export { ethGetUncleByBlockNumberAndIndex };
4 changes: 2 additions & 2 deletions packages/network/src/provider/utils/rpc-mapper/rpc-mapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,13 +281,13 @@ const RPCMethodsMap = (

[RPC_METHODS.eth_getUncleByBlockHashAndIndex]: async (
params
): Promise<object> => {
): Promise<object | null> => {
return await ethGetUncleByBlockHashAndIndex(params);
},

[RPC_METHODS.eth_getUncleByBlockNumberAndIndex]: async (
params
): Promise<object> => {
): Promise<object | null> => {
return await ethGetUncleByBlockNumberAndIndex(params);
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ describe('RPC Mapper - eth_getUncleByBlockHashAndIndex method tests', () => {
'0x0'
]);

expect(uncleBlock).toStrictEqual({});
expect(uncleBlock).toStrictEqual(null);
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ describe('RPC Mapper - eth_getUncleByBlockNumberAndIndex method tests', () => {
RPC_METHODS.eth_getUncleByBlockNumberAndIndex
](['latest', '0x0']);

expect(uncleBlock).toStrictEqual({});
expect(uncleBlock).toStrictEqual(null);
});
});

Expand Down
4 changes: 2 additions & 2 deletions packages/rpc-proxy/tests/e2e_rpc_proxy.solo.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ describe('RPC Proxy endpoints', () => {
console.log(response.data);
expect(response.data).toHaveProperty('result');
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
expect(response.data.result).toStrictEqual({});
expect(response.data.result).toBeNull();
});

it('eth_getUncleByBlockNumberAndIndex method call', async () => {
Expand All @@ -532,7 +532,7 @@ describe('RPC Proxy endpoints', () => {
console.log(response.data);
expect(response.data).toHaveProperty('result');
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
expect(response.data.result).toStrictEqual({});
expect(response.data.result).toBeNull();
});

it('eth_requestAccounts method call', async () => {
Expand Down

0 comments on commit e086f51

Please sign in to comment.