You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
400 B

  1. package core
  2. import (
  3. "testing"
  4. "github.com/stretchr/testify/assert"
  5. )
  6. func TestTx(t *testing.T) {
  7. privK0, err := NewKey()
  8. assert.Nil(t, err)
  9. pubK0 := privK0.PublicKey
  10. privK1, err := NewKey()
  11. assert.Nil(t, err)
  12. pubK1 := privK1.PublicKey
  13. tx := NewTx(&pubK0, &pubK1, []Input{}, []Output{})
  14. assert.Equal(t, tx.From, &pubK0)
  15. assert.Equal(t, tx.To, &pubK1)
  16. assert.True(t, CheckTx(tx))
  17. }