Skip to content

Commit 21a0b34

Browse files
committed
The BPU struct name changed, lots of cleanup
1 parent 71db1ed commit 21a0b34

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

bob.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const (
3333
//
3434
// DO NOT CHANGE ORDER - aligned for memory optimization (malign)
3535
type Tx struct {
36-
bpu.BpuTx
36+
bpu.Tx
3737
}
3838

3939
// NewFromBytes creates a new BOB Tx from a NDJSON line representing a BOB transaction,
@@ -70,7 +70,7 @@ func NewFromTx(tx *bt.Tx) (bobTx *Tx, err error) {
7070

7171
// FromBytes takes a BOB formatted tx string as bytes
7272
func (t *Tx) FromBytes(line []byte) error {
73-
tu := new(bpu.BpuTx)
73+
tu := new(bpu.Tx)
7474
if err := json.Unmarshal(line, &tu); err != nil {
7575
return fmt.Errorf("error parsing line: %v, %w", line, err)
7676
}
@@ -100,7 +100,8 @@ func (t *Tx) FromBytes(line []byte) error {
100100
t.In = tu.In
101101
t.Lock = tu.Lock
102102
t.Out = fixedOuts
103-
t.Tx = tu.Tx
103+
104+
t.Tx.Tx = tu.Tx
104105

105106
// Check for missing hex values and supply them
106107
for outIdx, out := range t.Out {
@@ -169,7 +170,7 @@ func (t *Tx) FromRawTxString(rawTxString string) (err error) {
169170

170171
bpuTx, err := bpu.Parse(bpu.ParseConfig{RawTxHex: &rawTxString, SplitConfig: splitConfig})
171172
if bpuTx != nil {
172-
t.BpuTx = *bpuTx
173+
t.Tx = *bpuTx
173174
}
174175

175176
return
@@ -210,7 +211,7 @@ func (t *Tx) FromTx(tx *bt.Tx) error {
210211
return err
211212
}
212213
if bpuTx != nil {
213-
t.BpuTx = *bpuTx
214+
t.Tx = *bpuTx
214215
}
215216
return nil
216217
}

0 commit comments

Comments
 (0)