Skip to content

Commit

Permalink
fix type
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhimaoL committed Sep 11, 2018
1 parent 1d0faec commit 6a97d39
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
12 changes: 11 additions & 1 deletion x/vote/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,20 @@ func TestRevokeBasic(t *testing.T) {

// user1 can revoke voter candidancy now
referenceList := &model.ReferenceList{
AllValidators: []types.AccountKey{},
AllValidators: []types.AccountKey{user1},
}
vm.storage.SetReferenceList(ctx, referenceList)
msg5 := NewRevokeStakeMsg("user1")
result2 := handler(ctx, msg5)
assert.Equal(t, ErrValidatorCannotRevoke().Result(), result2)
// invalid user cannot revoke
invalidMsg := NewRevokeStakeMsg("wqwdqwdasdsa")
resultInvalid := handler(ctx, invalidMsg)
assert.Equal(t, model.ErrVoterNotFound().Result(), resultInvalid)
// user1 can revoke voter candidancy now
referenceList = &model.ReferenceList{
AllValidators: []types.AccountKey{},
}

vm.storage.SetReferenceList(ctx, referenceList)
result3 := handler(ctx, msg5)
Expand Down
6 changes: 3 additions & 3 deletions x/vote/wire.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (

// Register concrete types on wire codec
func RegisterWire(cdc *wire.Codec) {
cdc.RegisterConcrete(StakeInMsg{}, "lino/voteDeposit", nil)
cdc.RegisterConcrete(RevokeStakeMsg{}, "lino/voteRevoke", nil)
cdc.RegisterConcrete(StakeOutMsg{}, "lino/voteWithdraw", nil)
cdc.RegisterConcrete(StakeInMsg{}, "lino/stakeIn", nil)
cdc.RegisterConcrete(RevokeStakeMsg{}, "lino/revokeStake", nil)
cdc.RegisterConcrete(StakeOutMsg{}, "lino/stakeOut", nil)
cdc.RegisterConcrete(DelegateMsg{}, "lino/delegate", nil)
cdc.RegisterConcrete(DelegatorWithdrawMsg{}, "lino/delegateWithdraw", nil)
cdc.RegisterConcrete(RevokeDelegationMsg{}, "lino/delegateRevoke", nil)
Expand Down

0 comments on commit 6a97d39

Please sign in to comment.