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 {
109109 return t .Body .Outputs ()
110110}
111111
112+ func (t AllegraTransaction ) Fee () uint64 {
113+ return t .Body .Fee ()
114+ }
115+
112116func (t AllegraTransaction ) Metadata () * cbor.Value {
113117 return t .TxMetadata
114118}
Original file line number Diff line number Diff line change @@ -204,6 +204,10 @@ func (t AlonzoTransaction) Outputs() []TransactionOutput {
204204 return t .Body .Outputs ()
205205}
206206
207+ func (t AlonzoTransaction ) Fee () uint64 {
208+ return t .Body .Fee ()
209+ }
210+
207211func (t AlonzoTransaction ) Metadata () * cbor.Value {
208212 return t .TxMetadata
209213}
Original file line number Diff line number Diff line change @@ -318,6 +318,10 @@ func (t BabbageTransaction) Outputs() []TransactionOutput {
318318 return t .Body .Outputs ()
319319}
320320
321+ func (t BabbageTransaction ) Fee () uint64 {
322+ return t .Body .Fee ()
323+ }
324+
321325func (t BabbageTransaction ) Metadata () * cbor.Value {
322326 return t .TxMetadata
323327}
Original file line number Diff line number Diff line change @@ -124,6 +124,11 @@ func (t *ByronTransaction) Outputs() []TransactionOutput {
124124 return nil
125125}
126126
127+ func (t * ByronTransaction ) Fee () uint64 {
128+ // TODO
129+ return 0
130+ }
131+
127132func (t * ByronTransaction ) Metadata () * cbor.Value {
128133 return t .Attributes
129134}
Original file line number Diff line number Diff line change @@ -120,6 +120,10 @@ func (t MaryTransaction) Outputs() []TransactionOutput {
120120 return t .Body .Outputs ()
121121}
122122
123+ func (t MaryTransaction ) Fee () uint64 {
124+ return t .Body .Fee ()
125+ }
126+
123127func (t MaryTransaction ) Metadata () * cbor.Value {
124128 return t .TxMetadata
125129}
Original file line number Diff line number Diff line change @@ -125,7 +125,7 @@ type ShelleyTransactionBody struct {
125125 hash string
126126 TxInputs []ShelleyTransactionInput `cbor:"0,keyasint,omitempty"`
127127 TxOutputs []ShelleyTransactionOutput `cbor:"1,keyasint,omitempty"`
128- Fee uint64 `cbor:"2,keyasint,omitempty"`
128+ TxFee uint64 `cbor:"2,keyasint,omitempty"`
129129 Ttl uint64 `cbor:"3,keyasint,omitempty"`
130130 // TODO: figure out how to parse properly
131131 Certificates cbor.RawMessage `cbor:"4,keyasint,omitempty"`
@@ -169,6 +169,10 @@ func (b *ShelleyTransactionBody) Outputs() []TransactionOutput {
169169 return ret
170170}
171171
172+ func (b * ShelleyTransactionBody ) Fee () uint64 {
173+ return b .TxFee
174+ }
175+
172176type ShelleyTransactionInput struct {
173177 cbor.StructAsArray
174178 TxId Blake2b256
@@ -249,6 +253,10 @@ func (t ShelleyTransaction) Outputs() []TransactionOutput {
249253 return t .Body .Outputs ()
250254}
251255
256+ func (t ShelleyTransaction ) Fee () uint64 {
257+ return t .Body .Fee ()
258+ }
259+
252260func (t ShelleyTransaction ) Metadata () * cbor.Value {
253261 return t .TxMetadata
254262}
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