Skip to content

Commit

Permalink
feat: get-code
Browse files Browse the repository at this point in the history
adds the currently supported `getCode` endpoint for rpc and sequencer
In the future this will be replaced by contract class calls, but that's not supported right now while get_code is supported by sequencer and rpc
  • Loading branch information
janek26 committed Aug 3, 2022
1 parent fe4e5b4 commit de6e597
Show file tree
Hide file tree
Showing 11 changed files with 57 additions and 197 deletions.
5 changes: 5 additions & 0 deletions __tests__/defaultProvider.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ describe('defaultProvider', () => {
return expect(block).toHaveProperty('block_number');
});

test('getCode() -> { bytecode }', async () => {
const code = await testProvider.getCode(exampleContractAddress);
return expect(Array.isArray(code.bytecode)).toBe(true);
});

describe('getStorageAt', () => {
test('with "key" type of number', () => {
return expect(testProvider.getStorageAt(exampleContractAddress, 0)).resolves.not.toThrow();
Expand Down
Loading

0 comments on commit de6e597

Please sign in to comment.