Skip to content

Commit

Permalink
Coins (#138)
Browse files Browse the repository at this point in the history
* tokens

* tokens

* tokens
  • Loading branch information
defisaur authored Sep 21, 2023
1 parent 9bc6567 commit 8e1feec
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion coin/coins.go

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

10 changes: 6 additions & 4 deletions types/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ const (
TokenVersionV11 TokenVersion = 11
TokenVersionV12 TokenVersion = 12
TokenVersionV13 TokenVersion = 13
TokenVersionV14 TokenVersion = 14
TokenVersionUndefined TokenVersion = -1
)

Expand Down Expand Up @@ -365,11 +366,12 @@ func GetTokenVersion(tokenType string) (TokenVersion, error) {
return TokenVersionV11, nil
case TON, POLYGONZKEVM, ZKSYNC, SUI:
return TokenVersionV12, nil
case BASE, AKASH, AGORIC, AXELAR, JUNO, SEI, OPBNB, LINEA:
case BASE, AKASH, AGORIC, AXELAR, JUNO, SEI, OPBNB:
return TokenVersionV13, nil
case BRC20, ERC721, ERC1155, EOS, NEP5, VET, ONTOLOGY, THETA, TOMO, POA, OASIS, ALGORAND,
KAVAERC20, METER, EVMOS_ERC20, KIP20, MOONBEAM, KLAYTN, METIS, MOONRIVER, BOBA, STRIDE, NEUTRON, FA2, CONFLUX,
ACA, CARDANO, NEON, NATIVEINJECTIVE, NATIVEEVMOS, CRYPTOORG, COSMOS, OSMOSIS, STARGAZE, ACALAEVM:
case KAVAERC20, BOBA, METIS, NEON, LINEA, ACA, ACALAEVM, CONFLUX, IOTEXEVM, KLAYTN, MOONRIVER, MOONBEAM:
return TokenVersionV14, nil
case BRC20, ERC721, ERC1155, EOS, NEP5, VET, ONTOLOGY, THETA, TOMO, POA, OASIS, ALGORAND, METER, EVMOS_ERC20,
KIP20, STRIDE, NEUTRON, FA2, CARDANO, NATIVEINJECTIVE, NATIVEEVMOS, CRYPTOORG, COSMOS, OSMOSIS, STARGAZE:
return TokenVersionUndefined, nil
default:
// This should not happen, as it is guarded by TestGetTokenVersionImplementEverySupportedTokenTypes
Expand Down
14 changes: 7 additions & 7 deletions types/token_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -480,31 +480,31 @@ func TestGetTokenVersion(t *testing.T) {
{
"Moonbeam token version",
args{t: string(MOONBEAM)},
TokenVersionUndefined,
TokenVersionV14,
nil,
},
{
"Klaytn token version",
args{t: string(KLAYTN)},
TokenVersionUndefined,
TokenVersionV14,
nil,
},
{
"Metis token version",
args{t: string(METIS)},
TokenVersionUndefined,
TokenVersionV14,
nil,
},
{
"Moonriver token version",
args{t: string(MOONRIVER)},
TokenVersionUndefined,
TokenVersionV14,
nil,
},
{
"Boba token version",
args{t: string(BOBA)},
TokenVersionUndefined,
TokenVersionV14,
nil,
},

Expand Down Expand Up @@ -532,14 +532,14 @@ func TestGetTokenVersion(t *testing.T) {
{
"Conflux eSpace token version",
args{t: string(CONFLUX)},
TokenVersionUndefined,
TokenVersionV14,
nil,
},

{
"Acala token version",
args{t: string(ACA)},
TokenVersionUndefined,
TokenVersionV14,
nil,
},
}
Expand Down

0 comments on commit 8e1feec

Please sign in to comment.