diff --git a/modules/coin/genesis.go b/modules/coin/genesis.go index 06bcd9c1c6..b174c8c11a 100644 --- a/modules/coin/genesis.go +++ b/modules/coin/genesis.go @@ -15,16 +15,14 @@ import ( type GenesisAccount struct { Address data.Bytes `json:"address"` // this from types.Account (don't know how to embed this properly) - PubKey crypto.PubKey `json:"pub_key"` // May be nil, if not known. - Sequence int `json:"sequence"` - Balance Coins `json:"coins"` + PubKey crypto.PubKey `json:"pub_key"` // May be nil, if not known. + Balance Coins `json:"coins"` } // ToAccount - GenesisAccount struct to a basecoin Account func (g GenesisAccount) ToAccount() Account { return Account{ - Sequence: g.Sequence, - Coins: g.Balance, + Coins: g.Balance, } } diff --git a/modules/coin/helper.go b/modules/coin/helper.go index 4c66ec6a82..21c9ea7825 100644 --- a/modules/coin/helper.go +++ b/modules/coin/helper.go @@ -39,9 +39,8 @@ func (a *AccountWithKey) Actor() basecoin.Actor { // This is intended for use in test cases func (a *AccountWithKey) MakeOption() string { info := GenesisAccount{ - Address: a.Address(), - Sequence: a.Sequence, - Balance: a.Coins, + Address: a.Address(), + Balance: a.Coins, } js, err := data.ToJSON(info) if err != nil { diff --git a/modules/coin/store.go b/modules/coin/store.go index 56e99f2811..516e7acea9 100644 --- a/modules/coin/store.go +++ b/modules/coin/store.go @@ -63,8 +63,7 @@ func updateCoins(store state.KVStore, addr basecoin.Actor, coins Coins) (acct Ac // Account - coin account structure type Account struct { - Coins Coins `json:"coins"` - Sequence int `json:"sequence"` + Coins Coins `json:"coins"` } func loadAccount(store state.KVStore, key []byte) (acct Account, err error) { diff --git a/tests/cli/basictx.sh b/tests/cli/basictx.sh index f3db1f2f6d..c46f4d78cf 100755 --- a/tests/cli/basictx.sh +++ b/tests/cli/basictx.sh @@ -23,7 +23,7 @@ test00GetAccount() { assertFalse "requires arg" "${CLIENT_EXE} query account" - checkAccount $SENDER "0" "9007199254740992" + checkAccount $SENDER "9007199254740992" ACCT2=$(${CLIENT_EXE} query account $RECV 2>/dev/null) assertFalse "has no genesis account" $? @@ -40,10 +40,10 @@ test01SendTx() { HASH=$(echo $TX | jq .hash | tr -d \") TX_HEIGHT=$(echo $TX | jq .height) - checkAccount $SENDER "1" "9007199254740000" + checkAccount $SENDER "9007199254740000" # make sure 0x prefix also works - checkAccount "0x$SENDER" "1" "9007199254740000" - checkAccount $RECV "0" "992" + checkAccount "0x$SENDER" "9007199254740000" + checkAccount $RECV "992" # Make sure tx is indexed checkSendTx $HASH $TX_HEIGHT $SENDER "992" diff --git a/tests/cli/common.sh b/tests/cli/common.sh index 94219d6108..ef9eee87a3 100644 --- a/tests/cli/common.sh +++ b/tests/cli/common.sh @@ -124,6 +124,7 @@ getAddr() { echo $RAW | cut -d' ' -f2 } +# XXX Ex Usage: checkAccount $ADDR $AMOUNT # Desc: Assumes just one coin, checks the balance of first coin in any case checkAccount() { # make sure sender goes down @@ -133,8 +134,7 @@ checkAccount() { fi if [ -n "$DEBUG" ]; then echo $ACCT; echo; fi - assertEquals "proper sequence" "$2" $(echo $ACCT | jq .data.sequence) - assertEquals "proper money" "$3" $(echo $ACCT | jq .data.coins[0].amount) + assertEquals "proper money" "$2" $(echo $ACCT | jq .data.coins[0].amount) return $? } diff --git a/tests/cli/counter.sh b/tests/cli/counter.sh index 378348e57a..cf2f6b391c 100755 --- a/tests/cli/counter.sh +++ b/tests/cli/counter.sh @@ -23,7 +23,7 @@ test00GetAccount() { assertFalse "requires arg" "${CLIENT_EXE} query account" - checkAccount $SENDER "0" "9007199254740992" + checkAccount $SENDER "9007199254740992" ACCT2=$(${CLIENT_EXE} query account $RECV 2>/dev/null) assertFalse "has no genesis account" $? @@ -40,8 +40,8 @@ test01SendTx() { HASH=$(echo $TX | jq .hash | tr -d \") TX_HEIGHT=$(echo $TX | jq .height) - checkAccount $SENDER "1" "9007199254740000" - checkAccount $RECV "0" "992" + checkAccount $SENDER "9007199254740000" + checkAccount $RECV "992" # make sure tx is indexed checkSendTx $HASH $TX_HEIGHT $SENDER "992" @@ -76,7 +76,7 @@ test03AddCount() { checkCounter "1" "10" # make sure the account was debited - checkAccount $SENDER "2" "9007199254739990" + checkAccount $SENDER "9007199254739990" # make sure tx is indexed TX=$(${CLIENT_EXE} query tx $HASH --trace) diff --git a/tests/cli/restart.sh b/tests/cli/restart.sh index 993db2eb77..c6c6a500ba 100755 --- a/tests/cli/restart.sh +++ b/tests/cli/restart.sh @@ -26,8 +26,8 @@ test00PreRestart() { HASH=$(echo $TX | jq .hash | tr -d \") TX_HEIGHT=$(echo $TX | jq .height) - checkAccount $SENDER "1" "9007199254740000" - checkAccount $RECV "0" "992" + checkAccount $SENDER "9007199254740000" + checkAccount $RECV "992" # make sure tx is indexed checkSendTx $HASH $TX_HEIGHT $SENDER "992" @@ -63,8 +63,8 @@ test01OnRestart() { # make sure queries still work properly, with all 3 tx now executed echo "Checking state after restart..." - checkAccount $SENDER "3" "9007199254710000" - checkAccount $RECV "0" "30992" + checkAccount $SENDER "9007199254710000" + checkAccount $RECV "30992" # make sure tx is indexed checkSendTx $HASH $TX_HEIGHT $SENDER "10000"