basecoin compiles

This commit is contained in:
Ethan Buchman
2018-01-14 22:49:57 -05:00
parent d2a801a513
commit 381424460c
8 changed files with 42 additions and 28 deletions
+16 -1
View File
@@ -1,6 +1,9 @@
package types
import crypto "github.com/tendermint/go-crypto"
import (
crypto "github.com/tendermint/go-crypto"
wire "github.com/tendermint/go-wire"
)
type Msg interface {
@@ -45,9 +48,21 @@ type Tx interface {
GetSignatures() []StdSignature
}
var _ Tx = (*StdTx)(nil)
type StdTx struct {
Msg
Signatures []StdSignature
}
func (tx StdTx) GetFeePayer() crypto.Address { return tx.Signatures[0].PubKey.Address() }
func (tx StdTx) GetTxBytes() []byte {
bz, err := wire.MarshalBinary(tx)
if err != nil {
panic(err)
}
return bz
}
func (tx StdTx) GetSignatures() []StdSignature { return tx.Signatures }
type TxDecoder func(txBytes []byte) (Tx, error)