Skip to content

Commit 10e4fad

Browse files
committed
cmd: Upgrade oasis-core to 25.3
1 parent 5701603 commit 10e4fad

16 files changed

Lines changed: 41 additions & 43 deletions

File tree

cmd/account/amend_commission_schedule.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ var (
5151
var height int64
5252
height, err = common.GetActualHeight(
5353
ctx,
54-
conn.Consensus(),
54+
conn.Consensus().Core(),
5555
)
5656
cobra.CheckErr(err)
5757

cmd/account/show/show.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ var (
5959

6060
height, err := common.GetActualHeight(
6161
ctx,
62-
c.Consensus(),
62+
c.Consensus().Core(),
6363
)
6464
cobra.CheckErr(err)
6565

cmd/common/flags.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ func OutputFormat() FormatType {
8888
// specified, or the current latest height.
8989
func GetActualHeight(
9090
ctx context.Context,
91-
consensusConn consensus.ClientBackend,
91+
consensusConn consensus.Backend,
9292
) (int64, error) {
9393
height := GetHeight()
9494
if height != consensus.HeightLatest {

cmd/common/network.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
)
1111

1212
type NodeLookup struct {
13-
consensus consensus.ClientBackend
13+
consensus consensus.Backend
1414
registry registry.Backend
1515
nodeMap map[signature.PublicKey]*node.Node
1616

@@ -80,7 +80,7 @@ func (nl *NodeLookup) ByID(
8080

8181
func NewNodeLookup(
8282
ctx context.Context,
83-
consensus consensus.ClientBackend,
83+
consensus consensus.Backend,
8484
registry registry.Backend,
8585
height int64,
8686
) (*NodeLookup, error) {

cmd/common/transaction.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ func PrepareConsensusTransaction(ctx context.Context, npa *NPASelection, signer
119119
// Gas limit estimation if not specified.
120120
gas := consensusTx.Gas(txGasLimit)
121121
if !txOffline && gas == invalidGasLimit {
122-
gas, err = conn.Consensus().EstimateGas(ctx, &consensus.EstimateGasRequest{
122+
gas, err = conn.Consensus().Core().EstimateGas(ctx, &consensus.EstimateGasRequest{
123123
Signer: signer.Public(),
124124
Transaction: tx,
125125
})
@@ -249,7 +249,7 @@ func PrepareParatimeTransaction(ctx context.Context, npa *NPASelection, account
249249
}
250250
} else if !txOffline {
251251
var mgp map[types.Denomination]types.Quantity
252-
mgp, err = conn.Runtime(npa.ParaTime).Core.MinGasPrice(ctx)
252+
mgp, err = conn.Runtime(npa.ParaTime).Core.MinGasPrice(ctx, client.RoundLatest)
253253
if err != nil {
254254
return 0, nil, "", fmt.Errorf("failed to query minimum gas price: %w", err)
255255
}
@@ -467,7 +467,7 @@ func BroadcastTransaction(
467467
case *consensusTx.SignedTransaction:
468468
// Consensus transaction.
469469
fmt.Printf("Broadcasting transaction...\n")
470-
err := conn.Consensus().SubmitTx(ctx, sigTx)
470+
err := conn.Consensus().Core().SubmitTx(ctx, sigTx)
471471
cobra.CheckErr(err)
472472

473473
fmt.Printf("Transaction executed successfully.\n")

cmd/network/add.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ var addCmd = &cobra.Command{
5353
ctx := context.Background()
5454
conn, err := connection.ConnectNoVerify(ctx, &network)
5555
cobra.CheckErr(err)
56-
chainCtx, err := conn.Consensus().GetChainContext(ctx)
56+
chainCtx, err := conn.Consensus().Core().GetChainContext(ctx)
5757
cobra.CheckErr(err)
5858
net.ChainContext = chainCtx
5959
cobra.CheckErr(net.Validate())

cmd/network/add_local.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ func AddLocalNetwork(name string, rpc string) {
7070
conn, err := connection.ConnectNoVerify(ctx, &net)
7171
cobra.CheckErr(err)
7272

73-
chainContext, err := conn.Consensus().GetChainContext(ctx)
73+
chainContext, err := conn.Consensus().Core().GetChainContext(ctx)
7474
cobra.CheckErr(err)
7575
net.ChainContext = chainContext
7676
cobra.CheckErr(net.Validate())

cmd/network/governance/show.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,12 @@ var (
6464
conn, err := connection.Connect(ctx, npa.Network)
6565
cobra.CheckErr(err)
6666

67-
consensusConn := conn.Consensus()
68-
governanceConn := consensusConn.Governance()
69-
beaconConn := consensusConn.Beacon()
70-
schedulerConn := consensusConn.Scheduler()
71-
registryConn := consensusConn.Registry()
72-
stakingConn := consensusConn.Staking()
67+
consensusConn := conn.Consensus().Core()
68+
governanceConn := conn.Consensus().Governance()
69+
beaconConn := conn.Consensus().Beacon()
70+
schedulerConn := conn.Consensus().Scheduler()
71+
registryConn := conn.Consensus().Registry()
72+
stakingConn := conn.Consensus().Staking()
7373

7474
// Figure out the height to use if "latest".
7575
height, err := common.GetActualHeight(

cmd/network/set_chain_context.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ var setChainContextCmd = &cobra.Command{
3636
ctx := context.Background()
3737
conn, err := connection.ConnectNoVerify(ctx, &network)
3838
cobra.CheckErr(err)
39-
chainCtx, err := conn.Consensus().GetChainContext(ctx)
39+
chainCtx, err := conn.Consensus().Core().GetChainContext(ctx)
4040
cobra.CheckErr(err)
4141
net.ChainContext = chainCtx
4242
cobra.CheckErr(net.Validate())

cmd/network/show.go

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,11 @@ var showCmd = &cobra.Command{
5858
conn, err := connection.Connect(ctx, npa.Network)
5959
cobra.CheckErr(err)
6060

61-
consensusConn := conn.Consensus()
62-
registryConn := consensusConn.Registry()
63-
roothashConn := consensusConn.RootHash()
61+
consensusConn := conn.Consensus().Core()
62+
registryConn := conn.Consensus().Registry()
63+
roothashConn := conn.Consensus().RootHash()
64+
schedulerConn := conn.Consensus().Scheduler()
65+
stakingConn := conn.Consensus().Staking()
6466

6567
// Figure out the height to use if "latest".
6668
height, err := common.GetActualHeight(
@@ -170,7 +172,6 @@ var showCmd = &cobra.Command{
170172
}
171173
return
172174
case selValidators:
173-
schedulerConn := consensusConn.Scheduler()
174175
validators, err := schedulerConn.GetValidators(ctx, height)
175176
cobra.CheckErr(err)
176177
for _, validator := range validators {
@@ -179,11 +180,9 @@ var showCmd = &cobra.Command{
179180
}
180181
return
181182
case selNativeToken:
182-
stakingConn := consensusConn.Staking()
183183
showNativeToken(ctx, height, npa, stakingConn)
184184
return
185185
case selGasCosts:
186-
stakingConn := consensusConn.Staking()
187186
consensusParams, err := stakingConn.ConsensusParameters(ctx, height)
188187
cobra.CheckErr(err)
189188

@@ -236,7 +235,7 @@ var showCmd = &cobra.Command{
236235
ID: member.PublicKey,
237236
}
238237

239-
node, err := consensusConn.Registry().GetNode(ctx, nodeQuery)
238+
node, err := registryConn.GetNode(ctx, nodeQuery)
240239
cobra.CheckErr(err)
241240

242241
output = append(output, []string{
@@ -252,7 +251,7 @@ var showCmd = &cobra.Command{
252251
}
253252
return
254253
case selParameters:
255-
showParameters(ctx, npa, height, consensusConn)
254+
showParameters(ctx, npa, height, conn.Consensus())
256255
return
257256

258257
default:
@@ -389,7 +388,7 @@ func showNativeToken(ctx context.Context, height int64, npa *common.NPASelection
389388
}
390389
}
391390

392-
func showParameters(ctx context.Context, npa *common.NPASelection, height int64, cons consensus.ClientBackend) {
391+
func showParameters(ctx context.Context, npa *common.NPASelection, height int64, cons consensus.Services) {
393392
checkErr := func(what string, err error) {
394393
if err != nil {
395394
cobra.CheckErr(fmt.Errorf("%s: %w", what, err))
@@ -400,7 +399,7 @@ func showParameters(ctx context.Context, npa *common.NPASelection, height int64,
400399
// not allowed on the public grpc node and the keymanager would require a
401400
// ServicesBackend instead of the ClientBackend that the Oasis Client SDK
402401
// provides.
403-
genesisDoc, err := cons.GetGenesisDocument(ctx)
402+
genesisDoc, err := cons.Core().GetGenesisDocument(ctx)
404403
checkErr("GetGenesisDocument", err)
405404
consensusParams := genesisDoc.Consensus
406405
keymanagerParams := genesisDoc.KeyManager

0 commit comments

Comments
 (0)