File tree Expand file tree Collapse file tree 7 files changed +31
-1
lines changed Expand file tree Collapse file tree 7 files changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -109,6 +109,10 @@ func (t AllegraTransaction) Outputs() []TransactionOutput {
109
109
return t .Body .Outputs ()
110
110
}
111
111
112
+ func (t AllegraTransaction ) Fee () uint64 {
113
+ return t .Body .Fee ()
114
+ }
115
+
112
116
func (t AllegraTransaction ) Metadata () * cbor.Value {
113
117
return t .TxMetadata
114
118
}
Original file line number Diff line number Diff line change @@ -204,6 +204,10 @@ func (t AlonzoTransaction) Outputs() []TransactionOutput {
204
204
return t .Body .Outputs ()
205
205
}
206
206
207
+ func (t AlonzoTransaction ) Fee () uint64 {
208
+ return t .Body .Fee ()
209
+ }
210
+
207
211
func (t AlonzoTransaction ) Metadata () * cbor.Value {
208
212
return t .TxMetadata
209
213
}
Original file line number Diff line number Diff line change @@ -318,6 +318,10 @@ func (t BabbageTransaction) Outputs() []TransactionOutput {
318
318
return t .Body .Outputs ()
319
319
}
320
320
321
+ func (t BabbageTransaction ) Fee () uint64 {
322
+ return t .Body .Fee ()
323
+ }
324
+
321
325
func (t BabbageTransaction ) Metadata () * cbor.Value {
322
326
return t .TxMetadata
323
327
}
Original file line number Diff line number Diff line change @@ -124,6 +124,11 @@ func (t *ByronTransaction) Outputs() []TransactionOutput {
124
124
return nil
125
125
}
126
126
127
+ func (t * ByronTransaction ) Fee () uint64 {
128
+ // TODO
129
+ return 0
130
+ }
131
+
127
132
func (t * ByronTransaction ) Metadata () * cbor.Value {
128
133
return t .Attributes
129
134
}
Original file line number Diff line number Diff line change @@ -120,6 +120,10 @@ func (t MaryTransaction) Outputs() []TransactionOutput {
120
120
return t .Body .Outputs ()
121
121
}
122
122
123
+ func (t MaryTransaction ) Fee () uint64 {
124
+ return t .Body .Fee ()
125
+ }
126
+
123
127
func (t MaryTransaction ) Metadata () * cbor.Value {
124
128
return t .TxMetadata
125
129
}
Original file line number Diff line number Diff line change @@ -125,7 +125,7 @@ type ShelleyTransactionBody struct {
125
125
hash string
126
126
TxInputs []ShelleyTransactionInput `cbor:"0,keyasint,omitempty"`
127
127
TxOutputs []ShelleyTransactionOutput `cbor:"1,keyasint,omitempty"`
128
- Fee uint64 `cbor:"2,keyasint,omitempty"`
128
+ TxFee uint64 `cbor:"2,keyasint,omitempty"`
129
129
Ttl uint64 `cbor:"3,keyasint,omitempty"`
130
130
// TODO: figure out how to parse properly
131
131
Certificates cbor.RawMessage `cbor:"4,keyasint,omitempty"`
@@ -169,6 +169,10 @@ func (b *ShelleyTransactionBody) Outputs() []TransactionOutput {
169
169
return ret
170
170
}
171
171
172
+ func (b * ShelleyTransactionBody ) Fee () uint64 {
173
+ return b .TxFee
174
+ }
175
+
172
176
type ShelleyTransactionInput struct {
173
177
cbor.StructAsArray
174
178
TxId Blake2b256
@@ -249,6 +253,10 @@ func (t ShelleyTransaction) Outputs() []TransactionOutput {
249
253
return t .Body .Outputs ()
250
254
}
251
255
256
+ func (t ShelleyTransaction ) Fee () uint64 {
257
+ return t .Body .Fee ()
258
+ }
259
+
252
260
func (t ShelleyTransaction ) Metadata () * cbor.Value {
253
261
return t .TxMetadata
254
262
}
Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ type TransactionBody interface {
32
32
Cbor () []byte
33
33
Inputs () []TransactionInput
34
34
Outputs () []TransactionOutput
35
+ Fee () uint64
35
36
}
36
37
37
38
type TransactionInput interface {
You can’t perform that action at this time.
0 commit comments