Fixing tests

This commit is contained in:
Jae Kwon 2016-04-19 02:37:13 -07:00
parent ce2b8904d6
commit 7676e59944
2 changed files with 14 additions and 4 deletions

View File

@ -112,7 +112,7 @@ func ExecTx(s *State, pgz *types.Plugins, tx types.Tx, isCheckTx bool, evc event
// Validate call address // Validate call address
plugin := pgz.GetByByte(tx.Type) plugin := pgz.GetByByte(tx.Type)
if plugin != nil { if plugin == nil {
return tmsp.ErrBaseUnknownAddress.AppendLog( return tmsp.ErrBaseUnknownAddress.AppendLog(
Fmt("Unrecognized type byte %v", tx.Type)) Fmt("Unrecognized type byte %v", tx.Type))
} }

View File

@ -95,6 +95,15 @@ func testGov() {
if log != "Success" { if log != "Success" {
Exit(Fmt("Failed to set option: %v", log)) 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 // Call InitChain to initialize the validator set
bcApp.InitChain([]*tmsp.Validator{ bcApp.InitChain([]*tmsp.Validator{
@ -119,11 +128,11 @@ func testGov() {
// Mutate the validator set. // Mutate the validator set.
proposal := govtypes.Proposal{ proposal := govtypes.Proposal{
ID: "my_proposal_id", ID: "my_proposal_id",
VoteGroupID: "gov/admin", VoteGroupID: "admin",
StartHeight: 0, StartHeight: 0,
EndHeight: 0, EndHeight: 0,
Info: &govtypes.GroupUpdateProposalInfo{ Info: &govtypes.GroupUpdateProposalInfo{
UpdateGroupID: "gov/g/validators", UpdateGroupID: "validators",
NextVersion: 0, NextVersion: 0,
ChangedMembers: []govtypes.Member{ ChangedMembers: []govtypes.Member{
{nil, 1}, // TODO Fill this out. {nil, 1}, // TODO Fill this out.
@ -143,8 +152,9 @@ func testGov() {
Address: adminEntity.Addr, Address: adminEntity.Addr,
Coins: types.Coins{{"", 1}}, Coins: types.Coins{{"", 1}},
Sequence: 1, Sequence: 1,
PubKey: adminEntity.PubKey,
}, },
Data: nil, Data: wire.BinaryBytes(struct{ govtypes.Tx }{proposalTx}),
} }
tx.SetSignature(nil, adminPrivAcc.Sign(tx.SignBytes(chainID))) tx.SetSignature(nil, adminPrivAcc.Sign(tx.SignBytes(chainID)))
res = bcApp.AppendTx(wire.BinaryBytes(struct{ types.Tx }{tx})) res = bcApp.AppendTx(wire.BinaryBytes(struct{ types.Tx }{tx}))