-package legacy
+package types
import (
"bytes"
Transactions: []*Tx{
NewTx(TxData{
Version: 1,
- SerializedSize: uint64(46),
+ SerializedSize: uint64(44),
Outputs: []*TxOutput{
- NewTxOutput(bc.AssetID{}, 1, nil, nil),
+ NewTxOutput(bc.AssetID{}, 1, nil),
},
}),
}}
"01" + // version
"01" + // block height
"0000000000000000000000000000000000000000000000000000000000000000" + // prev block hash
- "0000000000000000000000000000000000000000000000000000000000000000" + // seed hash
"00" + // timestamp
"40" + // commitment extensible field length
"0000000000000000000000000000000000000000000000000000000000000000" + // tx merkle root
- "0000000000000000000000000000000000000000000000000000000000000000" + // assets merkle root
- "01" + // tx status
- "00" +
+ "0000000000000000000000000000000000000000000000000000000000000000" + // tx status root
"00" + // nonce
"00" + // bits
"01" + // tx 0, output 0 commitment, amount
"01" + // tx 0, output 0 commitment vm version
"00" + // tx 0, output 0 control program
- "00" + // tx 0, output 0 reference data
- "00" + // tx 0, output 0 output witness
- "00\"") // tx 0 reference data
+ "00\"") // tx 0, output 0 output witness
if !bytes.Equal(got, []byte(wantHex)) {
t.Errorf("marshaled block bytes = %s want %s", got, []byte(wantHex))
"01" + // version
"01" + // block height
"0000000000000000000000000000000000000000000000000000000000000000" + // prev block hash
- "0000000000000000000000000000000000000000000000000000000000000000" + // seed hash
"00" + // timestamp
"40" + // commitment extensible field length
"0000000000000000000000000000000000000000000000000000000000000000" + // transactions merkle root
- "0000000000000000000000000000000000000000000000000000000000000000" + // assets merkle root
- "01" + // tx status
- "00" +
+ "0000000000000000000000000000000000000000000000000000000000000000" + // tx status hash
"00" + // nonce
"00" + // bits
"00") // num transactions
"01" + // version
"01" + // block height
"0000000000000000000000000000000000000000000000000000000000000000" + // prev block hash
- "0000000000000000000000000000000000000000000000000000000000000000" + // seed hash
"00" + // timestamp
"40" + // commitment extensible field length
"0000000000000000000000000000000000000000000000000000000000000000" + // transactions merkle root
- "0000000000000000000000000000000000000000000000000000000000000000" + // assets merkle root
- "01" + // tx status
- "00" +
+ "0000000000000000000000000000000000000000000000000000000000000000" + // tx status hash
"00" + // nonce
"00") // bits
want, _ = hex.DecodeString(wantHex)
t.Errorf("empty block header bytes = %x want %x", got, want)
}
- wantHash := mustDecodeHash("8ba2dd5c6f88f8e95e7647b9342ae473eff81105927b18832c2c884ab673b582")
+ wantHash := mustDecodeHash("9609d2e45760f34cbc6c6d948c3fb9b6d7b61552d9d17fdd5b7d0cb5d2e67244")
if h := block.Hash(); h != wantHash {
t.Errorf("got block hash %x, want %x", h.Bytes(), wantHash.Bytes())
}
"01" + // version
"01" + // block height
"0000000000000000000000000000000000000000000000000000000000000000" + // prev block hash
- "0000000000000000000000000000000000000000000000000000000000000000" + // seed hash
"00" + // timestamp
"40" + // commitment extensible field length
"0000000000000000000000000000000000000000000000000000000000000000" + // transactions merkle root
- "0000000000000000000000000000000000000000000000000000000000000000" + // assets merkle root
- "01" + // tx status
- "00" +
+ "0000000000000000000000000000000000000000000000000000000000000000" + // tx status hash
"00" + // nonce
"00" + // bits
"01" + // num transactions
- "07010000000000") // transaction
+ "070100000000") // transaction
want, _ := hex.DecodeString(wantHex)
if !bytes.Equal(got, want) {
t.Errorf("small block bytes = %x want %x", got, want)