Skip to content

Commit 0ff1792

Browse files
authored
Feat: Transaction Witnesses (#419)
Signed-off-by: MIxAxIM <[email protected]>
1 parent a027b21 commit 0ff1792

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

input/chainsync/tx.go

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2023 Blink Labs Software
1+
// Copyright 2025 Blink Labs Software
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -17,6 +17,7 @@ package chainsync
1717
import (
1818
"github.com/blinklabs-io/gouroboros/cbor"
1919
"github.com/blinklabs-io/gouroboros/ledger"
20+
lcommon "github.com/blinklabs-io/gouroboros/ledger/common"
2021
)
2122

2223
type TransactionContext struct {
@@ -28,18 +29,19 @@ type TransactionContext struct {
2829
}
2930

3031
type TransactionEvent struct {
31-
Transaction ledger.Transaction `json:"-"`
32-
BlockHash string `json:"blockHash"`
33-
TransactionCbor byteSliceJsonHex `json:"transactionCbor,omitempty"`
34-
Inputs []ledger.TransactionInput `json:"inputs"`
35-
Outputs []ledger.TransactionOutput `json:"outputs"`
36-
Certificates []ledger.Certificate `json:"certificates,omitempty"`
37-
ReferenceInputs []ledger.TransactionInput `json:"referenceInputs,omitempty"`
38-
Metadata *cbor.LazyValue `json:"metadata,omitempty"`
39-
Fee uint64 `json:"fee"`
40-
TTL uint64 `json:"ttl,omitempty"`
41-
ResolvedInputs []ledger.TransactionOutput `json:"resolvedInputs,omitempty"`
42-
Withdrawals map[string]uint64 `json:"withdrawals,omitempty"`
32+
Transaction ledger.Transaction `json:"-"`
33+
BlockHash string `json:"blockHash"`
34+
TransactionCbor byteSliceJsonHex `json:"transactionCbor,omitempty"`
35+
Inputs []ledger.TransactionInput `json:"inputs"`
36+
Outputs []ledger.TransactionOutput `json:"outputs"`
37+
Certificates []ledger.Certificate `json:"certificates,omitempty"`
38+
ReferenceInputs []ledger.TransactionInput `json:"referenceInputs,omitempty"`
39+
Metadata *cbor.LazyValue `json:"metadata,omitempty"`
40+
Fee uint64 `json:"fee"`
41+
TTL uint64 `json:"ttl,omitempty"`
42+
ResolvedInputs []ledger.TransactionOutput `json:"resolvedInputs,omitempty"`
43+
Withdrawals map[string]uint64 `json:"withdrawals,omitempty"`
44+
Witnesses lcommon.TransactionWitnessSet `json:"witnesses,omitempty"`
4345
}
4446

4547
func NewTransactionContext(
@@ -70,6 +72,7 @@ func NewTransactionEvent(
7072
Inputs: tx.Inputs(),
7173
Outputs: tx.Outputs(),
7274
Fee: tx.Fee(),
75+
Witnesses: tx.Witnesses(),
7376
}
7477
if includeCbor {
7578
evt.TransactionCbor = tx.Cbor()

0 commit comments

Comments
 (0)