-
Notifications
You must be signed in to change notification settings - Fork 37
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
feat: ASI mobix staking replacement #348
feat: ASI mobix staking replacement #348
Conversation
… feat/asi-mobix-staking-replacement # Conflicts: # cmd/fetchd/cmd/genasiupgrade.go
cmd/fetchd/cmd/genasiupgrade.go
Outdated
contracts := jsonData["wasm"].(map[string]interface{})["contracts"].([]interface{}) | ||
MobixStakingContractAddress := networkInfo.Contracts.MobixStaking.Addr | ||
|
||
re := regexp.MustCompile(fmt.Sprintf(`%s%s1([%s]{%d})$`, OldAddrPrefix, "", Bech32Chars, AddrDataLength+AddrChecksumLength)) |
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.
re := regexp.MustCompile(fmt.Sprintf(`%s%s1([%s]{%d})$`, OldAddrPrefix, "", Bech32Chars, AddrDataLength+AddrChecksumLength)) | |
re := regexp.MustCompile(fmt.Sprintf(`$(stakes|unbond_entries)%s%s1([%s]{%d,%d})$`, OldAddrPrefix, "", Bech32Chars, 32+AddrChecksumLength, 52+AddrChecksumLength)) |
or, probably even better:
re := regexp.MustCompile(fmt.Sprintf(`%s%s1([%s]{%d})$`, OldAddrPrefix, "", Bech32Chars, AddrDataLength+AddrChecksumLength)) | |
re := regexp.MustCompile(fmt.Sprintf(`$(stakes|unbond_entries)%s%s1([%s]{%d,%d})$`, OldAddrPrefix, "", Bech32Chars, AddrChecksumLength, 52+AddrChecksumLength)) |
Above suggested $(stakes|unbond_entries)
start of the regexp is overkill, due to complications with multiple matches.
Perhaps, simpler solution would be simply check the key value manually whether it starts with the "stakes"
or "unbond_entries"
strings and pass follosing substring in to the address conversion functionm which would return just converted address, which would then be conctatenated back with original "stakes"
or "unbond_entries"
prefix.
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 would use leven higher value then 52 (which supposed to be for contract address, and at the moment it looks like it is largest address length we know of), for example at least 60, or even 100.
… feat/asi-mobix-staking-replacement # Conflicts: # cmd/fetchd/cmd/genesis-asi-upgrade.go
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.
LGTM
No description provided.