-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Asset transfer #904
Asset transfer #904
Conversation
5a6423f
to
4b4b553
Compare
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## proxy-contracts #904 +/- ##
===================================================
- Coverage 68.43% 68.21% -0.22%
===================================================
Files 42 42
Lines 1774 1787 +13
Branches 72 72
===================================================
+ Hits 1214 1219 +5
- Misses 541 549 +8
Partials 19 19
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
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.
Looks good! Added a few minor comments
8ea734e
to
d2a3fdb
Compare
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.
Looks good!
This reverts commit e53557d.
e53557d
to
bd1bed8
Compare
parachain/primitives/core/src/lib.rs
Outdated
Token::Address(*token), | ||
Token::Uint(U256::from(*amount)), | ||
Token::Uint(self.index().into()), | ||
Token::Bytes(ethabi::encode(&vec![Token::Tuple(vec![ |
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.
The Solidity side isn't expecting a tuple (struct) type though.
i.e abi.decode(data, (address, address, uint128))
is equivalent to:
ethabi::encode(&vec![Token::Address(*token), Token::Address(*recipient), Token::Uint(U256::from(*amount))]);
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.
I think implicitly it's encoded to the same thing because (address, address, uint128)
is an implicit tuple. I have tested both versions and they work. The tuple and just a vec![Tokens]
. I used the tuple version because it feels more correct. So I think this is more of style thing so which would you prefer?
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.
I prefer the original form.
We can't say for sure whether they encode to the same thing for all input parameter types, without more investigation and testing. Also Token::Tuple
was introduced purely to encode structs, and we're not using structs in this case.
Resolves: SNO-569
Cumulus companion: Snowfork/cumulus#52
TODO