This repository has been archived by the owner on Oct 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 797
feat: function call enums EthCall macro and more #517
Merged
+950
−134
Merged
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
db51b38
fix: do not sort event variants
mattsse 90b2c1b
style: use deref over clone
mattsse 42bb563
style: refactor some stuff
mattsse 28bd693
feat: add ethcall trait
mattsse 7ec449c
feat: include in abigen
mattsse 21b79ce
feat: add bare bones eth call derive
mattsse 748a0a2
feat: impl EthCall derive
mattsse 053b311
feat: support enums
mattsse 00f8ed9
feat: use abigen enum derive
mattsse c6af805
fix: concrete abi and map errors
mattsse 36e62a7
test: first call test
mattsse 12fa801
rustfmt
mattsse 62a53cc
chore: use correct trait name on error
mattsse 3a1047f
feat: derive display for call structs
mattsse 1deadab
feat: add from conversion
mattsse a011619
test: add convert test
mattsse f37fe20
chore: docs and test
mattsse cc12a49
chore: update changelog
mattsse d862a75
cargo fix
mattsse 091d9cc
feat: add unit type derive support and more test
mattsse 4897b0b
chore: patch ethabi
mattsse 449f988
chore: rm ethabi patch
mattsse 3ffb8be
feat: add encode/decode trait impls
mattsse 7be4b59
style: use AsRef<[u8]>
mattsse 68a8acb
Update ethers-contract/ethers-contract-abigen/src/contract/methods.rs
mattsse ee9aa89
style: reindent macro body
mattsse 9277ebc
test: add tuple event test
mattsse File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
feat: add encode/decode trait impls
commit 3ffb8be3631cd05476146dc57f3cd9560700fea0
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
use crate::AbiError; | ||
use ethers_core::types::Bytes; | ||
|
||
/// Trait for ABI encoding | ||
pub trait AbiEncode { | ||
/// ABI encode the type | ||
fn encode(self) -> Result<Bytes, AbiError>; | ||
} | ||
|
||
/// Trait for ABI decoding | ||
pub trait AbiDecode: Sized { | ||
/// Decodes the ABI encoded data | ||
fn decode(bytes: &[u8]) -> Result<Self, AbiError>; | ||
} |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the advantage of returning a Cow instead of a
'static str
here?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
currently none, I think, but I wasn't sure whether this also allows others to implement calls that construct the function name dynamically, since this is a type function, &'static str should be sufficient.