Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

typeconv: Implement for Solana #619

wants to merge 1 commit into from

Conversation

archseer
Copy link
Contributor

No description provided.

switch family {
case chainsel.FamilyEVM:
// TODO: not EIP-55. Fix this?
return "0x" + hex.EncodeToString(addr)
Copy link
Collaborator

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"

Copy link
Contributor

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")))
Copy link
Collaborator

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
Copy link
Contributor

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.

Copy link
Contributor

@winder winder left a 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants