File tree Expand file tree Collapse file tree 8 files changed +19
-19
lines changed Expand file tree Collapse file tree 8 files changed +19
-19
lines changed Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ func main() {
89
89
fmt .Printf ("\n Transactions:\n " )
90
90
for _ , tx := range block .Transactions () {
91
91
fmt .Printf (" Hash: %s\n " , tx .Hash ())
92
- if tx .Metadata (). Value () != nil {
92
+ if tx .Metadata () != nil {
93
93
fmt .Printf (" Metadata:\n %#v (%x)\n " , tx .Metadata ().Value (), tx .Metadata ().Cbor ())
94
94
}
95
95
fmt .Printf (" Inputs:\n " )
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ type AllegraBlock struct {
36
36
Header * AllegraBlockHeader
37
37
TransactionBodies []AllegraTransactionBody
38
38
TransactionWitnessSets []ShelleyTransactionWitnessSet
39
- TransactionMetadataSet map [uint ]cbor.Value
39
+ TransactionMetadataSet map [uint ]* cbor.Value
40
40
}
41
41
42
42
func (b * AllegraBlock ) UnmarshalCBOR (cborData []byte ) error {
@@ -94,7 +94,7 @@ type AllegraTransaction struct {
94
94
cbor.DecodeStoreCbor
95
95
Body AllegraTransactionBody
96
96
WitnessSet ShelleyTransactionWitnessSet
97
- TxMetadata cbor.Value
97
+ TxMetadata * cbor.Value
98
98
}
99
99
100
100
func (t AllegraTransaction ) Hash () string {
@@ -109,7 +109,7 @@ func (t AllegraTransaction) Outputs() []TransactionOutput {
109
109
return t .Body .Outputs ()
110
110
}
111
111
112
- func (t AllegraTransaction ) Metadata () cbor.Value {
112
+ func (t AllegraTransaction ) Metadata () * cbor.Value {
113
113
return t .TxMetadata
114
114
}
115
115
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ type AlonzoBlock struct {
37
37
Header * AlonzoBlockHeader
38
38
TransactionBodies []AlonzoTransactionBody
39
39
TransactionWitnessSets []AlonzoTransactionWitnessSet
40
- TransactionMetadataSet map [uint ]cbor.Value
40
+ TransactionMetadataSet map [uint ]* cbor.Value
41
41
InvalidTransactions []uint
42
42
}
43
43
@@ -182,7 +182,7 @@ type AlonzoTransaction struct {
182
182
Body AlonzoTransactionBody
183
183
WitnessSet AlonzoTransactionWitnessSet
184
184
IsValid bool
185
- TxMetadata cbor.Value
185
+ TxMetadata * cbor.Value
186
186
}
187
187
188
188
func (t AlonzoTransaction ) Hash () string {
@@ -197,7 +197,7 @@ func (t AlonzoTransaction) Outputs() []TransactionOutput {
197
197
return t .Body .Outputs ()
198
198
}
199
199
200
- func (t AlonzoTransaction ) Metadata () cbor.Value {
200
+ func (t AlonzoTransaction ) Metadata () * cbor.Value {
201
201
return t .TxMetadata
202
202
}
203
203
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ type BabbageBlock struct {
37
37
Header * BabbageBlockHeader
38
38
TransactionBodies []BabbageTransactionBody
39
39
TransactionWitnessSets []BabbageTransactionWitnessSet
40
- TransactionMetadataSet map [uint ]cbor.Value
40
+ TransactionMetadataSet map [uint ]* cbor.Value
41
41
InvalidTransactions []uint
42
42
}
43
43
@@ -295,7 +295,7 @@ type BabbageTransaction struct {
295
295
Body BabbageTransactionBody
296
296
WitnessSet BabbageTransactionWitnessSet
297
297
IsValid bool
298
- TxMetadata cbor.Value
298
+ TxMetadata * cbor.Value
299
299
}
300
300
301
301
func (t BabbageTransaction ) Hash () string {
@@ -310,7 +310,7 @@ func (t BabbageTransaction) Outputs() []TransactionOutput {
310
310
return t .Body .Outputs ()
311
311
}
312
312
313
- func (t BabbageTransaction ) Metadata () cbor.Value {
313
+ func (t BabbageTransaction ) Metadata () * cbor.Value {
314
314
return t .TxMetadata
315
315
}
316
316
Original file line number Diff line number Diff line change @@ -105,7 +105,7 @@ type ByronTransaction struct {
105
105
// TODO: flesh these out
106
106
TxInputs []any
107
107
TxOutputs []any
108
- Attributes cbor.Value
108
+ Attributes * cbor.Value
109
109
}
110
110
111
111
func (t * ByronTransaction ) Hash () string {
@@ -123,7 +123,7 @@ func (t *ByronTransaction) Outputs() []TransactionOutput {
123
123
return nil
124
124
}
125
125
126
- func (t * ByronTransaction ) Metadata () cbor.Value {
126
+ func (t * ByronTransaction ) Metadata () * cbor.Value {
127
127
return t .Attributes
128
128
}
129
129
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ type MaryBlock struct {
37
37
Header * MaryBlockHeader
38
38
TransactionBodies []MaryTransactionBody
39
39
TransactionWitnessSets []ShelleyTransactionWitnessSet
40
- TransactionMetadataSet map [uint ]cbor.Value
40
+ TransactionMetadataSet map [uint ]* cbor.Value
41
41
}
42
42
43
43
func (b * MaryBlock ) UnmarshalCBOR (cborData []byte ) error {
@@ -104,7 +104,7 @@ type MaryTransaction struct {
104
104
cbor.DecodeStoreCbor
105
105
Body MaryTransactionBody
106
106
WitnessSet ShelleyTransactionWitnessSet
107
- TxMetadata cbor.Value
107
+ TxMetadata * cbor.Value
108
108
}
109
109
110
110
func (t MaryTransaction ) Hash () string {
@@ -119,7 +119,7 @@ func (t MaryTransaction) Outputs() []TransactionOutput {
119
119
return t .Body .Outputs ()
120
120
}
121
121
122
- func (t MaryTransaction ) Metadata () cbor.Value {
122
+ func (t MaryTransaction ) Metadata () * cbor.Value {
123
123
return t .TxMetadata
124
124
}
125
125
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ type ShelleyBlock struct {
36
36
Header * ShelleyBlockHeader
37
37
TransactionBodies []ShelleyTransactionBody
38
38
TransactionWitnessSets []ShelleyTransactionWitnessSet
39
- TransactionMetadataSet map [uint ]cbor.Value
39
+ TransactionMetadataSet map [uint ]* cbor.Value
40
40
}
41
41
42
42
func (b * ShelleyBlock ) UnmarshalCBOR (cborData []byte ) error {
@@ -227,7 +227,7 @@ type ShelleyTransaction struct {
227
227
cbor.DecodeStoreCbor
228
228
Body ShelleyTransactionBody
229
229
WitnessSet ShelleyTransactionWitnessSet
230
- TxMetadata cbor.Value
230
+ TxMetadata * cbor.Value
231
231
}
232
232
233
233
func (t ShelleyTransaction ) Hash () string {
@@ -242,7 +242,7 @@ func (t ShelleyTransaction) Outputs() []TransactionOutput {
242
242
return t .Body .Outputs ()
243
243
}
244
244
245
- func (t ShelleyTransaction ) Metadata () cbor.Value {
245
+ func (t ShelleyTransaction ) Metadata () * cbor.Value {
246
246
return t .TxMetadata
247
247
}
248
248
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ import (
24
24
25
25
type Transaction interface {
26
26
TransactionBody
27
- Metadata () cbor.Value
27
+ Metadata () * cbor.Value
28
28
}
29
29
30
30
type TransactionBody interface {
You can’t perform that action at this time.
0 commit comments