Skip to content

Conversation

@teogeb
Copy link
Contributor

@teogeb teogeb commented Nov 18, 2024

Moved two Ethereum function selector utils from FakeJsonRpcServer to test utils. These are soon needed in #2883.

Also refactored methods (and one FakeJsonRpcServer usage) to use the id utils from ethers (https://github.com/ethers-io/ethers.js/blob/9e7e7f3e2f2d51019aaa782e6290e079c38332fb/src.ts/hash/id.ts#L16). It does the same hash calculation as our implementation.

Note that the return value of the functions now includes the 0x prefix. It is therefore compatible e.g. with ethers FunctionFragment.getSelector() method (https://github.com/ethers-io/ethers.js/blob/9e7e7f3e2f2d51019aaa782e6290e079c38332fb/src.ts/abi/fragments.ts#L1449).

@teogeb teogeb merged commit 1e4dac3 into main Nov 18, 2024
23 checks passed
@teogeb teogeb deleted the sdk-test-ethers-id-utils branch November 18, 2024 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants