Skip to content

Commit e47e971

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

24 files changed

+368
-282
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/allegra/block_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ func TestAllegraUtxorpcBlock(t *testing.T) {
152152
)
153153
assert.Greater(
154154
t,
155-
firstRpcTx.Fee,
156-
uint64(0),
155+
firstRpcTx.Fee.GetInt(),
156+
int64(0),
157157
"Transaction fee should be positive",
158158
)
159159
}

ledger/allegra/pparams_test.go

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2024 Blink Labs Software
1+
// Copyright 2025 Blink Labs Software
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -24,7 +24,7 @@ import (
2424
"github.com/blinklabs-io/gouroboros/ledger/allegra"
2525
"github.com/blinklabs-io/gouroboros/ledger/common"
2626
"github.com/blinklabs-io/gouroboros/ledger/shelley"
27-
"github.com/utxorpc/go-codegen/utxorpc/v1alpha/cardano"
27+
utxorpc "github.com/utxorpc/go-codegen/utxorpc/v1alpha/cardano"
2828
)
2929

3030
func TestAllegraProtocolParamsUpdate(t *testing.T) {
@@ -92,29 +92,29 @@ func TestAllegraUtxorpc(t *testing.T) {
9292
MinUtxoValue: 1000000,
9393
}
9494

95-
expectedUtxorpc := &cardano.PParams{
96-
MinFeeCoefficient: 500,
97-
MinFeeConstant: 2,
95+
expectedUtxorpc := &utxorpc.PParams{
96+
MinFeeCoefficient: &utxorpc.BigInt{BigInt: &utxorpc.BigInt_Int{Int: 500}},
97+
MinFeeConstant: &utxorpc.BigInt{BigInt: &utxorpc.BigInt_Int{Int: 2}},
9898
MaxBlockBodySize: 65536,
9999
MaxTxSize: 16384,
100100
MaxBlockHeaderSize: 1024,
101-
StakeKeyDeposit: 2000,
102-
PoolDeposit: 500000,
101+
StakeKeyDeposit: &utxorpc.BigInt{BigInt: &utxorpc.BigInt_Int{Int: 2000}},
102+
PoolDeposit: &utxorpc.BigInt{BigInt: &utxorpc.BigInt_Int{Int: 500000}},
103103
PoolRetirementEpochBound: 2160,
104104
DesiredNumberOfPools: 100,
105-
PoolInfluence: &cardano.RationalNumber{
105+
PoolInfluence: &utxorpc.RationalNumber{
106106
Numerator: int32(1),
107107
Denominator: uint32(2),
108108
},
109-
MonetaryExpansion: &cardano.RationalNumber{
109+
MonetaryExpansion: &utxorpc.RationalNumber{
110110
Numerator: int32(3),
111111
Denominator: uint32(4),
112112
},
113-
TreasuryExpansion: &cardano.RationalNumber{
113+
TreasuryExpansion: &utxorpc.RationalNumber{
114114
Numerator: int32(5),
115115
Denominator: uint32(6),
116116
},
117-
ProtocolVersion: &cardano.ProtocolVersion{
117+
ProtocolVersion: &utxorpc.ProtocolVersion{
118118
Major: 8,
119119
Minor: 0,
120120
},
@@ -171,10 +171,10 @@ func TestAllegraTransactionBody_Utxorpc(t *testing.T) {
171171
}
172172

173173
// Check that the fee matches
174-
if actual.Fee != txBody.Fee() {
174+
if actual.Fee.GetInt() != int64(txBody.Fee()) {
175175
t.Errorf(
176176
"AllegraTransactionBody.Utxorpc() fee mismatch\nGot: %d\nWant: %d",
177-
actual.Fee,
177+
actual.Fee.GetInt(),
178178
txBody.Fee(),
179179
)
180180
}
@@ -233,10 +233,10 @@ func TestAllegraTransaction_Utxorpc(t *testing.T) {
233233
t.Fatalf("Could not convert transaction to utxorpc format: %v", err)
234234
}
235235
// Assertion checks
236-
if actual.Fee != tx.Fee() {
236+
if actual.Fee.GetInt() != int64(tx.Fee()) {
237237
t.Errorf(
238238
"AllegraTransaction.Utxorpc() fee mismatch\nGot: %d\nWant: %d",
239-
actual.Fee,
239+
actual.Fee.GetInt(),
240240
tx.Fee(),
241241
)
242242
}

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
},

0 commit comments

Comments
 (0)