()
| 26 | ) |
| 27 | |
| 28 | func testBlock() *Block { |
| 29 | prog, err := asm.Assemble(txvmtest.SimplePayment) |
| 30 | if err != nil { |
| 31 | panic(err) |
| 32 | } |
| 33 | tx, err := NewTx(prog, 3, 100000) |
| 34 | if err != nil { |
| 35 | panic(err) |
| 36 | } |
| 37 | |
| 38 | return &Block{ |
| 39 | UnsignedBlock: &UnsignedBlock{ |
| 40 | BlockHeader: &BlockHeader{ |
| 41 | Version: 3, |
| 42 | Height: 1, |
| 43 | PreviousBlockId: hashPtr(NewHash([32]byte{1})), |
| 44 | TimestampMs: 1000, |
| 45 | RefsCount: 1, |
| 46 | Runlimit: 50000, |
| 47 | TransactionsRoot: hashPtr(NewHash([32]byte{2})), |
| 48 | ContractsRoot: hashPtr(NewHash([32]byte{3})), |
| 49 | NoncesRoot: hashPtr(NewHash([32]byte{4})), |
| 50 | NextPredicate: &Predicate{ |
| 51 | Version: 1, |
| 52 | Quorum: 1, |
| 53 | Pubkeys: [][]byte{make([]byte, 64)}, |
| 54 | }, |
| 55 | }, |
| 56 | Transactions: []*Tx{tx}, |
| 57 | }, |
| 58 | Arguments: []interface{}{[]byte("a"), int64(5), []*DataItem{{Type: DataType_BYTES, Bytes: []byte("b")}}}, |
| 59 | } |
| 60 | } |
| 61 | |
| 62 | func TestBlockBytes(t *testing.T) { |
| 63 | block := testBlock() |
no test coverage detected