Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: 🎸 ABI decoding of tuple arrays
This change adds proper support for decoding tuples and structs in function and event arguments as well as the computation of signatures and signature hashes for functions/events having types in their parameter list. Also includes some other minor cleanup.
- Loading branch information
Showing
11 changed files
with
248 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
export class RuntimeError extends Error { | ||
public readonly cause?: Error; | ||
constructor(msg: string, cause?: Error) { | ||
super(msg); | ||
this.name = this.constructor.name; | ||
this.message = msg; | ||
this.cause = cause; | ||
Error.captureStackTrace(this, this.constructor); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { getInputSize } from '../../src/abi/decode'; | ||
import { loadSignatureFile } from '../../src/abi/files'; | ||
|
||
test('getInputSize for all anonymous signatures', async () => { | ||
const sigs = await loadSignatureFile('data/fns.abisigs.gz'); | ||
for (const abis of sigs.entries.map(i => i[1])) { | ||
for (const abi of abis) { | ||
expect(() => getInputSize(abi)).not.toThrow(); | ||
} | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.