Skip to content

Commit

Permalink
Update test
Browse files Browse the repository at this point in the history
  • Loading branch information
Federico Kunze committed Oct 23, 2018
1 parent 5ba3768 commit b27e743
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions cmd/gaia/cli_test/cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,11 @@ func TestGaiaCLISubmitProposal(t *testing.T) {
proposalsQuery, _ = tests.ExecuteT(t, fmt.Sprintf("gaiacli query proposals %v", flags), "")
require.Equal(t, " 1 - Test", proposalsQuery)

deposit := executeGetDeposit(t,
fmt.Sprintf("gaiacli query deposit --proposal-id=1 --depositer=foo %v",
flags))
require.Equal(t, int64(5), deposit.Amount.AmountOf("steak").Int64())

depositStr := fmt.Sprintf("gaiacli tx deposit %v", flags)
depositStr += fmt.Sprintf(" --from=%s", "foo")
depositStr += fmt.Sprintf(" --deposit=%s", "10steak")
Expand All @@ -367,14 +372,13 @@ func TestGaiaCLISubmitProposal(t *testing.T) {
// test query deposit
deposits := executeGetDeposits(t,
fmt.Sprintf("gaiacli query deposits --proposal-id=1 %v", flags))
require.Len(t, deposits, 2)
require.Equal(t, int64(5), deposits[0].Amount.AmountOf("steak").Int64())
require.Equal(t, int64(10), deposits[1].Amount.AmountOf("steak").Int64())
require.Len(t, deposits, 1)
require.Equal(t, int64(15), deposits[0].Amount.AmountOf("steak").Int64())

deposit := executeGetDeposit(t,
deposit = executeGetDeposit(t,
fmt.Sprintf("gaiacli query deposit --proposal-id=1 --depositer=foo %v",
flags))
require.Equal(t, int64(5), deposit.Amount.AmountOf("steak").Int64())
require.Equal(t, int64(15), deposit.Amount.AmountOf("steak").Int64())

fooAcc = executeGetAccount(t, fmt.Sprintf("gaiacli query account %s %v", fooAddr, flags))
require.Equal(t, int64(35), fooAcc.GetCoins().AmountOf("steak").Int64())
Expand Down

0 comments on commit b27e743

Please sign in to comment.