From 47bc1cc9f99a0dc2d5e8fcbf435acfb97509a3d5 Mon Sep 17 00:00:00 2001 From: rabi-siddique Date: Fri, 10 Jan 2025 16:21:30 +0500 Subject: [PATCH] chore: replace cometbft/libs/log with cosmossdk.io/log where required --- golang/cosmos/app/app.go | 2 +- golang/cosmos/go.mod | 7 ++----- golang/cosmos/go.sum | 2 -- golang/cosmos/x/swingset/keeper/extension_snapshotter.go | 2 +- .../x/swingset/keeper/extension_snapshotter_test.go | 2 +- golang/cosmos/x/swingset/keeper/keeper.go | 8 +++----- 6 files changed, 8 insertions(+), 15 deletions(-) diff --git a/golang/cosmos/app/app.go b/golang/cosmos/app/app.go index 57f73d69a4e..94fa6f8d9f4 100644 --- a/golang/cosmos/app/app.go +++ b/golang/cosmos/app/app.go @@ -82,10 +82,10 @@ import ( capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types" ica "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts" + "cosmossdk.io/log" dbm "github.com/cometbft/cometbft-db" abci "github.com/cometbft/cometbft/abci/types" tmjson "github.com/cometbft/cometbft/libs/json" - "github.com/cometbft/cometbft/libs/log" tmos "github.com/cometbft/cometbft/libs/os" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" icahost "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host" diff --git a/golang/cosmos/go.mod b/golang/cosmos/go.mod index a5fbb65c54d..59d43459d47 100644 --- a/golang/cosmos/go.mod +++ b/golang/cosmos/go.mod @@ -1,8 +1,6 @@ module github.com/Agoric/agoric-sdk/golang/cosmos -go 1.22.7 - -toolchain go1.23.4 +go 1.23 require ( cosmossdk.io/api v0.7.5 @@ -13,7 +11,6 @@ require ( cosmossdk.io/x/evidence v0.1.1 cosmossdk.io/x/feegrant v0.1.1 cosmossdk.io/x/upgrade v0.1.4 - github.com/armon/go-metrics v0.4.1 github.com/cometbft/cometbft v0.38.13 github.com/cometbft/cometbft-db v0.14.1 github.com/cosmos/cosmos-sdk v0.50.9 @@ -24,6 +21,7 @@ require ( github.com/golang/protobuf v1.5.4 github.com/gorilla/mux v1.8.1 github.com/grpc-ecosystem/grpc-gateway v1.16.0 + github.com/hashicorp/go-metrics v0.5.3 github.com/pkg/errors v0.9.1 github.com/rakyll/statik v0.1.7 github.com/spf13/cast v1.6.0 @@ -122,7 +120,6 @@ require ( github.com/hashicorp/go-getter v1.7.4 // indirect github.com/hashicorp/go-hclog v1.5.0 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect - github.com/hashicorp/go-metrics v0.5.3 // indirect github.com/hashicorp/go-plugin v1.5.2 // indirect github.com/hashicorp/go-safetemp v1.0.0 // indirect github.com/hashicorp/go-version v1.6.0 // indirect diff --git a/golang/cosmos/go.sum b/golang/cosmos/go.sum index a774090cd04..16d12133fb7 100644 --- a/golang/cosmos/go.sum +++ b/golang/cosmos/go.sum @@ -256,8 +256,6 @@ github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA= -github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= diff --git a/golang/cosmos/x/swingset/keeper/extension_snapshotter.go b/golang/cosmos/x/swingset/keeper/extension_snapshotter.go index 175ac0249f6..b734e4a1ae7 100644 --- a/golang/cosmos/x/swingset/keeper/extension_snapshotter.go +++ b/golang/cosmos/x/swingset/keeper/extension_snapshotter.go @@ -7,10 +7,10 @@ import ( "io" "math" + "cosmossdk.io/log" snapshots "cosmossdk.io/store/snapshots/types" agoric "github.com/Agoric/agoric-sdk/golang/cosmos/types" "github.com/Agoric/agoric-sdk/golang/cosmos/x/swingset/types" - "github.com/cometbft/cometbft/libs/log" "github.com/cosmos/cosmos-sdk/baseapp" ) diff --git a/golang/cosmos/x/swingset/keeper/extension_snapshotter_test.go b/golang/cosmos/x/swingset/keeper/extension_snapshotter_test.go index 342cf04081e..3b4d8c560d8 100644 --- a/golang/cosmos/x/swingset/keeper/extension_snapshotter_test.go +++ b/golang/cosmos/x/swingset/keeper/extension_snapshotter_test.go @@ -4,7 +4,7 @@ import ( "io" "testing" - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/log" ) func newTestExtensionSnapshotter() *ExtensionSnapshotter { diff --git a/golang/cosmos/x/swingset/keeper/keeper.go b/golang/cosmos/x/swingset/keeper/keeper.go index d745151c5a1..467237d0987 100644 --- a/golang/cosmos/x/swingset/keeper/keeper.go +++ b/golang/cosmos/x/swingset/keeper/keeper.go @@ -7,10 +7,8 @@ import ( stdlog "log" "math" + "cosmossdk.io/log" sdkmath "cosmossdk.io/math" - - "github.com/cometbft/cometbft/libs/log" - "cosmossdk.io/store/prefix" storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/baseapp" @@ -323,8 +321,8 @@ func (k Keeper) ChargeBeans( beansToDebit := nowOwing.Sub(remainderOwing) // Convert the debit to coins. - beansPerFeeUnitDec := sdk.NewDecFromBigInt(beansPerUnit[types.BeansPerFeeUnit].BigInt()) - beansToDebitDec := sdk.NewDecFromBigInt(beansToDebit.BigInt()) + beansPerFeeUnitDec := sdkmath.LegacyNewDecFromBigInt(beansPerUnit[types.BeansPerFeeUnit].BigInt()) + beansToDebitDec := sdkmath.LegacyNewDecFromBigInt(beansToDebit.BigInt()) feeUnitPrice := k.GetParams(ctx).FeeUnitPrice feeDecCoins := sdk.NewDecCoinsFromCoins(feeUnitPrice...).MulDec(beansToDebitDec).QuoDec(beansPerFeeUnitDec)