Skip to content

Commit

Permalink
fix: supportedEntryPoints return format
Browse files Browse the repository at this point in the history
  • Loading branch information
sanyu1225 committed Sep 1, 2023
1 parent 9e7b894 commit 97d805a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
11 changes: 10 additions & 1 deletion packages/web3-eth/src/rpc_method_wrappers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1229,5 +1229,14 @@ export async function supportedEntryPoints<ReturnFormat extends DataFormat>(
returnFormat: ReturnFormat,
) {
const response = await ethRpcMethods.supportedEntryPoints(web3Context.requestManager);
return format({ format: 'uint' }, response, returnFormat);
return format(
{
type: 'array',
items: {
format: 'string',
},
},
response,
returnFormat,
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,14 @@ describe('supportedEntryPoints', () => {
'0xcd01C8aa8995A59eB7B2627E69b40e0524B5ecf8',
'0x7A0A0d159218E6a2f407B99173A2b12A6DDfC2a6',
];
const expectedReturnFormat = { number: FMT_NUMBER.STR, bytes: FMT_BYTES.UINT8ARRAY };
const expectedReturnFormat = { number: FMT_NUMBER.BIGINT, bytes: FMT_BYTES.HEX };
const expectedFormattedResult = format(
{ format: 'uint' },
{
type: 'array',
items: {
format: 'string',
},
},
mockRpcResponse,
expectedReturnFormat,
);
Expand Down

0 comments on commit 97d805a

Please sign in to comment.