-
Notifications
You must be signed in to change notification settings - Fork 830
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
add IBC support for 0x addresses #2051
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2051 +/- ##
==========================================
- Coverage 61.32% 61.30% -0.03%
==========================================
Files 264 264
Lines 24581 24586 +5
==========================================
- Hits 15074 15072 -2
- Misses 8378 8387 +9
+ Partials 1129 1127 -2
|
func (h EvmAddressHandler) GetSeiAddressFromString(ctx sdk.Context, address string) (sdk.AccAddress, error) { | ||
if common.IsHexAddress(address) { | ||
parsedAddress := common.HexToAddress(address) | ||
return h.evmKeeper.GetSeiAddressOrDefault(ctx, parsedAddress), nil |
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.
@codchen is assumption correct here that if address is not associated yet, the funds would go to an "escrow" account and then will be migrated after association?
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.
Upd: Was able to test scenario e2e and it works
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.
yes this is correct
if err != nil { | ||
return nil, err | ||
if !ok || receiverAddressString == "" { | ||
return nil, errors.New("receiverAddress is not a string or empty") |
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.
do we want to add checks that the address is valid? i.e.
- if sei, it is proper bech32
- if evm, it is a valid address
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.
We did have the bech32 check before, but i was too restrictive. In fact this address is propagated as string all the way up the stack without any checks. I guess the assumption is that it could any type of address, not only bech32 or EVM.
Describe your changes and provide context
add IBC support for 0x addresses.
This implementation will parse the address string and if its a 0x address, will return either associated or casted Sei Address.
Testing performed to validate your change