[txpool] fixed delegate transaction cost unit test

pull/3656/head
Jacky Wang 4 years ago
parent f4045528e0
commit 2e3125dbff
No known key found for this signature in database
GPG Key ID: 1085CE5F4FF5842C
  1. 14
      staking/types/transaction_test.go

@ -140,16 +140,22 @@ func TestGasCost(t *testing.T) {
t.Errorf("gas price set incorrectly \n")
}
cost, err := stakingTx.Cost()
if err != nil || cost.Int64() != 600100 {
t.Errorf("staking transaction cost is incorrect %v\n", err)
if err != nil {
t.Errorf("unexpected error %v\n", err)
}
if cost.Int64() != 600100 {
t.Errorf("unexpected cost: %v / %v", cost, 600100)
}
delegateTx, err := createDelegate()
if err != nil {
t.Errorf("cannot create delegate staking transaction, %v\n", err)
}
cost, err = delegateTx.Cost()
if err != nil || cost.Int64() != 21100 {
t.Errorf("staking transaction cost is incorrect %v\n", err)
if err != nil {
t.Errorf("unexpected error %v\n", err)
}
if cost.Int64() != 21000 {
t.Errorf("unexpected cost: %v / %v", cost, 21000)
}
}

Loading…
Cancel
Save