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 @@ -117,6 +117,10 @@ func (t AllegraTransaction) Outputs() []TransactionOutput {
117117 return t .Body .Outputs ()
118118}
119119
120+ func (t AllegraTransaction ) Fee () uint64 {
121+ return t .Body .Fee ()
122+ }
123+
120124func (t AllegraTransaction ) Metadata () * cbor.Value {
121125 return t .TxMetadata
122126}
Original file line number Diff line number Diff line change @@ -212,6 +212,10 @@ func (t AlonzoTransaction) Outputs() []TransactionOutput {
212212 return t .Body .Outputs ()
213213}
214214
215+ func (t AlonzoTransaction ) Fee () uint64 {
216+ return t .Body .Fee ()
217+ }
218+
215219func (t AlonzoTransaction ) Metadata () * cbor.Value {
216220 return t .TxMetadata
217221}
Original file line number Diff line number Diff line change @@ -334,6 +334,10 @@ func (t BabbageTransaction) Outputs() []TransactionOutput {
334334 return t .Body .Outputs ()
335335}
336336
337+ func (t BabbageTransaction ) Fee () uint64 {
338+ return t .Body .Fee ()
339+ }
340+
337341func (t BabbageTransaction ) Metadata () * cbor.Value {
338342 return t .TxMetadata
339343}
Original file line number Diff line number Diff line change @@ -134,6 +134,11 @@ func (t *ByronTransaction) Outputs() []TransactionOutput {
134134 return nil
135135}
136136
137+ func (t * ByronTransaction ) Fee () uint64 {
138+ // TODO
139+ return 0
140+ }
141+
137142func (t * ByronTransaction ) Metadata () * cbor.Value {
138143 return t .Attributes
139144}
Original file line number Diff line number Diff line change @@ -128,6 +128,10 @@ func (t MaryTransaction) Outputs() []TransactionOutput {
128128 return t .Body .Outputs ()
129129}
130130
131+ func (t MaryTransaction ) Fee () uint64 {
132+ return t .Body .Fee ()
133+ }
134+
131135func (t MaryTransaction ) Metadata () * cbor.Value {
132136 return t .TxMetadata
133137}
Original file line number Diff line number Diff line change @@ -141,7 +141,7 @@ type ShelleyTransactionBody struct {
141141 hash string
142142 TxInputs []ShelleyTransactionInput `cbor:"0,keyasint,omitempty"`
143143 TxOutputs []ShelleyTransactionOutput `cbor:"1,keyasint,omitempty"`
144- Fee uint64 `cbor:"2,keyasint,omitempty"`
144+ TxFee uint64 `cbor:"2,keyasint,omitempty"`
145145 Ttl uint64 `cbor:"3,keyasint,omitempty"`
146146 // TODO: figure out how to parse properly
147147 Certificates cbor.RawMessage `cbor:"4,keyasint,omitempty"`
@@ -185,6 +185,10 @@ func (b *ShelleyTransactionBody) Outputs() []TransactionOutput {
185185 return ret
186186}
187187
188+ func (b * ShelleyTransactionBody ) Fee () uint64 {
189+ return b .TxFee
190+ }
191+
188192type ShelleyTransactionInput struct {
189193 cbor.StructAsArray
190194 TxId Blake2b256
@@ -265,6 +269,10 @@ func (t ShelleyTransaction) Outputs() []TransactionOutput {
265269 return t .Body .Outputs ()
266270}
267271
272+ func (t ShelleyTransaction ) Fee () uint64 {
273+ return t .Body .Fee ()
274+ }
275+
268276func (t ShelleyTransaction ) Metadata () * cbor.Value {
269277 return t .TxMetadata
270278}
Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ type TransactionBody interface {
3232 Cbor () []byte
3333 Inputs () []TransactionInput
3434 Outputs () []TransactionOutput
35+ Fee () uint64
3536}
3637
3738type TransactionInput interface {
You can’t perform that action at this time.
0 commit comments