cosmos-sdk/tx.go

25 lines
426 B
Go
Raw Normal View History

2017-05-17 09:53:53 -07:00
package basecoin
// TODO: add some common functionality here...
// +gen wrapper:"Tx"
type TxInner interface {
2017-05-18 08:11:26 -07:00
Wrap() Tx
}
// TxLayer provides a standard way to deal with "middleware" tx,
// That add context to an embedded tx.
type TxLayer interface {
TxInner
Next() Tx
}
func (t Tx) IsLayer() bool {
_, ok := t.Unwrap().(TxLayer)
return ok
}
func (t Tx) GetLayer() TxLayer {
l, _ := t.Unwrap().(TxLayer)
return l
2017-05-17 09:53:53 -07:00
}