-
Notifications
You must be signed in to change notification settings - Fork 7
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
typeconv: Implement for Solana #619
base: main
Are you sure you want to change the base?
Conversation
fa7ffc1
to
39337c1
Compare
switch family { | ||
case chainsel.FamilyEVM: | ||
// TODO: not EIP-55. Fix this? | ||
return "0x" + hex.EncodeToString(addr) |
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.
Just use hexutil.Encode(addr)
It encodes the bytes as a hex string with 0x prefix
Its a geth library from:
"github.com/ethereum/go-ethereum/common/hexutil"
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.
@prashantkumar1982 this probably needs to be another service.
switch family { | ||
case chainsel.FamilyEVM: | ||
// lower case in case EIP-55 and trim 0x prefix if there | ||
addrBytes, err := hex.DecodeString(strings.ToLower(strings.TrimPrefix(addr, "0x"))) |
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.
common.HexToAddress(addr)
Import "github.com/ethereum/go-ethereum/common"
@@ -4,6 +4,7 @@ go 1.23.3 | |||
|
|||
require ( | |||
github.com/deckarep/golang-set/v2 v2.6.0 | |||
github.com/gagliardetto/solana-go v1.12.0 |
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.
This dependency is a non starter.
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.
This needs to be a new service for encoding and decoding addresses.
No description provided.