Skip to content

Commit bce1452

Browse files
author
Yutong Pei
authored
3 more unhandled errors (iotexproject#581)
1 parent a9ecb57 commit bce1452

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

action/protocol/rewarding/fund_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ func TestProtocol_Fund(t *testing.T) {
3232
require.NoError(t, stateDB.Commit(ws))
3333

3434
ws, err = stateDB.NewWorkingSet()
35+
require.NoError(t, err)
3536
totalBalance, err := p.TotalBalance(ctx, ws)
3637
require.NoError(t, err)
3738
assert.Equal(t, big.NewInt(5), totalBalance)

action/protocol/rewarding/protocol.go

+3
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,9 @@ func (p *Protocol) ReadState(
138138
return nil, err
139139
}
140140
balance, err := p.UnclaimedBalance(ctx, sm, addr)
141+
if err != nil {
142+
return nil, err
143+
}
141144
return []byte(balance.String()), nil
142145
default:
143146
return nil, errors.New("corresponding method isn't found")

e2etest/rewarding_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ func TestBlockReward(t *testing.T) {
6464
pk := &sk.PublicKey
6565
pkHash1 := keypair.HashPubKey(pk)
6666
addr, err := address.FromBytes(pkHash1[:])
67+
require.NoError(t, err)
6768

6869
blockReward, err := rp.BlockReward(ctx, ws)
6970
require.NoError(t, err)

0 commit comments

Comments
 (0)