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

Enable Merlin coin #168

Merged
merged 1 commit into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
254 changes: 140 additions & 114 deletions coin/coins.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion coin/coins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1012,4 +1012,12 @@
name: Zeta EVM
decimals: 18
blockchain: Ethereum
isTokenSupported: false
isTokenSupported: false

- id: 4200
symbol: BTC
handle: merlin
name: Merlin
decimals: 18
blockchain: Ethereum
isTokenSupported: true
1 change: 1 addition & 0 deletions coin/models_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,7 @@ var evmCoinsTestSet = map[uint]struct{}{
MANTLE: {},
MANTA: {},
ZETAEVM: {},
MERLIN: {},
}

// TestEvmCoinsList This test will automatically fail when new EVM chain is added to coins.yml
Expand Down
2 changes: 2 additions & 0 deletions types/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ func GetChainFromAssetType(assetType string) (coin.Coin, error) {
return coin.Zetachain(), nil
case ZETAEVM:
return coin.Zetaevm(), nil
case MERLIN:
return coin.Merlin(), nil
}

return coin.Coin{}, errors.New("unknown asset type: " + assetType)
Expand Down
7 changes: 7 additions & 0 deletions types/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ const (
MANTA TokenType = "MANTA"
ZETACHAIN TokenType = "ZETACHAIN"
ZETAEVM TokenType = "ZETAEVM"
MERLIN TokenType = "MERLIN"
)

const (
Expand All @@ -136,6 +137,7 @@ const (
TokenVersionV14 TokenVersion = 14
TokenVersionV15 TokenVersion = 15
TokenVersionV16 TokenVersion = 16
TokenVersionV17 TokenVersion = 17
TokenVersionUndefined TokenVersion = -1
)

Expand Down Expand Up @@ -225,6 +227,7 @@ func GetTokenTypes() []TokenType {
MANTA,
ZETACHAIN,
ZETAEVM,
MERLIN,
}
}

Expand Down Expand Up @@ -391,6 +394,8 @@ func GetTokenVersion(tokenType string) (TokenVersion, error) {
return TokenVersionV14, nil
case BRC20:
return TokenVersionV16, nil
case MERLIN:
return TokenVersionV17, nil
case ERC721, ERC1155, EOS, NEP5, VET, ONTOLOGY, THETA, TOMO, POA, OASIS, ALGORAND, METER, EVMOS_ERC20,
KIP20, STRIDE, NEUTRON, FA2, CARDANO, NATIVEEVMOS, CRYPTOORG, COSMOS, OSMOSIS, STARGAZE:
return TokenVersionUndefined, nil
Expand Down Expand Up @@ -504,6 +509,8 @@ func GetEthereumTokenTypeByIndex(coinIndex uint) (TokenType, error) {
tokenType = MANTA
case coin.ZETAEVM:
tokenType = ZETAEVM
case coin.MERLIN:
tokenType = MERLIN
}

if tokenType == "" {
Expand Down
6 changes: 6 additions & 0 deletions types/token_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,12 @@ func TestGetTokenVersion(t *testing.T) {
TokenVersionV16,
nil,
},
{
"MERLIN token version",
args{t: string(MERLIN)},
TokenVersionV17,
nil,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down
Loading