From de22587a5bc9e2d2bb1942e438182210fc13237f Mon Sep 17 00:00:00 2001 From: 0g-wh Date: Wed, 25 Sep 2024 15:31:20 +0000 Subject: [PATCH] fix --- .mockery.yaml | 2 +- app/app_test.go | 1 - app/upgrades_test.go | 8 +- client/grpc/query/connection.go | 2 +- client/grpc/query/query.go | 2 +- go.mod | 2 +- precompile/README.md | 27 --- precompile/contracts/noop/contract.go | 23 --- precompile/contracts/noop/contract_test.go | 18 -- precompile/registry/registry.go | 46 ----- precompile/registry/registry_test.go | 33 ---- proto/kava/precisebank/v1/genesis.proto | 2 +- proto/kava/precisebank/v1/query.proto | 2 +- tests/e2e-ibc/erc20_test.go | 14 +- tests/e2e/e2e_precompile_genesis_test.go | 173 ------------------ tests/e2e/e2e_upgrade_handler_test.go | 2 +- x/precisebank/genesis.go | 4 +- x/precisebank/genesis_test.go | 8 +- x/precisebank/keeper/burn.go | 2 +- x/precisebank/keeper/burn_integration_test.go | 6 +- x/precisebank/keeper/burn_test.go | 2 +- x/precisebank/keeper/fractional_balance.go | 2 +- .../keeper/fractional_balance_test.go | 2 +- x/precisebank/keeper/grpc_query.go | 2 +- x/precisebank/keeper/grpc_query_test.go | 6 +- x/precisebank/keeper/invariants.go | 2 +- .../keeper/invariants_integration_test.go | 6 +- x/precisebank/keeper/invariants_test.go | 6 +- x/precisebank/keeper/keeper.go | 2 +- x/precisebank/keeper/keeper_test.go | 8 +- x/precisebank/keeper/mint.go | 2 +- x/precisebank/keeper/mint_integration_test.go | 6 +- x/precisebank/keeper/mint_test.go | 2 +- x/precisebank/keeper/remainder_amount.go | 2 +- x/precisebank/keeper/remainder_amount_test.go | 2 +- x/precisebank/keeper/send.go | 2 +- x/precisebank/keeper/send_integration_test.go | 8 +- x/precisebank/keeper/send_test.go | 2 +- x/precisebank/keeper/view.go | 2 +- x/precisebank/keeper/view_integration_test.go | 4 +- x/precisebank/keeper/view_test.go | 2 +- x/precisebank/module.go | 4 +- x/precisebank/testutil/fractional_balances.go | 2 +- x/precisebank/testutil/suite.go | 6 +- x/precisebank/types/extended_balance_test.go | 2 +- .../types/fractional_balance_test.go | 4 +- .../types/fractional_balances_test.go | 4 +- x/precisebank/types/genesis_test.go | 6 +- x/precisebank/types/keys_test.go | 2 +- x/pricefeed/abci_test.go | 6 +- x/pricefeed/testutil/helpers.go | 6 +- 51 files changed, 85 insertions(+), 406 deletions(-) delete mode 100644 precompile/README.md delete mode 100644 precompile/contracts/noop/contract.go delete mode 100644 precompile/contracts/noop/contract_test.go delete mode 100644 precompile/registry/registry.go delete mode 100644 precompile/registry/registry_test.go delete mode 100644 tests/e2e/e2e_precompile_genesis_test.go diff --git a/.mockery.yaml b/.mockery.yaml index 0682bfcb..746c20a4 100644 --- a/.mockery.yaml +++ b/.mockery.yaml @@ -8,7 +8,7 @@ outpkg: "mocks" filename: "Mock{{.InterfaceName}}.go" packages: - github.com/kava-labs/kava/x/precisebank/types: + github.com/0glabs/0g-chain/x/precisebank/types: # package-specific config config: interfaces: diff --git a/app/app_test.go b/app/app_test.go index ca541aac..462a079e 100644 --- a/app/app_test.go +++ b/app/app_test.go @@ -20,7 +20,6 @@ import ( vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" solomachine "github.com/cosmos/ibc-go/v7/modules/light-clients/06-solomachine" ibctm "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" - "github.com/ethereum/go-ethereum/precompile/modules" evmtypes "github.com/evmos/ethermint/x/evm/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/app/upgrades_test.go b/app/upgrades_test.go index 56c3a26b..d4783904 100644 --- a/app/upgrades_test.go +++ b/app/upgrades_test.go @@ -6,12 +6,12 @@ import ( "time" sdkmath "cosmossdk.io/math" + "github.com/0glabs/0g-chain/app" + evmutiltypes "github.com/0glabs/0g-chain/x/evmutil/types" + precisebankkeeper "github.com/0glabs/0g-chain/x/precisebank/keeper" + precisebanktypes "github.com/0glabs/0g-chain/x/precisebank/types" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/kava-labs/kava/app" - evmutiltypes "github.com/kava-labs/kava/x/evmutil/types" - precisebankkeeper "github.com/kava-labs/kava/x/precisebank/keeper" - precisebanktypes "github.com/kava-labs/kava/x/precisebank/types" "github.com/stretchr/testify/require" ) diff --git a/client/grpc/query/connection.go b/client/grpc/query/connection.go index ee493ba3..2bf2b5fd 100644 --- a/client/grpc/query/connection.go +++ b/client/grpc/query/connection.go @@ -6,8 +6,8 @@ import ( "fmt" "net/url" + "github.com/0glabs/0g-chain/app" "github.com/cosmos/cosmos-sdk/codec" - "github.com/kava-labs/kava/app" "google.golang.org/grpc" "google.golang.org/grpc/credentials" "google.golang.org/grpc/credentials/insecure" diff --git a/client/grpc/query/query.go b/client/grpc/query/query.go index acb1045e..7dfaaa00 100644 --- a/client/grpc/query/query.go +++ b/client/grpc/query/query.go @@ -28,8 +28,8 @@ import ( committeetypes "github.com/0glabs/0g-chain/x/committee/types" evmutiltypes "github.com/0glabs/0g-chain/x/evmutil/types" issuancetypes "github.com/0glabs/0g-chain/x/issuance/types" + precisebanktypes "github.com/0glabs/0g-chain/x/precisebank/types" pricefeedtypes "github.com/0glabs/0g-chain/x/pricefeed/types" - precisebanktypes "github.com/kava-labs/kava/x/precisebank/types" ) // QueryClient is a wrapper with all Cosmos and Kava grpc query clients diff --git a/go.mod b/go.mod index 6273d247..4e024326 100644 --- a/go.mod +++ b/go.mod @@ -244,7 +244,7 @@ replace ( github.com/dgrijalva/jwt-go => github.com/golang-jwt/jwt/v4 v4.4.2 // Tracking kava-labs/go-ethereum kava/release/v1.10 branch // TODO: Tag before release - github.com/ethereum/go-ethereum => github.com/Kava-Labs/go-ethereum v1.10.27-0.20240513233504-6e038346780b + github.com/ethereum/go-ethereum => github.com/evmos/go-ethereum v1.10.26-evmos-rc2 // Use ethermint fork that respects min-gas-price with NoBaseFee true and london enabled, and includes eip712 support github.com/evmos/ethermint => github.com/0glabs/ethermint v0.21.0-0g.v3.1.0 // See https://github.com/cosmos/cosmos-sdk/pull/10401, https://github.com/cosmos/cosmos-sdk/commit/0592ba6158cd0bf49d894be1cef4faeec59e8320 diff --git a/precompile/README.md b/precompile/README.md deleted file mode 100644 index 0afb7d82..00000000 --- a/precompile/README.md +++ /dev/null @@ -1,27 +0,0 @@ -# Precompile - -The `precompile` package defines stateful precompile contracts used for creating precompile contracts that enhance the EVM, enable interactions between cosmos state and EVM state, or are used soley for testing purposes. - -This package is made of two subpackages: - -- `contracts` - Defines stateful precompiles and their constructors. -- `registry` - Defines stateful precompile addresses and registers them with the global registry - defined at `github.com/kava-labs/go-ethereum/precompile/modules`. - -This is architected to isolate the dependency on the global registry (`github.com/kava-labs/go-ethereum/precompile/modules` package) to as few places as possible, have one source of truth for address registration (see `./registry/registry.go`), and isolate registration testing to one package. - -In order to use the precompile registry, it must be imported for it's init function to run and register the precompiles. For the kava app, this is done in the `app.go` file with the import `_ "github.com/kava-labs/kava/precompile/registry"`. This is done in the `app.go` since this is the main file used for app dependencies and so all modules using the app cause the registry to be loaded. This is important for any consumers of the app outside of the kava cmd, as well as test code using the app for integration and unit testing. - -## Defining a new precompile - -1) Add the expected 0x address to the expected list in `./registry/registry_test.go`. -2) Create a new sub-directory under `./contracts` with a `contract_test.go` and `contract.go` file. -3) Implement `NewContract` function with associated tests in contract and contract test files. -4) Add the contract registration to `./registry/registry.go`. - -## Contracts - -### Noop - -This contract is used for testing purposes only and should not be used on public chains. The functions of this contract (once implemented), will be used to exercise and test the various aspects of the EVM such as gas usage, argument parsing, events, etc. The specific operations tested under this contract are still to be determined. - diff --git a/precompile/contracts/noop/contract.go b/precompile/contracts/noop/contract.go deleted file mode 100644 index 5cc85c0f..00000000 --- a/precompile/contracts/noop/contract.go +++ /dev/null @@ -1,23 +0,0 @@ -package noop - -import ( - "fmt" - - "github.com/ethereum/go-ethereum/precompile/contract" -) - -// NewContract returns a new noop stateful precompiled contract. -// -// This contract is used for testing purposes only and should not be used on public chains. -// The functions of this contract (once implemented), will be used to exercise and test the various aspects of -// the EVM such as gas usage, argument parsing, events, etc. The specific operations tested under this contract are -// still to be determined. -func NewContract() (contract.StatefulPrecompiledContract, error) { - precompile, err := contract.NewStatefulPrecompileContract([]*contract.StatefulPrecompileFunction{}) - - if err != nil { - return nil, fmt.Errorf("failed to instantiate noop precompile: %w", err) - } - - return precompile, nil -} diff --git a/precompile/contracts/noop/contract_test.go b/precompile/contracts/noop/contract_test.go deleted file mode 100644 index 53f2bdb8..00000000 --- a/precompile/contracts/noop/contract_test.go +++ /dev/null @@ -1,18 +0,0 @@ -package noop_test - -import ( - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - - "github.com/kava-labs/kava/precompile/contracts/noop" -) - -// TestContractConstructor ensures we have a valid constructor. This will fail -// if we attempt to define invalid or duplicate function selectors. -func TestContractConstructor(t *testing.T) { - precompile, err := noop.NewContract() - require.NoError(t, err, "expected precompile not error when created") - assert.NotNil(t, precompile, "expected precompile contract to be defined") -} diff --git a/precompile/registry/registry.go b/precompile/registry/registry.go deleted file mode 100644 index 6863b298..00000000 --- a/precompile/registry/registry.go +++ /dev/null @@ -1,46 +0,0 @@ -package registry - -import ( - "fmt" - - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/precompile/contract" - "github.com/ethereum/go-ethereum/precompile/modules" - - "github.com/kava-labs/kava/precompile/contracts/noop" -) - -const ( - // NoopContractAddress the primary noop contract address for testing - NoopContractAddress = "0x9000000000000000000000000000000000000001" - // NoopContractAddress2 the secondary noop contract address for testing - NoopContractAddress2 = "0x9000000000000000000000000000000000000002" -) - -// init registers stateful precompile contracts with the global precompile registry -// defined in kava-labs/go-ethereum/precompile/modules -func init() { - register(NoopContractAddress, noop.NewContract) - register(NoopContractAddress2, noop.NewContract) -} - -// register accepts a 0x address string and a stateful precompile contract constructor, instantiates the -// precompile contract via the constructor, and registers it with the precompile module registry. -// -// This panics if the contract can not be created or the module can not be registered -func register(address string, newContract func() (contract.StatefulPrecompiledContract, error)) { - contract, err := newContract() - if err != nil { - panic(fmt.Errorf("error creating contract for address %s: %w", address, err)) - } - - module := modules.Module{ - Address: common.HexToAddress(address), - Contract: contract, - } - - err = modules.RegisterModule(module) - if err != nil { - panic(fmt.Errorf("error registering contract module for address %s: %w", address, err)) - } -} diff --git a/precompile/registry/registry_test.go b/precompile/registry/registry_test.go deleted file mode 100644 index daa299c7..00000000 --- a/precompile/registry/registry_test.go +++ /dev/null @@ -1,33 +0,0 @@ -package registry_test - -import ( - "testing" - - "github.com/ethereum/go-ethereum/precompile/modules" - "github.com/stretchr/testify/assert" -) - -// TestRegisteredPrecompiles asserts precompiles are registered -// -// In addition, this serves as an integration test to -// 1. Ensure modules.RegisteredModules() is returning addresses in the correct ascending order -// 2. Ensure that that the address defined in the module is correct. Since we use common.HexToAddress and -// then back to 0x encoded string, we can be certain that the string defined in the module is the -// expected length, not missing 0's, etc. -func TestRegisteredPrecompilesAddresses(t *testing.T) { - // build list of 0x addresses that are registered - registeredModules := modules.RegisteredModules() - registeredPrecompiles := make([]string, 0, len(registeredModules)) - for _, rp := range registeredModules { - registeredPrecompiles = append(registeredPrecompiles, rp.Address.String()) - } - - expectedPrecompiles := []string{ - // 0x9 address space used for e2e & integration tests - "0x9000000000000000000000000000000000000001", // noop - "0x9000000000000000000000000000000000000002", // noop (duplicated for testing) - } - - assert.Equal(t, expectedPrecompiles, registeredPrecompiles, - "expected registered precompile address list to match to match expected") -} diff --git a/proto/kava/precisebank/v1/genesis.proto b/proto/kava/precisebank/v1/genesis.proto index e7633cd9..c0c8b9d6 100644 --- a/proto/kava/precisebank/v1/genesis.proto +++ b/proto/kava/precisebank/v1/genesis.proto @@ -4,7 +4,7 @@ package kava.precisebank.v1; import "cosmos_proto/cosmos.proto"; import "gogoproto/gogo.proto"; -option go_package = "github.com/kava-labs/kava/x/precisebank/types"; +option go_package = "github.com/0glabs/0g-chain/x/precisebank/types"; // GenesisState defines the precisebank module's genesis state. message GenesisState { diff --git a/proto/kava/precisebank/v1/query.proto b/proto/kava/precisebank/v1/query.proto index 45abd90c..8a0f2588 100644 --- a/proto/kava/precisebank/v1/query.proto +++ b/proto/kava/precisebank/v1/query.proto @@ -5,7 +5,7 @@ import "cosmos/base/v1beta1/coin.proto"; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; -option go_package = "github.com/kava-labs/kava/x/precisebank/types"; +option go_package = "github.com/0glabs/0g-chain/x/precisebank/types"; option (gogoproto.goproto_getters_all) = false; // Query defines the gRPC querier service for precisebank module diff --git a/tests/e2e-ibc/erc20_test.go b/tests/e2e-ibc/erc20_test.go index 642f8829..50eadf8d 100644 --- a/tests/e2e-ibc/erc20_test.go +++ b/tests/e2e-ibc/erc20_test.go @@ -26,13 +26,13 @@ import ( "github.com/strangelove-ventures/interchaintest/v7/ibc" "github.com/strangelove-ventures/interchaintest/v7/testreporter" - "github.com/kava-labs/kava/app" - "github.com/kava-labs/kava/client/erc20" - "github.com/kava-labs/kava/tests/e2e/runner" - "github.com/kava-labs/kava/tests/e2e/testutil" - kavainterchain "github.com/kava-labs/kava/tests/interchain" - "github.com/kava-labs/kava/tests/util" - evmutiltypes "github.com/kava-labs/kava/x/evmutil/types" + "github.com/0glabs/0g-chain/app" + "github.com/0glabs/0g-chain/client/erc20" + "github.com/0glabs/0g-chain/tests/e2e/runner" + "github.com/0glabs/0g-chain/tests/e2e/testutil" + kavainterchain "github.com/0glabs/0g-chain/tests/interchain" + "github.com/0glabs/0g-chain/tests/util" + evmutiltypes "github.com/0glabs/0g-chain/x/evmutil/types" ) // This test does the following: diff --git a/tests/e2e/e2e_precompile_genesis_test.go b/tests/e2e/e2e_precompile_genesis_test.go deleted file mode 100644 index 6f3f5954..00000000 --- a/tests/e2e/e2e_precompile_genesis_test.go +++ /dev/null @@ -1,173 +0,0 @@ -package e2e_test - -import ( - "context" - "math/big" - - sdk "github.com/cosmos/cosmos-sdk/types" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" - ethermint "github.com/evmos/ethermint/types" - evmtypes "github.com/evmos/ethermint/x/evm/types" - - "github.com/kava-labs/kava/precompile/registry" -) - -// TestPrecompileGenesis tests that the the following is true for enabled precompiles: -// -// - An enabled precompile has an EthAccount with matching code hash, -// sequence of 1, and no public key -// - An enabled precompile has code equal to 0x01 -// - An enabled precompile has a nonce of 1 -// -// This is important to ensure the genesis setup for precompiles is correct. -func (suite *IntegrationTestSuite) TestPrecompileGenesis() { - type fixture struct { - address string - expectIsEnabled bool - expectIsEthAccount bool - expectCode []byte - expectNonce uint64 - } - - // enabled represnets the expected state for a registered precompile - // that is enabled at genesis - enabled := func(address string) func() fixture { - return func() fixture { - return fixture{ - address: address, - expectIsEnabled: true, - expectIsEthAccount: true, - expectCode: []byte{0x01}, - expectNonce: uint64(1), - } - } - } - - // disabled represents the expected state for a registered precompile - // that is not enabled at genesis - disabled := func(address string) func() fixture { - return func() fixture { - return fixture{ - address: address, - expectIsEnabled: false, - expectIsEthAccount: false, - expectCode: []byte{}, - expectNonce: uint64(0), - } - } - } - - testCases := []struct { - name string - genFixture func() fixture - }{ - { - name: "noop contract address is enabled and initialized", - genFixture: enabled(registry.NoopContractAddress), - }, - { - name: "noop contract address second address is disabled and not initialized", - genFixture: disabled(registry.NoopContractAddress2), - }, - } - - for _, tc := range testCases { - suite.Run(tc.name, func() { - tf := tc.genFixture() - - // - // Addresses - // - evmAddress := common.HexToAddress(tf.address) - sdkAddress := sdk.AccAddress(evmAddress.Bytes()) - - // - // Heights - // - // We ensure all queries happen at block 1 after genesis - // and help ensure determisitc behavior - genesisHeight := big.NewInt(1) - grpcGenesisContext := suite.Kava.Grpc.CtxAtHeight(genesisHeight.Int64()) - - // - // Queries - // - evmParamsResp, err := suite.Kava.Grpc.Query.Evm.Params(grpcGenesisContext, &evmtypes.QueryParamsRequest{}) - suite.Require().NoError(err) - - // accountErr is checked during in the assertions below if tf.expectIsEthAccount is true - // This is due to the service returning a not found error for address that are not enabled, - // which can be ignored when we do not expect an eth account to exist. - accountResponse, accountErr := suite.Kava.Grpc.Query.Auth.Account( - grpcGenesisContext, &authtypes.QueryAccountRequest{Address: sdkAddress.String()}) - var account authtypes.AccountI - if accountErr == nil { - err = suite.Kava.EncodingConfig.Marshaler.UnpackAny(accountResponse.Account, &account) - suite.Require().NoError(err) - } - - // We ensure both the evm json rpc and x/evm grpc code endpoints return the same value - // in the assertions below - grpcCodeResponse, err := suite.Kava.Grpc.Query.Evm.Code(grpcGenesisContext, - &evmtypes.QueryCodeRequest{Address: evmAddress.String()}) - suite.Require().NoError(err) - rpcCode, err := suite.Kava.EvmClient.CodeAt(context.Background(), evmAddress, genesisHeight) - suite.Require().NoError(err) - - nonce, err := suite.Kava.EvmClient.NonceAt(context.Background(), evmAddress, genesisHeight) - suite.Require().NoError(err) - - // - // Assertions - // - if tf.expectIsEnabled { - suite.Containsf(evmParamsResp.Params.EnabledPrecompiles, tf.address, - "expected %s to be enabled in evm params", tf.address) - } else { - suite.NotContainsf(evmParamsResp.Params.EnabledPrecompiles, tf.address, - "expected %s to not be enabled in evm params", tf.address) - } - - // Fail if fixuture configuration is invalid - if tf.expectIsEthAccount && len(tf.expectCode) == 0 { - suite.Failf("an eth account must have expected code for address %s", tf.address) - } - - // Run addition EthAccount assertions - if tf.expectIsEthAccount { - suite.Require().NoErrorf(accountErr, "expected account query to not error for address %s", tf.address) - - // All contracts including precompiles must be EthAccount's - ethAccount, isEthAccount := account.(*ethermint.EthAccount) - suite.Require().Truef(isEthAccount, "expected account at address %s to be an eth account", tf.address) - - // Code hash must always match the EthAccount - codeHash := ethAccount.GetCodeHash() - suite.Equalf(crypto.Keccak256Hash(tf.expectCode), codeHash, - "expected codehash for account %s to match expected code", tf.address) - - // A precompile (and contract) should never have a public key set - suite.Nilf(ethAccount.PubKey, "expected account %s to have no public key", tf.address) - - // Assert the account sequence matches the expected nonce - // This a duplicate of the nonce assertion below, but also helps ensure these - // two sources agree - suite.Equal(tf.expectNonce, ethAccount.GetSequence()) - } - - // We assert both methods of code retrieval report the same value - suite.Equalf(tf.expectCode, rpcCode, "expected code for address %s to match expected", tf.address) - // The GRPC endpoint returns []byte(nil) when the code is not in state, which is different from - // the rpc endpoint that returns []byte{}. - grpcExpectedCode := tf.expectCode - if len(grpcExpectedCode) == 0 { - grpcExpectedCode = []byte(nil) - } - suite.Equalf(grpcExpectedCode, grpcCodeResponse.Code, "expected code for address %s to match expected", tf.address) - // We assert this outside of the account context since the evm rpc always returns a nonce - suite.Equalf(tf.expectNonce, nonce, "expected nonce for address %s to match expected", tf.address) - }) - } -} diff --git a/tests/e2e/e2e_upgrade_handler_test.go b/tests/e2e/e2e_upgrade_handler_test.go index 3114dfe6..f287ec78 100644 --- a/tests/e2e/e2e_upgrade_handler_test.go +++ b/tests/e2e/e2e_upgrade_handler_test.go @@ -1,8 +1,8 @@ package e2e_test import ( + precisebanktypes "github.com/0glabs/0g-chain/x/precisebank/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - precisebanktypes "github.com/kava-labs/kava/x/precisebank/types" ) func (suite *IntegrationTestSuite) TestUpgrade_PreciseBankReserveTransfer() { diff --git a/x/precisebank/genesis.go b/x/precisebank/genesis.go index 70cc992b..86d3c97f 100644 --- a/x/precisebank/genesis.go +++ b/x/precisebank/genesis.go @@ -6,8 +6,8 @@ import ( sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/kava-labs/kava/x/precisebank/keeper" - "github.com/kava-labs/kava/x/precisebank/types" + "github.com/0glabs/0g-chain/x/precisebank/keeper" + "github.com/0glabs/0g-chain/x/precisebank/types" ) // InitGenesis initializes the store state from a genesis state. diff --git a/x/precisebank/genesis_test.go b/x/precisebank/genesis_test.go index 64e8ba48..d3520aa7 100644 --- a/x/precisebank/genesis_test.go +++ b/x/precisebank/genesis_test.go @@ -6,10 +6,10 @@ import ( sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/kava-labs/kava/x/precisebank" - "github.com/kava-labs/kava/x/precisebank/keeper" - "github.com/kava-labs/kava/x/precisebank/testutil" - "github.com/kava-labs/kava/x/precisebank/types" + "github.com/0glabs/0g-chain/x/precisebank" + "github.com/0glabs/0g-chain/x/precisebank/keeper" + "github.com/0glabs/0g-chain/x/precisebank/testutil" + "github.com/0glabs/0g-chain/x/precisebank/types" "github.com/stretchr/testify/suite" ) diff --git a/x/precisebank/keeper/burn.go b/x/precisebank/keeper/burn.go index a190659c..1eebd394 100644 --- a/x/precisebank/keeper/burn.go +++ b/x/precisebank/keeper/burn.go @@ -5,11 +5,11 @@ import ( errorsmod "cosmossdk.io/errors" sdkmath "cosmossdk.io/math" + "github.com/0glabs/0g-chain/x/precisebank/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/kava-labs/kava/x/precisebank/types" ) // BurnCoins burns coins deletes coins from the balance of the module account. diff --git a/x/precisebank/keeper/burn_integration_test.go b/x/precisebank/keeper/burn_integration_test.go index 042fdbfa..3e457b2a 100644 --- a/x/precisebank/keeper/burn_integration_test.go +++ b/x/precisebank/keeper/burn_integration_test.go @@ -5,13 +5,13 @@ import ( "testing" sdkmath "cosmossdk.io/math" + "github.com/0glabs/0g-chain/x/precisebank/keeper" + "github.com/0glabs/0g-chain/x/precisebank/testutil" + "github.com/0glabs/0g-chain/x/precisebank/types" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" - "github.com/kava-labs/kava/x/precisebank/keeper" - "github.com/kava-labs/kava/x/precisebank/testutil" - "github.com/kava-labs/kava/x/precisebank/types" "github.com/stretchr/testify/suite" ) diff --git a/x/precisebank/keeper/burn_test.go b/x/precisebank/keeper/burn_test.go index 98cd49bf..6d71c361 100644 --- a/x/precisebank/keeper/burn_test.go +++ b/x/precisebank/keeper/burn_test.go @@ -4,9 +4,9 @@ import ( "fmt" "testing" + "github.com/0glabs/0g-chain/x/precisebank/types" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - "github.com/kava-labs/kava/x/precisebank/types" "github.com/stretchr/testify/require" ) diff --git a/x/precisebank/keeper/fractional_balance.go b/x/precisebank/keeper/fractional_balance.go index 7f2c20c8..6eccdd86 100644 --- a/x/precisebank/keeper/fractional_balance.go +++ b/x/precisebank/keeper/fractional_balance.go @@ -8,7 +8,7 @@ import ( "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/kava-labs/kava/x/precisebank/types" + "github.com/0glabs/0g-chain/x/precisebank/types" ) // GetFractionalBalance returns the fractional balance for an address. diff --git a/x/precisebank/keeper/fractional_balance_test.go b/x/precisebank/keeper/fractional_balance_test.go index be733ea4..c5521e1c 100644 --- a/x/precisebank/keeper/fractional_balance_test.go +++ b/x/precisebank/keeper/fractional_balance_test.go @@ -8,7 +8,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" - "github.com/kava-labs/kava/x/precisebank/types" + "github.com/0glabs/0g-chain/x/precisebank/types" ) func TestSetGetFractionalBalance(t *testing.T) { diff --git a/x/precisebank/keeper/grpc_query.go b/x/precisebank/keeper/grpc_query.go index 44dc8f7f..9a00d8e8 100644 --- a/x/precisebank/keeper/grpc_query.go +++ b/x/precisebank/keeper/grpc_query.go @@ -5,7 +5,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/kava-labs/kava/x/precisebank/types" + "github.com/0glabs/0g-chain/x/precisebank/types" ) type queryServer struct { diff --git a/x/precisebank/keeper/grpc_query_test.go b/x/precisebank/keeper/grpc_query_test.go index ad0073d2..1ab99e94 100644 --- a/x/precisebank/keeper/grpc_query_test.go +++ b/x/precisebank/keeper/grpc_query_test.go @@ -11,9 +11,9 @@ import ( minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" "github.com/stretchr/testify/suite" - "github.com/kava-labs/kava/x/precisebank/keeper" - "github.com/kava-labs/kava/x/precisebank/testutil" - "github.com/kava-labs/kava/x/precisebank/types" + "github.com/0glabs/0g-chain/x/precisebank/keeper" + "github.com/0glabs/0g-chain/x/precisebank/testutil" + "github.com/0glabs/0g-chain/x/precisebank/types" ) type grpcQueryTestSuite struct { diff --git a/x/precisebank/keeper/invariants.go b/x/precisebank/keeper/invariants.go index 1724eeb5..41e79097 100644 --- a/x/precisebank/keeper/invariants.go +++ b/x/precisebank/keeper/invariants.go @@ -4,8 +4,8 @@ import ( "fmt" sdkmath "cosmossdk.io/math" + "github.com/0glabs/0g-chain/x/precisebank/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/kava-labs/kava/x/precisebank/types" ) // RegisterInvariants registers the x/precisebank module invariants diff --git a/x/precisebank/keeper/invariants_integration_test.go b/x/precisebank/keeper/invariants_integration_test.go index 99740355..29d50269 100644 --- a/x/precisebank/keeper/invariants_integration_test.go +++ b/x/precisebank/keeper/invariants_integration_test.go @@ -4,10 +4,10 @@ import ( "testing" sdkmath "cosmossdk.io/math" + "github.com/0glabs/0g-chain/x/precisebank/keeper" + "github.com/0glabs/0g-chain/x/precisebank/testutil" + "github.com/0glabs/0g-chain/x/precisebank/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/kava-labs/kava/x/precisebank/keeper" - "github.com/kava-labs/kava/x/precisebank/testutil" - "github.com/kava-labs/kava/x/precisebank/types" "github.com/stretchr/testify/suite" ) diff --git a/x/precisebank/keeper/invariants_test.go b/x/precisebank/keeper/invariants_test.go index 2518c6ef..9aa086e3 100644 --- a/x/precisebank/keeper/invariants_test.go +++ b/x/precisebank/keeper/invariants_test.go @@ -8,9 +8,9 @@ import ( storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/kava-labs/kava/x/precisebank/keeper" - "github.com/kava-labs/kava/x/precisebank/types" - "github.com/kava-labs/kava/x/precisebank/types/mocks" + "github.com/0glabs/0g-chain/x/precisebank/keeper" + "github.com/0glabs/0g-chain/x/precisebank/types" + "github.com/0glabs/0g-chain/x/precisebank/types/mocks" "github.com/stretchr/testify/require" ) diff --git a/x/precisebank/keeper/keeper.go b/x/precisebank/keeper/keeper.go index bb2e6c93..d7a52900 100644 --- a/x/precisebank/keeper/keeper.go +++ b/x/precisebank/keeper/keeper.go @@ -6,7 +6,7 @@ import ( evmtypes "github.com/evmos/ethermint/x/evm/types" - "github.com/kava-labs/kava/x/precisebank/types" + "github.com/0glabs/0g-chain/x/precisebank/types" ) // Enforce that Keeper implements the expected keeper interfaces diff --git a/x/precisebank/keeper/keeper_test.go b/x/precisebank/keeper/keeper_test.go index a39c5389..6bdadf0b 100644 --- a/x/precisebank/keeper/keeper_test.go +++ b/x/precisebank/keeper/keeper_test.go @@ -8,10 +8,10 @@ import ( "github.com/cosmos/cosmos-sdk/testutil" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/kava-labs/kava/app" - "github.com/kava-labs/kava/x/precisebank/keeper" - "github.com/kava-labs/kava/x/precisebank/types" - "github.com/kava-labs/kava/x/precisebank/types/mocks" + "github.com/0glabs/0g-chain/app" + "github.com/0glabs/0g-chain/x/precisebank/keeper" + "github.com/0glabs/0g-chain/x/precisebank/types" + "github.com/0glabs/0g-chain/x/precisebank/types/mocks" ) // testData defines necessary fields for testing keeper store methods and mocks diff --git a/x/precisebank/keeper/mint.go b/x/precisebank/keeper/mint.go index 8d42eade..76c1d7c7 100644 --- a/x/precisebank/keeper/mint.go +++ b/x/precisebank/keeper/mint.go @@ -10,7 +10,7 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/kava-labs/kava/x/precisebank/types" + "github.com/0glabs/0g-chain/x/precisebank/types" ) // MintCoins creates new coins from thin air and adds it to the module account. diff --git a/x/precisebank/keeper/mint_integration_test.go b/x/precisebank/keeper/mint_integration_test.go index 1aec8986..67880138 100644 --- a/x/precisebank/keeper/mint_integration_test.go +++ b/x/precisebank/keeper/mint_integration_test.go @@ -11,9 +11,9 @@ import ( banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" - "github.com/kava-labs/kava/x/precisebank/keeper" - "github.com/kava-labs/kava/x/precisebank/testutil" - "github.com/kava-labs/kava/x/precisebank/types" + "github.com/0glabs/0g-chain/x/precisebank/keeper" + "github.com/0glabs/0g-chain/x/precisebank/testutil" + "github.com/0glabs/0g-chain/x/precisebank/types" "github.com/stretchr/testify/suite" ) diff --git a/x/precisebank/keeper/mint_test.go b/x/precisebank/keeper/mint_test.go index a7df18ec..d2619d83 100644 --- a/x/precisebank/keeper/mint_test.go +++ b/x/precisebank/keeper/mint_test.go @@ -10,7 +10,7 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" - "github.com/kava-labs/kava/x/precisebank/types" + "github.com/0glabs/0g-chain/x/precisebank/types" ) func TestMintCoins_PanicValidations(t *testing.T) { diff --git a/x/precisebank/keeper/remainder_amount.go b/x/precisebank/keeper/remainder_amount.go index f3dce288..32ae2fdf 100644 --- a/x/precisebank/keeper/remainder_amount.go +++ b/x/precisebank/keeper/remainder_amount.go @@ -6,7 +6,7 @@ import ( sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/kava-labs/kava/x/precisebank/types" + "github.com/0glabs/0g-chain/x/precisebank/types" ) // GetRemainderAmount returns the internal remainder amount. diff --git a/x/precisebank/keeper/remainder_amount_test.go b/x/precisebank/keeper/remainder_amount_test.go index 92bbb119..ca2969f6 100644 --- a/x/precisebank/keeper/remainder_amount_test.go +++ b/x/precisebank/keeper/remainder_amount_test.go @@ -4,7 +4,7 @@ import ( "testing" sdkmath "cosmossdk.io/math" - "github.com/kava-labs/kava/x/precisebank/types" + "github.com/0glabs/0g-chain/x/precisebank/types" "github.com/stretchr/testify/require" ) diff --git a/x/precisebank/keeper/send.go b/x/precisebank/keeper/send.go index fd383419..ce01cc61 100644 --- a/x/precisebank/keeper/send.go +++ b/x/precisebank/keeper/send.go @@ -6,10 +6,10 @@ import ( errorsmod "cosmossdk.io/errors" sdkmath "cosmossdk.io/math" + "github.com/0glabs/0g-chain/x/precisebank/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/kava-labs/kava/x/precisebank/types" ) // IsSendEnabledCoins uses the parent x/bank keeper to check the coins provided diff --git a/x/precisebank/keeper/send_integration_test.go b/x/precisebank/keeper/send_integration_test.go index 08c17421..9707ec49 100644 --- a/x/precisebank/keeper/send_integration_test.go +++ b/x/precisebank/keeper/send_integration_test.go @@ -4,14 +4,14 @@ import ( "fmt" "testing" + "github.com/0glabs/0g-chain/app" + "github.com/0glabs/0g-chain/x/precisebank/keeper" + "github.com/0glabs/0g-chain/x/precisebank/testutil" + "github.com/0glabs/0g-chain/x/precisebank/types" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" - "github.com/kava-labs/kava/app" - "github.com/kava-labs/kava/x/precisebank/keeper" - "github.com/kava-labs/kava/x/precisebank/testutil" - "github.com/kava-labs/kava/x/precisebank/types" "github.com/stretchr/testify/suite" ) diff --git a/x/precisebank/keeper/send_test.go b/x/precisebank/keeper/send_test.go index a82190fe..bbcfc5a3 100644 --- a/x/precisebank/keeper/send_test.go +++ b/x/precisebank/keeper/send_test.go @@ -3,9 +3,9 @@ package keeper_test import ( "testing" + "github.com/0glabs/0g-chain/x/precisebank/types" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - "github.com/kava-labs/kava/x/precisebank/types" "github.com/stretchr/testify/require" ) diff --git a/x/precisebank/keeper/view.go b/x/precisebank/keeper/view.go index 3c6b83db..2073495b 100644 --- a/x/precisebank/keeper/view.go +++ b/x/precisebank/keeper/view.go @@ -2,8 +2,8 @@ package keeper import ( sdkmath "cosmossdk.io/math" + "github.com/0glabs/0g-chain/x/precisebank/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/kava-labs/kava/x/precisebank/types" ) // GetBalance returns the balance of a specific denom for an address. This will diff --git a/x/precisebank/keeper/view_integration_test.go b/x/precisebank/keeper/view_integration_test.go index a2f38895..4241bb40 100644 --- a/x/precisebank/keeper/view_integration_test.go +++ b/x/precisebank/keeper/view_integration_test.go @@ -8,8 +8,8 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" - "github.com/kava-labs/kava/x/precisebank/testutil" - "github.com/kava-labs/kava/x/precisebank/types" + "github.com/0glabs/0g-chain/x/precisebank/testutil" + "github.com/0glabs/0g-chain/x/precisebank/types" "github.com/stretchr/testify/suite" ) diff --git a/x/precisebank/keeper/view_test.go b/x/precisebank/keeper/view_test.go index 1a4e7820..01179c06 100644 --- a/x/precisebank/keeper/view_test.go +++ b/x/precisebank/keeper/view_test.go @@ -4,9 +4,9 @@ import ( "testing" sdkmath "cosmossdk.io/math" + "github.com/0glabs/0g-chain/x/precisebank/types" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - "github.com/kava-labs/kava/x/precisebank/types" "github.com/stretchr/testify/require" ) diff --git a/x/precisebank/module.go b/x/precisebank/module.go index 6ad8f73a..f81c39c0 100644 --- a/x/precisebank/module.go +++ b/x/precisebank/module.go @@ -15,8 +15,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - "github.com/kava-labs/kava/x/precisebank/keeper" - "github.com/kava-labs/kava/x/precisebank/types" + "github.com/0glabs/0g-chain/x/precisebank/keeper" + "github.com/0glabs/0g-chain/x/precisebank/types" ) // ConsensusVersion defines the current module consensus version. diff --git a/x/precisebank/testutil/fractional_balances.go b/x/precisebank/testutil/fractional_balances.go index 61eb11d3..7e3b4039 100644 --- a/x/precisebank/testutil/fractional_balances.go +++ b/x/precisebank/testutil/fractional_balances.go @@ -6,9 +6,9 @@ import ( "testing" sdkmath "cosmossdk.io/math" + "github.com/0glabs/0g-chain/x/precisebank/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/address" - "github.com/kava-labs/kava/x/precisebank/types" "github.com/stretchr/testify/require" ) diff --git a/x/precisebank/testutil/suite.go b/x/precisebank/testutil/suite.go index 345a64de..cd210bd3 100644 --- a/x/precisebank/testutil/suite.go +++ b/x/precisebank/testutil/suite.go @@ -16,9 +16,9 @@ import ( "github.com/evmos/ethermint/crypto/ethsecp256k1" "github.com/stretchr/testify/suite" - "github.com/kava-labs/kava/app" - "github.com/kava-labs/kava/x/precisebank/keeper" - "github.com/kava-labs/kava/x/precisebank/types" + "github.com/0glabs/0g-chain/app" + "github.com/0glabs/0g-chain/x/precisebank/keeper" + "github.com/0glabs/0g-chain/x/precisebank/types" ) type Suite struct { diff --git a/x/precisebank/types/extended_balance_test.go b/x/precisebank/types/extended_balance_test.go index 9ce8ed21..6686e5fe 100644 --- a/x/precisebank/types/extended_balance_test.go +++ b/x/precisebank/types/extended_balance_test.go @@ -3,8 +3,8 @@ package types_test import ( "testing" + "github.com/0glabs/0g-chain/x/precisebank/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/kava-labs/kava/x/precisebank/types" "github.com/stretchr/testify/require" ) diff --git a/x/precisebank/types/fractional_balance_test.go b/x/precisebank/types/fractional_balance_test.go index fed8c7e8..015b867f 100644 --- a/x/precisebank/types/fractional_balance_test.go +++ b/x/precisebank/types/fractional_balance_test.go @@ -5,8 +5,8 @@ import ( "testing" sdkmath "cosmossdk.io/math" - "github.com/kava-labs/kava/app" - "github.com/kava-labs/kava/x/precisebank/types" + "github.com/0glabs/0g-chain/app" + "github.com/0glabs/0g-chain/x/precisebank/types" "github.com/stretchr/testify/require" ) diff --git a/x/precisebank/types/fractional_balances_test.go b/x/precisebank/types/fractional_balances_test.go index e365e4c4..9d231cb2 100644 --- a/x/precisebank/types/fractional_balances_test.go +++ b/x/precisebank/types/fractional_balances_test.go @@ -7,9 +7,9 @@ import ( "testing" sdkmath "cosmossdk.io/math" + "github.com/0glabs/0g-chain/app" + "github.com/0glabs/0g-chain/x/precisebank/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/kava-labs/kava/app" - "github.com/kava-labs/kava/x/precisebank/types" "github.com/stretchr/testify/require" ) diff --git a/x/precisebank/types/genesis_test.go b/x/precisebank/types/genesis_test.go index dbf4cc38..e51014b8 100644 --- a/x/precisebank/types/genesis_test.go +++ b/x/precisebank/types/genesis_test.go @@ -4,10 +4,10 @@ import ( "testing" sdkmath "cosmossdk.io/math" + "github.com/0glabs/0g-chain/app" + "github.com/0glabs/0g-chain/x/precisebank/testutil" + "github.com/0glabs/0g-chain/x/precisebank/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/kava-labs/kava/app" - "github.com/kava-labs/kava/x/precisebank/testutil" - "github.com/kava-labs/kava/x/precisebank/types" "github.com/stretchr/testify/require" ) diff --git a/x/precisebank/types/keys_test.go b/x/precisebank/types/keys_test.go index 8aca85ef..ca74c0d3 100644 --- a/x/precisebank/types/keys_test.go +++ b/x/precisebank/types/keys_test.go @@ -3,8 +3,8 @@ package types_test import ( "testing" + "github.com/0glabs/0g-chain/x/precisebank/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/kava-labs/kava/x/precisebank/types" "github.com/stretchr/testify/require" ) diff --git a/x/pricefeed/abci_test.go b/x/pricefeed/abci_test.go index 9f9de46e..9de40a55 100644 --- a/x/pricefeed/abci_test.go +++ b/x/pricefeed/abci_test.go @@ -3,10 +3,10 @@ package pricefeed_test import ( "testing" + "github.com/0glabs/0g-chain/x/pricefeed" + "github.com/0glabs/0g-chain/x/pricefeed/keeper" + "github.com/0glabs/0g-chain/x/pricefeed/testutil" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/kava-labs/kava/x/pricefeed" - "github.com/kava-labs/kava/x/pricefeed/keeper" - "github.com/kava-labs/kava/x/pricefeed/testutil" ) func TestEndBlocker_UpdatesMultipleMarkets(t *testing.T) { diff --git a/x/pricefeed/testutil/helpers.go b/x/pricefeed/testutil/helpers.go index 76db45f1..5c1465eb 100644 --- a/x/pricefeed/testutil/helpers.go +++ b/x/pricefeed/testutil/helpers.go @@ -9,9 +9,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/kava-labs/kava/app" - "github.com/kava-labs/kava/x/pricefeed/keeper" - "github.com/kava-labs/kava/x/pricefeed/types" + "github.com/0glabs/0g-chain/app" + "github.com/0glabs/0g-chain/x/pricefeed/keeper" + "github.com/0glabs/0g-chain/x/pricefeed/types" ) func SetCurrentPrices_PriceCalculations(t *testing.T, f func(ctx sdk.Context, keeper keeper.Keeper)) {