Skip to content

Commit 210e958

Browse files
committed
chore(deps): utxorpc/go-codegen 0.18.1
Signed-off-by: Chris Gianelloni <[email protected]>
1 parent ce49039 commit 210e958

File tree

14 files changed

+203
-117
lines changed

14 files changed

+203
-117
lines changed

go.mod

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ require (
1212
github.com/fxamacker/cbor/v2 v2.9.0
1313
github.com/jinzhu/copier v0.4.0
1414
github.com/stretchr/testify v1.11.1
15-
github.com/utxorpc/go-codegen v0.17.0
15+
github.com/utxorpc/go-codegen v0.18.1
1616
go.uber.org/goleak v1.3.0
1717
golang.org/x/crypto v0.43.0
1818
)
@@ -25,12 +25,11 @@ require (
2525
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
2626
github.com/decred/dcrd/crypto/blake256 v1.1.0 // indirect
2727
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect
28-
github.com/google/go-cmp v0.6.0 // indirect
2928
github.com/kr/text v0.2.0 // indirect
3029
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
3130
github.com/rogpeppe/go-internal v1.14.1 // indirect
3231
github.com/x448/float16 v0.8.4 // indirect
3332
golang.org/x/sys v0.37.0 // indirect
34-
google.golang.org/protobuf v1.36.6 // indirect
33+
google.golang.org/protobuf v1.36.10 // indirect
3534
gopkg.in/yaml.v3 v3.0.1 // indirect
3635
)

go.sum

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEW
6363
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
6464
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
6565
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
66-
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
67-
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
66+
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
67+
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
6868
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
6969
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
7070
github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
@@ -103,8 +103,8 @@ github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXl
103103
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
104104
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
105105
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc=
106-
github.com/utxorpc/go-codegen v0.17.0 h1:cJ7Df9r8Az39lveIcmzcRciIDc3UJFdMSmXg8IAtBPM=
107-
github.com/utxorpc/go-codegen v0.17.0/go.mod h1:LBVGFns4YAHMhy+Pc8tF5ExkU+N8Wm3srst4omKZy4g=
106+
github.com/utxorpc/go-codegen v0.18.1 h1:2eenzXCkqvB2+g8MCq70MBR6koWs9CeTihZ0AqUvLDY=
107+
github.com/utxorpc/go-codegen v0.18.1/go.mod h1:DFij3zIGDM39BYCuzrz1rSuO3kTIIiHglWV0043wQxo=
108108
github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=
109109
github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg=
110110
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
@@ -143,8 +143,8 @@ google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQ
143143
google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
144144
google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
145145
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
146-
google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY=
147-
google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY=
146+
google.golang.org/protobuf v1.36.10 h1:AYd7cD/uASjIL6Q9LiTjz8JLcrh/88q5UObnmY3aOOE=
147+
google.golang.org/protobuf v1.36.10/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=
148148
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
149149
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
150150
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=

