Merge PR #1925: Fix develop from FF merge

* Update types/coin_test.go from FF merge
* 'make format'
This commit is contained in:
Christopher Goes 2018-08-06 21:49:17 +02:00 committed by GitHub
parent 93457aac33
commit 46382994a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 25 additions and 25 deletions

View File

@ -73,7 +73,7 @@ func TestBadMsg(t *testing.T) {
if err != nil {
panic(err)
}
sigs := []auth.StdSignature{auth.StdSignature{
sigs := []auth.StdSignature{{
PubKey: priv1.PubKey(),
Signature: sig,
AccountNumber: 0,
@ -119,7 +119,7 @@ func TestMsgSend(t *testing.T) {
if err != nil {
panic(err)
}
sigs := []auth.StdSignature{auth.StdSignature{
sigs := []auth.StdSignature{{
PubKey: priv1.PubKey(),
Signature: sig,
AccountNumber: 0,

View File

@ -153,10 +153,10 @@ func TestIsZeroCoins(t *testing.T) {
expected bool
}{
{Coins{}, true},
{Coins{NewCoin("A", 0)}, true},
{Coins{NewCoin("A", 0), NewCoin("B", 0)}, true},
{Coins{NewCoin("A", 1)}, false},
{Coins{NewCoin("A", 0), NewCoin("B", 1)}, false},
{Coins{NewInt64Coin("A", 0)}, true},
{Coins{NewInt64Coin("A", 0), NewInt64Coin("B", 0)}, true},
{Coins{NewInt64Coin("A", 1)}, false},
{Coins{NewInt64Coin("A", 0), NewInt64Coin("B", 1)}, false},
}
for _, tc := range cases {
@ -172,13 +172,13 @@ func TestEqualCoins(t *testing.T) {
expected bool
}{
{Coins{}, Coins{}, true},
{Coins{NewCoin("A", 0)}, Coins{NewCoin("A", 0)}, true},
{Coins{NewCoin("A", 0), NewCoin("B", 1)}, Coins{NewCoin("A", 0), NewCoin("B", 1)}, true},
{Coins{NewCoin("A", 0)}, Coins{NewCoin("B", 0)}, false},
{Coins{NewCoin("A", 0)}, Coins{NewCoin("A", 1)}, false},
{Coins{NewCoin("A", 0)}, Coins{NewCoin("A", 0), NewCoin("B", 1)}, false},
{Coins{NewInt64Coin("A", 0)}, Coins{NewInt64Coin("A", 0)}, true},
{Coins{NewInt64Coin("A", 0), NewInt64Coin("B", 1)}, Coins{NewInt64Coin("A", 0), NewInt64Coin("B", 1)}, true},
{Coins{NewInt64Coin("A", 0)}, Coins{NewInt64Coin("B", 0)}, false},
{Coins{NewInt64Coin("A", 0)}, Coins{NewInt64Coin("A", 1)}, false},
{Coins{NewInt64Coin("A", 0)}, Coins{NewInt64Coin("A", 0), NewInt64Coin("B", 1)}, false},
// TODO: is it expected behaviour? shouldn't we sort the coins before comparing them?
{Coins{NewCoin("A", 0), NewCoin("B", 1)}, Coins{NewCoin("B", 1), NewCoin("A", 0)}, false},
{Coins{NewInt64Coin("A", 0), NewInt64Coin("B", 1)}, Coins{NewInt64Coin("B", 1), NewInt64Coin("A", 0)}, false},
}
for tcnum, tc := range cases {

View File

@ -160,7 +160,7 @@ func TestContextWithCustom(t *testing.T) {
ischeck := true
txbytes := []byte("txbytes")
logger := NewMockLogger()
signvals := []abci.SigningValidator{abci.SigningValidator{}}
signvals := []abci.SigningValidator{{}}
meter := types.NewGasMeter(10000)
ctx = types.NewContext(nil, header, ischeck, logger).

View File

@ -113,8 +113,8 @@ func TestMsgSendWithAccounts(t *testing.T) {
expPass: true,
privKeys: []crypto.PrivKey{priv1},
expectedBalances: []expectedBalance{
expectedBalance{addr1, sdk.Coins{sdk.NewInt64Coin("foocoin", 57)}},
expectedBalance{addr2, sdk.Coins{sdk.NewInt64Coin("foocoin", 10)}},
{addr1, sdk.Coins{sdk.NewInt64Coin("foocoin", 57)}},
{addr2, sdk.Coins{sdk.NewInt64Coin("foocoin", 10)}},
},
},
{
@ -169,9 +169,9 @@ func TestMsgSendMultipleOut(t *testing.T) {
expPass: true,
privKeys: []crypto.PrivKey{priv1},
expectedBalances: []expectedBalance{
expectedBalance{addr1, sdk.Coins{sdk.NewInt64Coin("foocoin", 32)}},
expectedBalance{addr2, sdk.Coins{sdk.NewInt64Coin("foocoin", 47)}},
expectedBalance{addr3, sdk.Coins{sdk.NewInt64Coin("foocoin", 5)}},
{addr1, sdk.Coins{sdk.NewInt64Coin("foocoin", 32)}},
{addr2, sdk.Coins{sdk.NewInt64Coin("foocoin", 47)}},
{addr3, sdk.Coins{sdk.NewInt64Coin("foocoin", 5)}},
},
},
}
@ -211,10 +211,10 @@ func TestSengMsgMultipleInOut(t *testing.T) {
expPass: true,
privKeys: []crypto.PrivKey{priv1, priv4},
expectedBalances: []expectedBalance{
expectedBalance{addr1, sdk.Coins{sdk.NewInt64Coin("foocoin", 32)}},
expectedBalance{addr4, sdk.Coins{sdk.NewInt64Coin("foocoin", 32)}},
expectedBalance{addr2, sdk.Coins{sdk.NewInt64Coin("foocoin", 52)}},
expectedBalance{addr3, sdk.Coins{sdk.NewInt64Coin("foocoin", 10)}},
{addr1, sdk.Coins{sdk.NewInt64Coin("foocoin", 32)}},
{addr4, sdk.Coins{sdk.NewInt64Coin("foocoin", 32)}},
{addr2, sdk.Coins{sdk.NewInt64Coin("foocoin", 52)}},
{addr3, sdk.Coins{sdk.NewInt64Coin("foocoin", 10)}},
},
},
}
@ -246,8 +246,8 @@ func TestMsgSendDependent(t *testing.T) {
expPass: true,
privKeys: []crypto.PrivKey{priv1},
expectedBalances: []expectedBalance{
expectedBalance{addr1, sdk.Coins{sdk.NewInt64Coin("foocoin", 32)}},
expectedBalance{addr2, sdk.Coins{sdk.NewInt64Coin("foocoin", 10)}},
{addr1, sdk.Coins{sdk.NewInt64Coin("foocoin", 32)}},
{addr2, sdk.Coins{sdk.NewInt64Coin("foocoin", 10)}},
},
},
{
@ -257,7 +257,7 @@ func TestMsgSendDependent(t *testing.T) {
expPass: true,
privKeys: []crypto.PrivKey{priv2},
expectedBalances: []expectedBalance{
expectedBalance{addr1, sdk.Coins{sdk.NewInt64Coin("foocoin", 42)}},
{addr1, sdk.Coins{sdk.NewInt64Coin("foocoin", 42)}},
},
},
}