-
Notifications
You must be signed in to change notification settings - Fork 955
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
Change to multitokens #1663
Change to multitokens #1663
Conversation
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.
So far, this looks like an enormous improvement
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.
first few comments, may add more later
.filter_map(|(t, o, s)| match (token, target) { | ||
(Some(token), Some(target)) if t == *token && o == *target => { | ||
Some((t, s)) | ||
} | ||
(Some(token), None) if t == *token => Some((t, s)), | ||
(None, Some(target)) if o == *target => Some((t, s)), | ||
(None, None) => Some((t, s)), | ||
_ => None, | ||
}) |
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.
can we document the purpose of each of these match arms? reading this code is hard, especially with these short identifiers (i.e. t
, o
and s
), which have no immediate meaning
@@ -151,7 +152,7 @@ where | |||
{ | |||
let denom_key = storage::ibc_denom_key(token_hash); | |||
let denom = match self.ctx.borrow().read(&denom_key) { | |||
Ok(Some(v)) => String::from_utf8(v).map_err(|e| { | |||
Ok(Some(v)) => String::try_from_slice(&v[..]).map_err(|e| { |
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.
is v
borsh encoded?
Renew balance keys with
Multitoken
#Multitoken/{token_addr}/balance/{owner}
#Multitoken/{token_addr}/balance/minted
Add Multitoken VP
shared/src/ledger/native_vp/multitoken.rs
Remove
sub_prefix
IBC: Clean up with Multitokens
#Multitoken/#IbcToken(hash)/balance/{owner}
EthBridge: Change the balance keys
#Multitoken/#Erc20(eth_addr)/balance/{owner}
#Multitoken/#Erc20(eth_addr)/balance/minted