From a908a01fe2fe8300a43a831787fc9fe9c6fbc768 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Sat, 17 Mar 2018 21:54:21 +0100 Subject: [PATCH] types/tx_msg_test.go --- types/tx_msg_test.go | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 types/tx_msg_test.go diff --git a/types/tx_msg_test.go b/types/tx_msg_test.go new file mode 100644 index 000000000..f72cdea26 --- /dev/null +++ b/types/tx_msg_test.go @@ -0,0 +1,30 @@ +package types + +import ( + "testing" + + "github.com/stretchr/testify/assert" + + crypto "github.com/tendermint/go-crypto" +) + +func newStdFee() StdFee { + return NewStdFee(100, + Coin{"atom", 150}, + ) +} + +func TestStdTx(t *testing.T) { + priv := crypto.GenPrivKeyEd25519() + addr := priv.PubKey().Address() + msg := NewTestMsg(addr) + fee := newStdFee() + sigs := []StdSignature{} + + tx := NewStdTx(msg, fee, sigs) + assert.Equal(t, msg, tx.GetMsg()) + assert.Equal(t, sigs, tx.GetSignatures()) + + feePayer := FeePayer(tx) + assert.Equal(t, addr, feePayer) +}