Skip to content

Commit

Permalink
Rename TON to JETTON (#174)
Browse files Browse the repository at this point in the history
* Add ton tokens support

* Set IsTokenSupported as false

* TON->JETTON

* Fix
  • Loading branch information
tw-daniel authored Jul 17, 2024
1 parent 348c760 commit effad9f
Show file tree
Hide file tree
Showing 4 changed files with 131 additions and 136 deletions.
241 changes: 121 additions & 120 deletions coin/coins.go

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

2 changes: 1 addition & 1 deletion types/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func GetChainFromAssetType(assetType string) (coin.Coin, error) {
return coin.Moonriver(), nil
case BOBA:
return coin.Boba(), nil
case TON:
case JETTON:
return coin.Ton(), nil
case POLYGONZKEVM:
return coin.Polygonzkevm(), nil
Expand Down
10 changes: 5 additions & 5 deletions types/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ const (
METIS TokenType = "METIS"
MOONRIVER TokenType = "MOONRIVER"
BOBA TokenType = "BOBA"
TON TokenType = "TON"
JETTON TokenType = "JETTON"
POLYGONZKEVM TokenType = "ZKEVM"
ZKSYNC TokenType = "ZKSYNC"
SUI TokenType = "SUI"
Expand Down Expand Up @@ -216,7 +216,7 @@ func GetTokenTypes() []TokenType {
METIS,
MOONRIVER,
BOBA,
TON,
JETTON,
POLYGONZKEVM,
ZKSYNC,
SUI,
Expand Down Expand Up @@ -321,7 +321,7 @@ func GetTokenType(c uint, tokenID string) (string, bool) {
case coin.APTOS:
return string(APTOS), true
case coin.TON:
return string(TON), true
return string(JETTON), true
case coin.SUI:
return string(SUI), true
case coin.STRIDE:
Expand Down Expand Up @@ -408,7 +408,7 @@ func GetTokenVersion(tokenType string) (TokenVersion, error) {
return TokenVersionV10, nil
case RONIN, AURORA:
return TokenVersionV11, nil
case TON, POLYGONZKEVM, ZKSYNC, SUI:
case JETTON, POLYGONZKEVM, ZKSYNC, SUI:
return TokenVersionV12, nil
case BASE, AKASH, AGORIC, AXELAR, JUNO, SEI, OPBNB:
return TokenVersionV13, nil
Expand Down Expand Up @@ -507,7 +507,7 @@ func GetEthereumTokenTypeByIndex(coinIndex uint) (TokenType, error) {
case coin.BOBA:
tokenType = BOBA
case coin.TON:
tokenType = TON
tokenType = JETTON
case coin.POLYGONZKEVM:
tokenType = POLYGONZKEVM
case coin.ZKSYNC:
Expand Down
14 changes: 4 additions & 10 deletions types/token_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,9 +311,9 @@ func TestGetTokenType(t *testing.T) {
wantBool: true,
},
{
name: "Ton",
name: "Jetton",
args: args{coin.TON, ""},
want: string(TON),
want: string(JETTON),
wantBool: true,
},
{
Expand Down Expand Up @@ -548,42 +548,36 @@ func TestGetTokenVersion(t *testing.T) {
TokenVersionV14,
nil,
},

{
"Ton token version",
args{t: string(TON)},
"Jetton token version",
args{t: string(JETTON)},
TokenVersionV12,
nil,
},

{
"Stride token version",
args{t: string(STRIDE)},
TokenVersionUndefined,
nil,
},

{
"Neutron token version",
args{t: string(NEUTRON)},
TokenVersionUndefined,
nil,
},

{
"Conflux eSpace token version",
args{t: string(CONFLUX)},
TokenVersionV14,
nil,
},

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

{
"NativeZeta token version",
args{t: string(ZETACHAIN)},
Expand Down

0 comments on commit effad9f

Please sign in to comment.