From 7676e5994449d52617e326614cc1613bf062bdb6 Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Tue, 19 Apr 2016 02:37:13 -0700 Subject: [PATCH] Fixing tests --- state/execution.go | 2 +- tests/tmsp/main.go | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/state/execution.go b/state/execution.go index 40e113f5d..7063461c1 100644 --- a/state/execution.go +++ b/state/execution.go @@ -112,7 +112,7 @@ func ExecTx(s *State, pgz *types.Plugins, tx types.Tx, isCheckTx bool, evc event // Validate call address plugin := pgz.GetByByte(tx.Type) - if plugin != nil { + if plugin == nil { return tmsp.ErrBaseUnknownAddress.AppendLog( Fmt("Unrecognized type byte %v", tx.Type)) } diff --git a/tests/tmsp/main.go b/tests/tmsp/main.go index 6a6c0d67c..eee955f77 100644 --- a/tests/tmsp/main.go +++ b/tests/tmsp/main.go @@ -95,6 +95,15 @@ func testGov() { if log != "Success" { Exit(Fmt("Failed to set option: %v", log)) } + adminAccount := types.Account{ + PubKey: adminAcc.PubKey, + Sequence: 0, + Balance: types.Coins{{"", 1 << 53}}, + } + log = bcApp.SetOption("base/account", string(wire.JSONBytes(adminAccount))) + if log != "Success" { + Exit(Fmt("Failed to set option: %v", log)) + } // Call InitChain to initialize the validator set bcApp.InitChain([]*tmsp.Validator{ @@ -119,11 +128,11 @@ func testGov() { // Mutate the validator set. proposal := govtypes.Proposal{ ID: "my_proposal_id", - VoteGroupID: "gov/admin", + VoteGroupID: "admin", StartHeight: 0, EndHeight: 0, Info: &govtypes.GroupUpdateProposalInfo{ - UpdateGroupID: "gov/g/validators", + UpdateGroupID: "validators", NextVersion: 0, ChangedMembers: []govtypes.Member{ {nil, 1}, // TODO Fill this out. @@ -143,8 +152,9 @@ func testGov() { Address: adminEntity.Addr, Coins: types.Coins{{"", 1}}, Sequence: 1, + PubKey: adminEntity.PubKey, }, - Data: nil, + Data: wire.BinaryBytes(struct{ govtypes.Tx }{proposalTx}), } tx.SetSignature(nil, adminPrivAcc.Sign(tx.SignBytes(chainID))) res = bcApp.AppendTx(wire.BinaryBytes(struct{ types.Tx }{tx}))