ledger/alonzo/alonzo.go

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -454,8 +454,13 @@ func (o AlonzoTransactionOutput) Utxorpc() (*utxorpc.TxOutput, error) {
454454
for _, assetName := range tmpAssets.Assets(policyId) {
455455
amount := tmpAssets.Asset(policyId, assetName)
456456
asset := &utxorpc.Asset{
457-
Name: assetName,
458-
OutputCoin: amount,
457+
Name: assetName,
458+
// #nosec G115
459+
Quantity: &utxorpc.Asset_OutputCoin{
460+
OutputCoin: &utxorpc.BigInt{
461+
BigInt: &utxorpc.BigInt_Int{Int: int64(amount)},
462+
},
463+
},
459464
}
460465
ma.Assets = append(ma.Assets, asset)
461466
}
@@ -476,8 +481,11 @@ func (o AlonzoTransactionOutput) Utxorpc() (*utxorpc.TxOutput, error) {
476481

477482
return &utxorpc.TxOutput{
478483
Address: addressBytes,
479-
Coin: o.Amount(),
480-
Assets: assets,
484+
// #nosec G115
485+
Coin: &utxorpc.BigInt{
486+
BigInt: &utxorpc.BigInt_Int{Int: int64(o.Amount())},
487+
},
488+
Assets: assets,
481489
Datum: &utxorpc.Datum{
482490
Hash: datumHash,
483491
},

ledger/alonzo/pparams.go

Lines changed: 33 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
"github.com/blinklabs-io/gouroboros/cbor"
2525
"github.com/blinklabs-io/gouroboros/ledger/common"
2626
"github.com/blinklabs-io/gouroboros/ledger/mary"
27-
cardano "github.com/utxorpc/go-codegen/utxorpc/v1alpha/cardano"
27+
utxorpc "github.com/utxorpc/go-codegen/utxorpc/v1alpha/cardano"
2828
)
2929

3030
// Constants for Plutus version mapping
@@ -274,7 +274,7 @@ func (u *AlonzoProtocolParameterUpdate) UnmarshalCBOR(cborData []byte) error {
274274
return nil
275275
}
276276

277-
func (p *AlonzoProtocolParameters) Utxorpc() (*cardano.PParams, error) {
277+
func (p *AlonzoProtocolParameters) Utxorpc() (*utxorpc.PParams, error) {
278278
// sanity check
279279
if p.A0.Num().Int64() > math.MaxInt32 ||
280280
p.A0.Denom().Int64() < 0 ||
@@ -302,31 +302,43 @@ func (p *AlonzoProtocolParameters) Utxorpc() (*cardano.PParams, error) {
302302
return nil, errors.New("invalid step price rational number values")
303303
}
304304
// #nosec G115
305-
return &cardano.PParams{
306-
CoinsPerUtxoByte: p.AdaPerUtxoByte,
307-
MaxTxSize: uint64(p.MaxTxSize),
308-
MinFeeCoefficient: uint64(p.MinFeeA),
309-
MinFeeConstant: uint64(p.MinFeeB),
310-
MaxBlockBodySize: uint64(p.MaxBlockBodySize),
311-
MaxBlockHeaderSize: uint64(p.MaxBlockHeaderSize),
312-
StakeKeyDeposit: uint64(p.KeyDeposit),
313-
PoolDeposit: uint64(p.PoolDeposit),
305+
return &utxorpc.PParams{
306+
CoinsPerUtxoByte: &utxorpc.BigInt{
307+
BigInt: &utxorpc.BigInt_Int{Int: int64(p.AdaPerUtxoByte)},
308+
},
309+
MaxTxSize: uint64(p.MaxTxSize),
310+
MinFeeCoefficient: &utxorpc.BigInt{
311+
BigInt: &utxorpc.BigInt_Int{Int: int64(p.MinFeeA)},
312+
},
313+
MinFeeConstant: &utxorpc.BigInt{
314+
BigInt: &utxorpc.BigInt_Int{Int: int64(p.MinFeeB)},
315+
},
316+
MaxBlockBodySize: uint64(p.MaxBlockBodySize),
317+
MaxBlockHeaderSize: uint64(p.MaxBlockHeaderSize),
318+
StakeKeyDeposit: &utxorpc.BigInt{
319+
BigInt: &utxorpc.BigInt_Int{Int: int64(p.KeyDeposit)},
320+
},
321+
PoolDeposit: &utxorpc.BigInt{
322+
BigInt: &utxorpc.BigInt_Int{Int: int64(p.PoolDeposit)},
323+
},
314324
PoolRetirementEpochBound: uint64(p.MaxEpoch),
315325
DesiredNumberOfPools: uint64(p.NOpt),
316-
PoolInfluence: &cardano.RationalNumber{
326+
PoolInfluence: &utxorpc.RationalNumber{
317327
Numerator: int32(p.A0.Num().Int64()),
318328
Denominator: uint32(p.A0.Denom().Int64()),
319329
},
320-
MonetaryExpansion: &cardano.RationalNumber{
330+
MonetaryExpansion: &utxorpc.RationalNumber{
321331
Numerator: int32(p.Rho.Num().Int64()),
322332
Denominator: uint32(p.Rho.Denom().Int64()),
323333
},
324-
TreasuryExpansion: &cardano.RationalNumber{
334+
TreasuryExpansion: &utxorpc.RationalNumber{
325335
Numerator: int32(p.Tau.Num().Int64()),
326336
Denominator: uint32(p.Tau.Denom().Int64()),
327337
},
328-
MinPoolCost: p.MinPoolCost,
329-
ProtocolVersion: &cardano.ProtocolVersion{
338+
MinPoolCost: &utxorpc.BigInt{
339+
BigInt: &utxorpc.BigInt_Int{Int: int64(p.MinPoolCost)},
340+
},
341+
ProtocolVersion: &utxorpc.ProtocolVersion{
330342
Major: uint32(p.ProtocolMajor),
331343
Minor: uint32(p.ProtocolMinor),
332344
},
@@ -336,21 +348,21 @@ func (p *AlonzoProtocolParameters) Utxorpc() (*cardano.PParams, error) {
336348
CostModels: common.ConvertToUtxorpcCardanoCostModels(
337349
p.CostModels,
338350
),
339-
Prices: &cardano.ExPrices{
340-
Memory: &cardano.RationalNumber{
351+
Prices: &utxorpc.ExPrices{
352+
Memory: &utxorpc.RationalNumber{
341353
Numerator: int32(p.ExecutionCosts.MemPrice.Num().Int64()),
342354
Denominator: uint32(p.ExecutionCosts.MemPrice.Denom().Int64()),
343355
},
344-
Steps: &cardano.RationalNumber{
356+
Steps: &utxorpc.RationalNumber{
345357
Numerator: int32(p.ExecutionCosts.StepPrice.Num().Int64()),
346358
Denominator: uint32(p.ExecutionCosts.StepPrice.Denom().Int64()),
347359
},
348360
},
349-
MaxExecutionUnitsPerTransaction: &cardano.ExUnits{
361+
MaxExecutionUnitsPerTransaction: &utxorpc.ExUnits{
350362
Memory: uint64(p.MaxTxExUnits.Memory),
351363
Steps: uint64(p.MaxTxExUnits.Steps),
352364
},
353-
MaxExecutionUnitsPerBlock: &cardano.ExUnits{
365+
MaxExecutionUnitsPerBlock: &utxorpc.ExUnits{
354366
Memory: uint64(p.MaxBlockExUnits.Memory),
355367
Steps: uint64(p.MaxBlockExUnits.Steps),
356368
},

ledger/babbage/babbage.go

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -637,8 +637,13 @@ func (o BabbageTransactionOutput) Utxorpc() (*utxorpc.TxOutput, error) {
637637
for _, assetName := range tmpAssets.Assets(policyId) {
638638
amount := tmpAssets.Asset(policyId, assetName)
639639
asset := &utxorpc.Asset{
640-
Name: assetName,
641-
OutputCoin: amount,
640+
Name: assetName,
641+
// #nosec G115
642+
Quantity: &utxorpc.Asset_OutputCoin{
643+
OutputCoin: &utxorpc.BigInt{
644+
BigInt: &utxorpc.BigInt_Int{Int: int64(amount)},
645+
},
646+
},
642647
}
643648
ma.Assets = append(ma.Assets, asset)
644649
}
@@ -655,8 +660,11 @@ func (o BabbageTransactionOutput) Utxorpc() (*utxorpc.TxOutput, error) {
655660

656661
return &utxorpc.TxOutput{
657662
Address: address,
658-
Coin: o.Amount(),
659-
Assets: assets,
663+
// #nosec G115
664+
Coin: &utxorpc.BigInt{
665+
BigInt: &utxorpc.BigInt_Int{Int: int64(o.Amount())},
666+
},
667+
Assets: assets,
660668
Datum: &utxorpc.Datum{
661669
Hash: datumHash,
662670
// OriginalCbor: o.Datum().Cbor(),

ledger/babbage/pparams.go

Lines changed: 33 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121
"github.com/blinklabs-io/gouroboros/cbor"
2222
"github.com/blinklabs-io/gouroboros/ledger/alonzo"
2323
"github.com/blinklabs-io/gouroboros/ledger/common"
24-
cardano "github.com/utxorpc/go-codegen/utxorpc/v1alpha/cardano"
24+
utxorpc "github.com/utxorpc/go-codegen/utxorpc/v1alpha/cardano"
2525
)
2626

2727
// BabbageProtocolParameters represents the current Babbage protocol parameters as seen in local-state-query
@@ -163,7 +163,7 @@ func (u *BabbageProtocolParameterUpdate) UnmarshalCBOR(cborData []byte) error {
163163
return nil
164164
}
165165

166-
func (p *BabbageProtocolParameters) Utxorpc() (*cardano.PParams, error) {
166+
func (p *BabbageProtocolParameters) Utxorpc() (*utxorpc.PParams, error) {
167167
// sanity check
168168
if p.A0.Num().Int64() > math.MaxInt32 ||
169169
p.A0.Denom().Int64() < 0 ||
@@ -191,31 +191,43 @@ func (p *BabbageProtocolParameters) Utxorpc() (*cardano.PParams, error) {
191191
return nil, errors.New("invalid step price rational number values")
192192
}
193193
// #nosec G115
194-
return &cardano.PParams{
195-
CoinsPerUtxoByte: p.AdaPerUtxoByte,
196-
MaxTxSize: uint64(p.MaxTxSize),
197-
MinFeeCoefficient: uint64(p.MinFeeA),
198-
MinFeeConstant: uint64(p.MinFeeB),
199-
MaxBlockBodySize: uint64(p.MaxBlockBodySize),
200-
MaxBlockHeaderSize: uint64(p.MaxBlockHeaderSize),
201-
StakeKeyDeposit: uint64(p.KeyDeposit),
202-
PoolDeposit: uint64(p.PoolDeposit),
194+
return &utxorpc.PParams{
195+
CoinsPerUtxoByte: &utxorpc.BigInt{
196+
BigInt: &utxorpc.BigInt_Int{Int: int64(p.AdaPerUtxoByte)},
197+
},
198+
MaxTxSize: uint64(p.MaxTxSize),
199+
MinFeeCoefficient: &utxorpc.BigInt{
200+
BigInt: &utxorpc.BigInt_Int{Int: int64(p.MinFeeA)},
201+
},
202+
MinFeeConstant: &utxorpc.BigInt{
203+
BigInt: &utxorpc.BigInt_Int{Int: int64(p.MinFeeB)},
204+
},
205+
MaxBlockBodySize: uint64(p.MaxBlockBodySize),
206+
MaxBlockHeaderSize: uint64(p.MaxBlockHeaderSize),
207+
StakeKeyDeposit: &utxorpc.BigInt{
208+
BigInt: &utxorpc.BigInt_Int{Int: int64(p.KeyDeposit)},
209+
},
210+
PoolDeposit: &utxorpc.BigInt{
211+
BigInt: &utxorpc.BigInt_Int{Int: int64(p.PoolDeposit)},
212+
},
203213
PoolRetirementEpochBound: uint64(p.MaxEpoch),
204214
DesiredNumberOfPools: uint64(p.NOpt),
205-
PoolInfluence: &cardano.RationalNumber{
215+
PoolInfluence: &utxorpc.RationalNumber{
206216
Numerator: int32(p.A0.Num().Int64()),
207217
Denominator: uint32(p.A0.Denom().Int64()),
208218
},
209-
MonetaryExpansion: &cardano.RationalNumber{
219+
MonetaryExpansion: &utxorpc.RationalNumber{
210220
Numerator: int32(p.Rho.Num().Int64()),
211221
Denominator: uint32(p.Rho.Denom().Int64()),
212222
},
213-
TreasuryExpansion: &cardano.RationalNumber{
223+
TreasuryExpansion: &utxorpc.RationalNumber{
214224
Numerator: int32(p.Tau.Num().Int64()),
215225
Denominator: uint32(p.Tau.Denom().Int64()),
216226
},
217-
MinPoolCost: p.MinPoolCost,
218-
ProtocolVersion: &cardano.ProtocolVersion{
227+
MinPoolCost: &utxorpc.BigInt{
228+
BigInt: &utxorpc.BigInt_Int{Int: int64(p.MinPoolCost)},
229+
},
230+
ProtocolVersion: &utxorpc.ProtocolVersion{
219231
Major: uint32(p.ProtocolMajor),
220232
Minor: uint32(p.ProtocolMinor),
221233
},
@@ -225,21 +237,21 @@ func (p *BabbageProtocolParameters) Utxorpc() (*cardano.PParams, error) {
225237
CostModels: common.ConvertToUtxorpcCardanoCostModels(
226238
p.CostModels,
227239
),
228-
Prices: &cardano.ExPrices{
229-
Memory: &cardano.RationalNumber{
240+
Prices: &utxorpc.ExPrices{
241+
Memory: &utxorpc.RationalNumber{
230242
Numerator: int32(p.ExecutionCosts.MemPrice.Num().Int64()),
231243
Denominator: uint32(p.ExecutionCosts.MemPrice.Denom().Int64()),
232244
},
233-
Steps: &cardano.RationalNumber{
245+
Steps: &utxorpc.RationalNumber{
234246
Numerator: int32(p.ExecutionCosts.StepPrice.Num().Int64()),
235247
Denominator: uint32(p.ExecutionCosts.StepPrice.Denom().Int64()),
236248
},
237249
},
238-
MaxExecutionUnitsPerTransaction: &cardano.ExUnits{
250+
MaxExecutionUnitsPerTransaction: &utxorpc.ExUnits{
239251
Memory: uint64(p.MaxTxExUnits.Memory),
240252
Steps: uint64(p.MaxTxExUnits.Steps),
241253
},
242-
MaxExecutionUnitsPerBlock: &cardano.ExUnits{
254+
MaxExecutionUnitsPerBlock: &utxorpc.ExUnits{
243255
Memory: uint64(p.MaxBlockExUnits.Memory),
244256
Steps: uint64(p.MaxBlockExUnits.Steps),
245257
},

ledger/byron/byron.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,10 @@ func (o ByronTransactionOutput) Utxorpc() (*utxorpc.TxOutput, error) {
496496
}
497497
return &utxorpc.TxOutput{
498498
Address: addressBytes,
499-
Coin: o.Amount(),
499+
// #nosec G115
500+
Coin: &utxorpc.BigInt{
501+
BigInt: &utxorpc.BigInt_Int{Int: int64(o.Amount())},
502+
},
500503
},
501504
nil
502505
}

ledger/common/certs.go

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -586,12 +586,16 @@ func (c *PoolRegistrationCertificate) Utxorpc() (*utxorpc.Certificate, error) {
586586
}
587587
return &utxorpc.Certificate{
588588
Certificate: &utxorpc.Certificate_PoolRegistration{
589+
// #nosec G115
589590
PoolRegistration: &utxorpc.PoolRegistrationCert{
590591
Operator: c.Operator[:],
591592
VrfKeyhash: c.VrfKeyHash[:],
592-
Pledge: c.Pledge,
593-
Cost: c.Cost,
594-
// #nosec G115
593+
Pledge: &utxorpc.BigInt{
594+
BigInt: &utxorpc.BigInt_Int{Int: int64(c.Pledge)},
595+
},
596+
Cost: &utxorpc.BigInt{
597+
BigInt: &utxorpc.BigInt_Int{Int: int64(c.Cost)},
598+
},
595599
Margin: &utxorpc.RationalNumber{
596600
Numerator: int32(c.Margin.Num().Int64()),
597601
Denominator: uint32(c.Margin.Denom().Uint64()),
@@ -760,7 +764,9 @@ func (c *MoveInstantaneousRewardsCertificate) Utxorpc() (*utxorpc.Certificate, e
760764
StakeCredential: stakeCr,
761765
// potential integer overflow
762766
// #nosec G115
763-
DeltaCoin: int64(deltaCoin),
767+
DeltaCoin: &utxorpc.BigInt{
768+
BigInt: &utxorpc.BigInt_Int{Int: int64(deltaCoin)},
769+
},
764770
},
765771
)
766772
}

ledger/common/tx.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,9 @@ func TransactionBodyToUtxorpc(tx TransactionBody) (*utxorpc.Tx, error) {
236236
// ReferenceInputs: tx.ReferenceInputs(),
237237
// Witnesses: tx.Witnesses(),
238238
// Collateral: tx.Collateral(),
239-
Fee: tx.Fee(),
239+
Fee: &utxorpc.BigInt{
240+
BigInt: &utxorpc.BigInt_Int{Int: int64(tx.Fee())},
241+
}, // #nosec G115
240242
// Validity: tx.Validity(),
241243
// Successful: tx.Successful(),
242244
// Auxiliary: tx.AuxData(),

0 commit comments

Comments
 (0)