swap the nonce & chain check order in stack
This commit is contained in:
parent
9fd250209e
commit
007230e583
|
@ -62,8 +62,8 @@ func DefaultHandler(feeDenom string) basecoin.Handler {
|
||||||
base.Logger{},
|
base.Logger{},
|
||||||
stack.Recovery{},
|
stack.Recovery{},
|
||||||
auth.Signatures{},
|
auth.Signatures{},
|
||||||
nonce.ReplayCheck{},
|
|
||||||
base.Chain{},
|
base.Chain{},
|
||||||
|
nonce.ReplayCheck{},
|
||||||
fee.NewSimpleFeeMiddleware(coin.Coin{feeDenom, 0}, fee.Bank),
|
fee.NewSimpleFeeMiddleware(coin.Coin{feeDenom, 0}, fee.Bank),
|
||||||
).Use(d)
|
).Use(d)
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,16 +58,16 @@ func (at *appTest) signTx(tx basecoin.Tx) basecoin.Tx {
|
||||||
|
|
||||||
func (at *appTest) getTx(coins coin.Coins) basecoin.Tx {
|
func (at *appTest) getTx(coins coin.Coins) basecoin.Tx {
|
||||||
tx := at.baseTx(coins)
|
tx := at.baseTx(coins)
|
||||||
tx = base.NewChainTx(at.chainID, 0, tx)
|
|
||||||
tx = nonce.NewTx(1, []basecoin.Actor{at.acctIn.Actor()}, tx)
|
tx = nonce.NewTx(1, []basecoin.Actor{at.acctIn.Actor()}, tx)
|
||||||
|
tx = base.NewChainTx(at.chainID, 0, tx)
|
||||||
return at.signTx(tx)
|
return at.signTx(tx)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (at *appTest) feeTx(coins coin.Coins, toll coin.Coin) basecoin.Tx {
|
func (at *appTest) feeTx(coins coin.Coins, toll coin.Coin) basecoin.Tx {
|
||||||
tx := at.baseTx(coins)
|
tx := at.baseTx(coins)
|
||||||
tx = fee.NewFee(tx, toll, at.acctIn.Actor())
|
tx = fee.NewFee(tx, toll, at.acctIn.Actor())
|
||||||
tx = base.NewChainTx(at.chainID, 0, tx)
|
|
||||||
tx = nonce.NewTx(1, []basecoin.Actor{at.acctIn.Actor()}, tx)
|
tx = nonce.NewTx(1, []basecoin.Actor{at.acctIn.Actor()}, tx)
|
||||||
|
tx = base.NewChainTx(at.chainID, 0, tx)
|
||||||
return at.signTx(tx)
|
return at.signTx(tx)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -73,11 +73,11 @@ func doSendTx(cmd *cobra.Command, args []string) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
tx, err = WrapChainTx(tx)
|
tx, err = WrapNonceTx(tx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
tx, err = WrapNonceTx(tx)
|
tx, err = WrapChainTx(tx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,11 +60,11 @@ func counterTx(cmd *cobra.Command, args []string) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
tx, err = bcmd.WrapChainTx(tx)
|
tx, err = bcmd.WrapNonceTx(tx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
tx, err = bcmd.WrapNonceTx(tx)
|
tx, err = bcmd.WrapChainTx(tx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
@ -102,8 +102,8 @@ func NewHandler(feeDenom string) basecoin.Handler {
|
||||||
base.Logger{},
|
base.Logger{},
|
||||||
stack.Recovery{},
|
stack.Recovery{},
|
||||||
auth.Signatures{},
|
auth.Signatures{},
|
||||||
nonce.ReplayCheck{},
|
|
||||||
base.Chain{},
|
base.Chain{},
|
||||||
|
nonce.ReplayCheck{},
|
||||||
fee.NewSimpleFeeMiddleware(coin.Coin{feeDenom, 0}, fee.Bank),
|
fee.NewSimpleFeeMiddleware(coin.Coin{feeDenom, 0}, fee.Bank),
|
||||||
).Use(dispatcher)
|
).Use(dispatcher)
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,8 +44,8 @@ func TestCounterPlugin(t *testing.T) {
|
||||||
// Deliver a CounterTx
|
// Deliver a CounterTx
|
||||||
DeliverCounterTx := func(valid bool, counterFee coin.Coins, sequence uint32) abci.Result {
|
DeliverCounterTx := func(valid bool, counterFee coin.Coins, sequence uint32) abci.Result {
|
||||||
tx := NewTx(valid, counterFee)
|
tx := NewTx(valid, counterFee)
|
||||||
tx = base.NewChainTx(chainID, 0, tx)
|
|
||||||
tx = nonce.NewTx(sequence, []basecoin.Actor{acct.Actor()}, tx)
|
tx = nonce.NewTx(sequence, []basecoin.Actor{acct.Actor()}, tx)
|
||||||
|
tx = base.NewChainTx(chainID, 0, tx)
|
||||||
stx := auth.NewSig(tx)
|
stx := auth.NewSig(tx)
|
||||||
auth.Sign(stx, acct.Key)
|
auth.Sign(stx, acct.Key)
|
||||||
txBytes := wire.BinaryBytes(stx.Wrap())
|
txBytes := wire.BinaryBytes(stx.Wrap())
|
||||||
|
|
Loading…
Reference in New Issue