Fix up all tests to handle NewChainTx change

This commit is contained in:
Ethan Frey
2017-07-10 11:57:37 +02:00
parent af9ce5b553
commit 100d88d7dd
5 changed files with 36 additions and 8 deletions
+9
View File
@@ -44,10 +44,19 @@ func (c Chain) DeliverTx(ctx basecoin.Context, store state.KVStore, tx basecoin.
// checkChain makes sure the tx is a Chain Tx and is on the proper chain
func (c Chain) checkChain(chainID string, tx basecoin.Tx) (basecoin.Tx, error) {
// make sure it is a chaintx
ctx, ok := tx.Unwrap().(ChainTx)
if !ok {
return tx, errors.ErrNoChain()
}
// basic validation
err := ctx.ValidateBasic()
if err != nil {
return tx, err
}
// compare against state
if ctx.ChainID != chainID {
return tx, errors.ErrWrongChain(ctx.ChainID)
}