Skip to content

Commit

Permalink
Ivanb/notifications (#78)
Browse files Browse the repository at this point in the history
* [TX] add empty asset validation

* Revert "[TX] add empty asset validation"

This reverts commit 66e99cc

* [TX] fix undelegation & claim rewards addresses

* [TX] fix tests
  • Loading branch information
covain authored Jul 8, 2021
1 parent 243e4d0 commit d065a30
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
4 changes: 1 addition & 3 deletions types/v1/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,10 +259,8 @@ func (t *Tx) GetAddresses() []string {
return append(addresses, t.From, t.To)
case TxContractCall:
return append(addresses, t.From, t.To)
case TxStakeDelegate, TxStakeRedelegate:
case TxStakeDelegate, TxStakeRedelegate, TxStakeUndelegate, TxStakeClaimRewards:
return append(addresses, t.From)
case TxStakeUndelegate, TxStakeClaimRewards:
return append(addresses, t.To)
default:
return addresses
}
Expand Down
12 changes: 11 additions & 1 deletion types/v1/tx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,17 @@ func TestTx_GetAddresses(t *testing.T) {
To: "to",
Metadata: &Transfer{},
},
expected: []string{"to"},
expected: []string{"from"},
},
{
name: "claim_rewards",
tx: Tx{
Type: TxStakeClaimRewards,
From: "from",
To: "to",
Metadata: &Transfer{},
},
expected: []string{"from"},
},
{
name: "contract_call",
Expand Down

0 comments on commit d065a30

Please sign in to comment.