Skip to content

Commit 0f7ceee

Browse files
committed
Merge branch 'master' into bopen-master
2 parents f1684a7 + 3919971 commit 0f7ceee

File tree

3 files changed

+29
-9
lines changed

3 files changed

+29
-9
lines changed

CHANGELOG.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
44

55
## Table of Contents
6-
7-
- [1.1.25 - 2025-05-09](#1124---2025-05-09)
8-
- [1.1.24 - 2025-04-24](#1123---2025-04-29)
6+
- [1.1.27 - 2025-05-15](#1127---2025-05-15)
7+
- [1.1.26 - 2025-05-14](#1126---2025-05-14)
8+
- [1.1.25 - 2025-05-09](#1125---2025-05-09)
9+
- [1.1.24 - 2025-04-24](#1124---2025-04-29)
910
- [1.1.23 - 2025-04-23](#1123---2025-04-23)
1011
- [1.1.22 - 2025-03-14](#1122---2025-03-14)
1112
- [1.1.21 - 2025-03-12](#1121---2025-03-12)
@@ -34,7 +35,15 @@ All notable changes to this project will be documented in this file. The format
3435

3536
## [1.1.25] - 2025-05-09
3637
### Fix
37-
- nill pointer
38+
- Fix BRC77 message signing to match ts-sdk
39+
40+
## [1.1.26] - 2025-05-14
41+
### Updated
42+
- Support AtomicBeef in NewBeefFromBytes
43+
44+
## [1.1.25] - 2025-05-09
45+
### Fix
46+
- nil pointer
3847

3948
## [1.1.24] - 2025-04-29
4049
### Added

transaction/beef.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,6 @@ func readBeefTx(reader *bytes.Reader, BUMPs []*MerklePath) (*map[string]*BeefTx,
112112
sourceTxid := input.SourceTXID.String()
113113
if sourceObj, ok := txs[sourceTxid]; ok {
114114
input.SourceTransaction = sourceObj.Transaction
115-
// TODO: Need to update logic to match ts-sdk
116-
// } else if beefTx.Transaction.MerklePath == nil && beefTx.KnownTxID == nil {
117-
// return nil, fmt.Errorf("reference to unknown txid in bump: %s", sourceTxid)
118115
}
119116
}
120117

@@ -127,8 +124,12 @@ func readBeefTx(reader *bytes.Reader, BUMPs []*MerklePath) (*map[string]*BeefTx,
127124
}
128125

129126
func NewBeefFromBytes(beef []byte) (*Beef, error) {
130-
reader := bytes.NewReader(beef)
131-
127+
var reader *bytes.Reader
128+
if binary.LittleEndian.Uint32(beef[:4]) == ATOMIC_BEEF {
129+
reader = bytes.NewReader(beef[36:])
130+
} else {
131+
reader = bytes.NewReader(beef)
132+
}
132133
version, err := readVersion(reader)
133134
if err != nil {
134135
return nil, err

transaction/beef_test.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,19 @@ func TestNewBEEFFromBytes(t *testing.T) {
9797
require.Len(t, beef.BUMPs, 3, "BUMPs length does not match")
9898
require.Len(t, beef.Transactions, 3, "Transactions length does not match")
9999

100+
tx := beef.FindTransaction("b1fc0f44ba629dbdffab9e34fcc4faf9dbde3560a7365c55c26fe4daab052aac")
101+
require.NotNil(t, tx, "Transaction not found in BEEF data")
102+
103+
atomic, err := tx.AtomicBEEF(false)
104+
require.NoError(t, err, "AtomicBEEF method failed")
105+
106+
_, err = NewTransactionFromBEEF(atomic)
107+
require.NoError(t, err, "NewTransactionFromBEEF method failed")
108+
100109
binary.LittleEndian.PutUint32(beefBytes[0:4], 0xdeadbeef)
101110
_, err = NewTransactionFromBEEF(beefBytes)
102111
require.Error(t, err, "use NewBeefFromBytes to parse anything which isn't V1 BEEF or AtomicBEEF")
112+
103113
}
104114

105115
func TestBeefTransactionFinding(t *testing.T) {

0 commit comments

Comments
 (0)