native: uppercase token symbols

Follow neo-project/neo#2136.
This commit is contained in:
Roman Khimov 2020-12-13 21:05:49 +03:00
parent e3dfb5d165
commit aff1469482
6 changed files with 18 additions and 18 deletions

View file

@ -20,8 +20,8 @@ func TestRegisterCandidate(t *testing.T) {
"--rpc-endpoint", "http://"+e.RPC.Addr,
"--wallet", validatorWallet,
"--from", validatorAddr,
"neo:"+validatorPriv.Address()+":10",
"gas:"+validatorPriv.Address()+":100")
"NEO:"+validatorPriv.Address()+":10",
"GAS:"+validatorPriv.Address()+":100")
e.checkTxPersisted(t)
e.In.WriteString("one\r")

View file

@ -55,8 +55,8 @@ func TestSignMultisigTx(t *testing.T) {
"--rpc-endpoint", "http://"+e.RPC.Addr,
"--wallet", validatorWallet,
"--from", validatorAddr,
"neo:"+multisigAddr+":4",
"gas:"+multisigAddr+":1")
"NEO:"+multisigAddr+":4",
"GAS:"+multisigAddr+":1")
e.checkTxPersisted(t)
// Sign and transfer funds to another account.
@ -69,7 +69,7 @@ func TestSignMultisigTx(t *testing.T) {
e.Run(t, "neo-go", "wallet", "nep17", "transfer",
"--rpc-endpoint", "http://"+e.RPC.Addr,
"--wallet", wallet1Path, "--from", multisigAddr,
"--to", priv.Address(), "--token", "neo", "--amount", "1",
"--to", priv.Address(), "--token", "NEO", "--amount", "1",
"--out", txPath)
e.In.WriteString("pass\r")

View file

@ -34,7 +34,7 @@ func TestNEP17Balance(t *testing.T) {
e.checkEOF(t)
}
t.Run("Alias", func(t *testing.T) {
e.Run(t, append(cmd, "--token", "neo")...)
e.Run(t, append(cmd, "--token", "NEO")...)
checkResult(t)
})
t.Run("Hash", func(t *testing.T) {
@ -43,7 +43,7 @@ func TestNEP17Balance(t *testing.T) {
})
})
t.Run("GAS", func(t *testing.T) {
e.Run(t, append(cmd, "--token", "gas")...)
e.Run(t, append(cmd, "--token", "GAS")...)
e.checkNextLine(t, "^\\s*Account\\s+"+validatorAddr)
e.checkNextLine(t, "^\\s*GAS:\\s+GAS \\("+e.Chain.UtilityTokenHash().StringLE()+"\\)")
b := e.Chain.GetUtilityTokenBalance(validatorHash)
@ -112,7 +112,7 @@ func TestNEP17Transfer(t *testing.T) {
"--wallet", validatorWallet,
"--from", validatorAddr,
"--to", w.Accounts[0].Address,
"--token", "neo",
"--token", "NEO",
"--amount", "1",
}
@ -144,7 +144,7 @@ func TestNEP17MultiTransfer(t *testing.T) {
"--rpc-endpoint", "http://" + e.RPC.Addr,
"--wallet", validatorWallet,
"--from", validatorAddr,
"neo:" + privs[0].Address() + ":42",
"NEO:" + privs[0].Address() + ":42",
"GAS:" + privs[1].Address() + ":7",
neoContractHash.StringLE() + ":" + privs[2].Address() + ":13",
}
@ -186,7 +186,7 @@ func TestNEP17ImportToken(t *testing.T) {
t.Run("Info", func(t *testing.T) {
checkGASInfo := func(t *testing.T) {
e.checkNextLine(t, "^Name:\\s*GAS")
e.checkNextLine(t, "^Symbol:\\s*gas")
e.checkNextLine(t, "^Symbol:\\s*GAS")
e.checkNextLine(t, "^Hash:\\s*"+gasContractHash.StringLE())
e.checkNextLine(t, "^Decimals:\\s*8")
e.checkNextLine(t, "^Address:\\s*"+address.Uint160ToString(gasContractHash))
@ -203,7 +203,7 @@ func TestNEP17ImportToken(t *testing.T) {
_, err := e.Out.ReadString('\n')
require.NoError(t, err)
e.checkNextLine(t, "^Name:\\s*NEO")
e.checkNextLine(t, "^Symbol:\\s*neo")
e.checkNextLine(t, "^Symbol:\\s*NEO")
e.checkNextLine(t, "^Hash:\\s*"+neoContractHash.StringLE())
e.checkNextLine(t, "^Decimals:\\s*0")
e.checkNextLine(t, "^Address:\\s*"+address.Uint160ToString(neoContractHash))

View file

@ -182,8 +182,8 @@ func TestClaimGas(t *testing.T) {
"--rpc-endpoint", "http://" + e.RPC.Addr,
"--wallet", validatorWallet,
"--from", validatorAddr,
"neo:" + w.Accounts[0].Address + ":1000",
"gas:" + w.Accounts[0].Address + ":1000", // for tx send
"NEO:" + w.Accounts[0].Address + ":1000",
"GAS:" + w.Accounts[0].Address + ":1000", // for tx send
}
e.In.WriteString("one\r")
e.Run(t, args...)
@ -261,8 +261,8 @@ func TestImportDeployed(t *testing.T) {
e.Run(t, "neo-go", "wallet", "nep17", "multitransfer",
"--rpc-endpoint", "http://"+e.RPC.Addr,
"--wallet", validatorWallet, "--from", validatorAddr,
"neo:"+contractAddr+":10",
"gas:"+contractAddr+":10")
"NEO:"+contractAddr+":10",
"GAS:"+contractAddr+":10")
e.checkTxPersisted(t)
privTo, err := keys.NewPrivateKey()
@ -272,7 +272,7 @@ func TestImportDeployed(t *testing.T) {
e.Run(t, "neo-go", "wallet", "nep17", "transfer",
"--rpc-endpoint", "http://"+e.RPC.Addr,
"--wallet", walletPath, "--from", contractAddr,
"--to", privTo.Address(), "--token", "neo", "--amount", "1")
"--to", privTo.Address(), "--token", "NEO", "--amount", "1")
e.checkTxPersisted(t)
b, _ := e.Chain.GetGoverningTokenBalance(h)

View file

@ -28,7 +28,7 @@ const initialGAS = 30000000
func newGAS() *GAS {
g := &GAS{}
nep17 := newNEP17Native(gasName)
nep17.symbol = "gas"
nep17.symbol = "GAS"
nep17.decimals = 8
nep17.factor = GASFactor
nep17.incBalance = g.increaseBalance

View file

@ -94,7 +94,7 @@ func makeValidatorKey(key *keys.PublicKey) []byte {
func newNEO() *NEO {
n := &NEO{}
nep17 := newNEP17Native(neoName)
nep17.symbol = "neo"
nep17.symbol = "NEO"
nep17.decimals = 0
nep17.factor = 1
nep17.incBalance = n.increaseBalance