From ed943a7274eb7e4adcd0fe86994d9f41803a6626 Mon Sep 17 00:00:00 2001 From: Chris Gianelloni Date: Thu, 2 Oct 2025 19:47:25 -0400 Subject: [PATCH 1/2] fix(ledger): use transactions for leios endorser blocks Since Leios Endorser Blocks do not have the transaction contents in their CBOR representation, we do not have a container for them. Add `transactions` to allow us to store them in the block once resolved for later retrieval, such as via the `Transactions()` func. Signed-off-by: Chris Gianelloni --- ledger/leios/leios.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ledger/leios/leios.go b/ledger/leios/leios.go index 685f2664..884c1448 100644 --- a/ledger/leios/leios.go +++ b/ledger/leios/leios.go @@ -64,7 +64,8 @@ type LeiosEndorserBlock struct { cbor.DecodeStoreCbor cbor.StructAsArray hash *common.Blake2b256 - TxReferences []common.TxReference + transactions []common.Transaction + TxReferences []common.TxReference `cbor:"0,keyasint"` } func (h *LeiosBlockHeader) UnmarshalCBOR(cborData []byte) error { @@ -153,9 +154,7 @@ func (b *LeiosEndorserBlock) PrevHash() common.Blake2b256 { } func (b *LeiosEndorserBlock) Transactions() []common.Transaction { - // TODO: convert TxReferences into []Transaction - // TxReferences []common.TxReference - return []common.Transaction{} + return b.transactions } func (b *LeiosEndorserBlock) Utxorpc() (*utxorpc.Block, error) { From a636f93d11f85ae890ddc0599397122523573a2f Mon Sep 17 00:00:00 2001 From: Chris Gianelloni Date: Thu, 2 Oct 2025 22:16:21 -0400 Subject: [PATCH 2/2] fix: remove annotation from struct Signed-off-by: Chris Gianelloni --- ledger/leios/leios.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ledger/leios/leios.go b/ledger/leios/leios.go index 884c1448..f11f1427 100644 --- a/ledger/leios/leios.go +++ b/ledger/leios/leios.go @@ -65,7 +65,7 @@ type LeiosEndorserBlock struct { cbor.StructAsArray hash *common.Blake2b256 transactions []common.Transaction - TxReferences []common.TxReference `cbor:"0,keyasint"` + TxReferences []common.TxReference } func (h *LeiosBlockHeader) UnmarshalCBOR(cborData []byte) error {