arnaucube
arnaucube/slowlorisdbPublic Self-hosted repository
slowlorisdb/core/tx_test.go
core/tx_test.goRaw
 1package core
 2
 3import (
 4	"testing"
 5
 6	"github.com/stretchr/testify/assert"
 7)
 8
 9func TestTx(t *testing.T) {
10	privK0, err := NewKey()
11	assert.Nil(t, err)
12	pubK0 := privK0.PublicKey
13	privK1, err := NewKey()
14	assert.Nil(t, err)
15	pubK1 := privK1.PublicKey
16
17	tx := NewTx(&pubK0, &pubK1, []Input{}, []Output{})
18
19	assert.Equal(t, tx.From, &pubK0)
20	assert.Equal(t, tx.To, &pubK1)
21
22	assert.True(t, CheckTx(tx))
23}