(t *testing.T)
| 23 | ) |
| 24 | |
| 25 | func TestTypes(t *testing.T) { |
| 26 | Convey("Transaction types should be consistent to convert to/from bytes", t, func() { |
| 27 | for tt := TransactionType(0); tt < TransactionTypeNumber; tt++ { |
| 28 | So(tt, ShouldEqual, FromBytes(tt.Bytes())) |
| 29 | } |
| 30 | }) |
| 31 | Convey("Transaction types should be hash stable", t, func() { |
| 32 | var ( |
| 33 | h1, h2 []byte |
| 34 | err error |
| 35 | ) |
| 36 | for tt := TransactionType(0); tt < TransactionTypeNumber; tt++ { |
| 37 | h1, err = tt.MarshalHash() |
| 38 | So(err, ShouldBeNil) |
| 39 | h2, err = tt.MarshalHash() |
| 40 | So(err, ShouldBeNil) |
| 41 | So(h1, ShouldResemble, h2) |
| 42 | } |
| 43 | }) |
| 44 | Convey("Nonce should be hash stable", t, func() { |
| 45 | var ( |
| 46 | h1, h2 []byte |
| 47 | err error |
| 48 | ) |
| 49 | for n := AccountNonce(0); n < AccountNonce(10); n++ { |
| 50 | h1, err = n.MarshalHash() |
| 51 | So(err, ShouldBeNil) |
| 52 | h2, err = n.MarshalHash() |
| 53 | So(err, ShouldBeNil) |
| 54 | So(h1, ShouldResemble, h2) |
| 55 | } |
| 56 | }) |
| 57 | Convey("test string", t, func() { |
| 58 | for i := TransactionTypeTransfer; i != TransactionTypeNumber+1; i++ { |
| 59 | So(i.String(), ShouldNotBeEmpty) |
| 60 | } |
| 61 | }) |
| 62 | } |
nothing calls this directly
no test coverage detected