From 8e0556466b4b3cfbee6149f1070157c7633e36aa Mon Sep 17 00:00:00 2001 From: Dzmitry Hil Date: Thu, 2 Feb 2023 22:08:59 +0300 Subject: [PATCH] Merge main and replace eth to bnb in the module prefix (#128) * Add eth version/postfix to go module. (#127) * Add eth version/postfix to go module. * Replace module `eth` to `bnb` path. * Replace `gravity` to `arcbnb` in legacy codec registration. --- .github/workflows/integration-tests.yml | 21 --------- .gitignore | 1 + module-porting.md | 8 ++++ module/app/app.go | 8 ++-- module/app/encoding.go | 2 +- module/cmd/gravity/cmd/gentx.go | 2 +- module/cmd/gravity/cmd/root.go | 4 +- module/cmd/gravity/main.go | 4 +- module/go.mod | 2 +- module/x/gravity/abci.go | 4 +- module/x/gravity/abci_test.go | 4 +- module/x/gravity/client/cli/query.go | 2 +- module/x/gravity/client/cli/tx.go | 4 +- module/x/gravity/client/rest/query.go | 2 +- module/x/gravity/client/rest/tx.go | 2 +- module/x/gravity/cosmos-originated_test.go | 4 +- module/x/gravity/handler.go | 4 +- module/x/gravity/handler_test.go | 6 +-- module/x/gravity/keeper/attestation.go | 2 +- .../x/gravity/keeper/attestation_handler.go | 2 +- module/x/gravity/keeper/attestation_test.go | 2 +- module/x/gravity/keeper/batch.go | 2 +- module/x/gravity/keeper/batch_test.go | 2 +- module/x/gravity/keeper/cosmos-originated.go | 2 +- module/x/gravity/keeper/evidence.go | 2 +- module/x/gravity/keeper/evidence_test.go | 2 +- module/x/gravity/keeper/genesis.go | 2 +- module/x/gravity/keeper/genesis_test.go | 2 +- .../x/gravity/keeper/governance_proposals.go | 2 +- .../keeper/governance_proposals_test.go | 2 +- module/x/gravity/keeper/grpc_query.go | 2 +- module/x/gravity/keeper/invariants.go | 2 +- module/x/gravity/keeper/invariants_test.go | 2 +- module/x/gravity/keeper/keeper.go | 2 +- module/x/gravity/keeper/keeper_batch.go | 2 +- .../x/gravity/keeper/keeper_delegate_key.go | 2 +- module/x/gravity/keeper/keeper_logic_call.go | 2 +- module/x/gravity/keeper/keeper_test.go | 2 +- module/x/gravity/keeper/keeper_valset.go | 2 +- module/x/gravity/keeper/msg_server.go | 2 +- module/x/gravity/keeper/pool.go | 2 +- module/x/gravity/keeper/pool_test.go | 2 +- module/x/gravity/keeper/querier.go | 2 +- module/x/gravity/keeper/querier_test.go | 6 +-- module/x/gravity/keeper/test_common.go | 2 +- module/x/gravity/module.go | 8 ++-- module/x/gravity/types/batch_test.go | 2 +- module/x/gravity/types/codec.go | 46 +++++++++---------- orchestrator/gbt/src/client/cosmos_to_eth.rs | 6 +-- .../src/client/deploy_erc20_representation.rs | 6 +-- orchestrator/gbt/src/client/eth_to_cosmos.rs | 9 ++-- orchestrator/gbt/src/config.rs | 3 +- orchestrator/gbt/src/gov/proposals.rs | 36 +++++---------- orchestrator/gbt/src/gov/queries.rs | 3 +- .../src/keys/register_orchestrator_address.rs | 2 +- .../gravity_utils/src/connection_prep.rs | 36 +++++++-------- .../gravity_utils/src/num_conversion.rs | 6 +-- .../src/types/ethereum_events.rs | 3 +- .../src/ethereum_event_watcher.rs | 5 +- orchestrator/proto_build/src/main.rs | 4 +- .../test_runner/src/airdrop_proposal.rs | 4 +- orchestrator/test_runner/src/bootstrapping.rs | 4 +- .../test_runner/src/deposit_overflow.rs | 4 +- orchestrator/test_runner/src/happy_path.rs | 16 ++----- orchestrator/test_runner/src/ibc_metadata.rs | 4 +- .../test_runner/src/invalid_events.rs | 2 +- orchestrator/test_runner/src/pause_bridge.rs | 4 +- orchestrator/test_runner/src/relay_market.rs | 16 +++---- orchestrator/test_runner/src/tx_cancel.rs | 2 +- orchestrator/test_runner/src/utils.rs | 6 +-- .../test_runner/src/valset_rewards.rs | 2 +- 71 files changed, 168 insertions(+), 213 deletions(-) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 32e6dd393..9d728a786 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -5,7 +5,6 @@ on: branches: [bnb] pull_request: -# the old `action-docker-layer-caching` repo was unmaintained, found https://github.com/satackey/action-docker-layer-caching/issues/347 as an alternative jobs: # this is the standard test, which is the only one without `skip-save: true` so we don't waste a # lot of resources saving the same thing for every test @@ -13,9 +12,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: jpribyl/action-docker-layer-caching@v0.1.1 - - name: Prune cache to keep the size down - run: docker builder prune -af && docker system prune -af - name: Run all up happy-path test run: tests/all-up-test.sh # these other tests before the matrix have special requirements @@ -23,24 +19,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: jpribyl/action-docker-layer-caching@v0.1.1 - with: - skip-save: true - name: Run all up happy-path test run: tests/all-up-test.sh env: HARDHAT: True - # relay-market: - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v2 - # - uses: jpribyl/action-docker-layer-caching@v0.1.1 - # with: - # skip-save: true - # - name: Run all up relay market test - # run: tests/all-up-test.sh RELAY_MARKET $ALCHEMY_ID - # env: - # ALCHEMY_ID: ${{ secrets.ALCHEMY_ID }} all-up-test-matrix: runs-on: ubuntu-latest strategy: @@ -68,8 +50,5 @@ jobs: ] steps: - uses: actions/checkout@v2 - - uses: jpribyl/action-docker-layer-caching@v0.1.1 - with: - skip-save: true - name: Run all up ${{ matrix.name }} test run: tests/all-up-test.sh ${{ matrix.name }} diff --git a/.gitignore b/.gitignore index ed59d233d..fb404a5c6 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,7 @@ tests/assets/*.log # IDE files .idea/ module/vendor +*.iml #Hardhat files cache diff --git a/module-porting.md b/module-porting.md index f7e9a0c5c..25b319b0b 100644 --- a/module-porting.md +++ b/module-porting.md @@ -9,6 +9,8 @@ This doc is written for the `bnb` chain integration, if you use another, replace ## Module +* Change module version/prefix, rename in all `go` files and `go.mod` `github.com/onomyprotocol/arc/module/eth` to `github.com/onomyprotocol/arc/module/bnb`. + * Change the module name in the `module/x/gravity/types/keys.go` `ModuleName = "gravity"` to `ModuleName = "arcbnb"`. * Rename the folder `module/proto/gravity` to `module/proto/arcbnb`. @@ -23,6 +25,12 @@ This doc is written for the `bnb` chain integration, if you use another, replace * Update `proto-check-breaking` goal in the `Makefile`, updated the `#branch=main` to `#branch=bnb` +* Replace `gravity.v1beta1` to `arcbnb.v1beta1` in all files. + +* Replace `gravity/Msg` to `arcbnb/Msg` in all files. + +* Replace `gravity` to `arcbnb` in the `module/x/gravity/types/codec.go` file. + ## Solidity * Replace `/custom/gravity` to `/custom/arcbnb` in the `solidity` folder. diff --git a/module/app/app.go b/module/app/app.go index 872505118..990374811 100644 --- a/module/app/app.go +++ b/module/app/app.go @@ -94,10 +94,10 @@ import ( // unnamed import of statik for swagger UI support _ "github.com/cosmos/cosmos-sdk/client/docs/statik" - gravityparams "github.com/onomyprotocol/arc/module/app/params" - "github.com/onomyprotocol/arc/module/x/gravity" - "github.com/onomyprotocol/arc/module/x/gravity/keeper" - gravitytypes "github.com/onomyprotocol/arc/module/x/gravity/types" + gravityparams "github.com/onomyprotocol/arc/module/bnb/app/params" + "github.com/onomyprotocol/arc/module/bnb/x/gravity" + "github.com/onomyprotocol/arc/module/bnb/x/gravity/keeper" + gravitytypes "github.com/onomyprotocol/arc/module/bnb/x/gravity/types" ) const appName = "app" diff --git a/module/app/encoding.go b/module/app/encoding.go index 478b74c80..799e7f453 100644 --- a/module/app/encoding.go +++ b/module/app/encoding.go @@ -2,7 +2,7 @@ package app import ( "github.com/cosmos/cosmos-sdk/std" - gravityparams "github.com/onomyprotocol/arc/module/app/params" + gravityparams "github.com/onomyprotocol/arc/module/bnb/app/params" ) // MakeEncodingConfig creates an EncodingConfig for gravity. diff --git a/module/cmd/gravity/cmd/gentx.go b/module/cmd/gravity/cmd/gentx.go index fa4dfe70d..f686467d3 100644 --- a/module/cmd/gravity/cmd/gentx.go +++ b/module/cmd/gravity/cmd/gentx.go @@ -35,7 +35,7 @@ import ( "github.com/cosmos/cosmos-sdk/x/genutil/types" "github.com/cosmos/cosmos-sdk/x/staking/client/cli" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - gravitytypes "github.com/onomyprotocol/arc/module/x/gravity/types" + gravitytypes "github.com/onomyprotocol/arc/module/bnb/x/gravity/types" ) // GenTxCmd builds the application's gentx command. diff --git a/module/cmd/gravity/cmd/root.go b/module/cmd/gravity/cmd/root.go index 45adbc1e9..a30bb1b47 100644 --- a/module/cmd/gravity/cmd/root.go +++ b/module/cmd/gravity/cmd/root.go @@ -31,8 +31,8 @@ import ( "github.com/tendermint/tendermint/libs/log" dbm "github.com/tendermint/tm-db" - "github.com/onomyprotocol/arc/module/app" - "github.com/onomyprotocol/arc/module/app/params" + "github.com/onomyprotocol/arc/module/bnb/app" + "github.com/onomyprotocol/arc/module/bnb/app/params" ) // NewRootCmd creates a new root command for simd. It is called once in the diff --git a/module/cmd/gravity/main.go b/module/cmd/gravity/main.go index 3f4ba60a1..c5b53ed5d 100644 --- a/module/cmd/gravity/main.go +++ b/module/cmd/gravity/main.go @@ -4,8 +4,8 @@ import ( "os" "github.com/cosmos/cosmos-sdk/server" - "github.com/onomyprotocol/arc/module/cmd/gravity/cmd" - _ "github.com/onomyprotocol/arc/module/config" + "github.com/onomyprotocol/arc/module/bnb/cmd/gravity/cmd" + _ "github.com/onomyprotocol/arc/module/bnb/config" ) func main() { diff --git a/module/go.mod b/module/go.mod index d0b928aad..c656f5cb0 100644 --- a/module/go.mod +++ b/module/go.mod @@ -1,4 +1,4 @@ -module github.com/onomyprotocol/arc/module +module github.com/onomyprotocol/arc/module/bnb go 1.16 diff --git a/module/x/gravity/abci.go b/module/x/gravity/abci.go index 2bb563bbb..83a635d12 100644 --- a/module/x/gravity/abci.go +++ b/module/x/gravity/abci.go @@ -4,8 +4,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/onomyprotocol/arc/module/x/gravity/keeper" - "github.com/onomyprotocol/arc/module/x/gravity/types" + "github.com/onomyprotocol/arc/module/bnb/x/gravity/keeper" + "github.com/onomyprotocol/arc/module/bnb/x/gravity/types" ) // EndBlocker is called at the end of every block diff --git a/module/x/gravity/abci_test.go b/module/x/gravity/abci_test.go index f7bb5e428..cd76d1689 100644 --- a/module/x/gravity/abci_test.go +++ b/module/x/gravity/abci_test.go @@ -11,8 +11,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" "github.com/cosmos/cosmos-sdk/x/staking" - "github.com/onomyprotocol/arc/module/x/gravity/keeper" - "github.com/onomyprotocol/arc/module/x/gravity/types" + "github.com/onomyprotocol/arc/module/bnb/x/gravity/keeper" + "github.com/onomyprotocol/arc/module/bnb/x/gravity/types" ) func TestValsetCreationIfNotAvailable(t *testing.T) { diff --git a/module/x/gravity/client/cli/query.go b/module/x/gravity/client/cli/query.go index 9ae90263c..ae3e3a41c 100644 --- a/module/x/gravity/client/cli/query.go +++ b/module/x/gravity/client/cli/query.go @@ -7,7 +7,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/spf13/cobra" - "github.com/onomyprotocol/arc/module/x/gravity/types" + "github.com/onomyprotocol/arc/module/bnb/x/gravity/types" ) func GetQueryCmd() *cobra.Command { diff --git a/module/x/gravity/client/cli/tx.go b/module/x/gravity/client/cli/tx.go index 5368e5161..bb6b63714 100644 --- a/module/x/gravity/client/cli/tx.go +++ b/module/x/gravity/client/cli/tx.go @@ -15,8 +15,8 @@ import ( govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/spf13/cobra" - "github.com/onomyprotocol/arc/module/x/gravity/keeper" - "github.com/onomyprotocol/arc/module/x/gravity/types" + "github.com/onomyprotocol/arc/module/bnb/x/gravity/keeper" + "github.com/onomyprotocol/arc/module/bnb/x/gravity/types" ) func GetTxCmd(storeKey string) *cobra.Command { diff --git a/module/x/gravity/client/rest/query.go b/module/x/gravity/client/rest/query.go index aa903a3bc..327093063 100644 --- a/module/x/gravity/client/rest/query.go +++ b/module/x/gravity/client/rest/query.go @@ -8,7 +8,7 @@ import ( "github.com/cosmos/cosmos-sdk/types/rest" "github.com/gorilla/mux" - "github.com/onomyprotocol/arc/module/x/gravity/types" + "github.com/onomyprotocol/arc/module/bnb/x/gravity/types" ) func getValsetRequestHandler(cliCtx client.Context, storeName string) http.HandlerFunc { diff --git a/module/x/gravity/client/rest/tx.go b/module/x/gravity/client/rest/tx.go index ade1f5eca..2fe988c0e 100644 --- a/module/x/gravity/client/rest/tx.go +++ b/module/x/gravity/client/rest/tx.go @@ -11,7 +11,7 @@ import ( hexUtil "github.com/ethereum/go-ethereum/common/hexutil" ethCrypto "github.com/ethereum/go-ethereum/crypto" - "github.com/onomyprotocol/arc/module/x/gravity/types" + "github.com/onomyprotocol/arc/module/bnb/x/gravity/types" ) type valsetConfirmReq struct { diff --git a/module/x/gravity/cosmos-originated_test.go b/module/x/gravity/cosmos-originated_test.go index ad7d9d138..5152d4c37 100644 --- a/module/x/gravity/cosmos-originated_test.go +++ b/module/x/gravity/cosmos-originated_test.go @@ -8,8 +8,8 @@ import ( "github.com/stretchr/testify/require" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/onomyprotocol/arc/module/x/gravity/keeper" - "github.com/onomyprotocol/arc/module/x/gravity/types" + "github.com/onomyprotocol/arc/module/bnb/x/gravity/keeper" + "github.com/onomyprotocol/arc/module/bnb/x/gravity/types" ) // Have the validators put in a erc20<>denom relation with ERC20DeployedEvent diff --git a/module/x/gravity/handler.go b/module/x/gravity/handler.go index 52c4a7d4d..d97877e21 100644 --- a/module/x/gravity/handler.go +++ b/module/x/gravity/handler.go @@ -6,8 +6,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/onomyprotocol/arc/module/x/gravity/keeper" - "github.com/onomyprotocol/arc/module/x/gravity/types" + "github.com/onomyprotocol/arc/module/bnb/x/gravity/keeper" + "github.com/onomyprotocol/arc/module/bnb/x/gravity/types" ) // NewHandler returns a handler for "Gravity" type messages. diff --git a/module/x/gravity/handler_test.go b/module/x/gravity/handler_test.go index af4a3fe7b..055c6eeba 100644 --- a/module/x/gravity/handler_test.go +++ b/module/x/gravity/handler_test.go @@ -11,9 +11,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - _ "github.com/onomyprotocol/arc/module/config" - "github.com/onomyprotocol/arc/module/x/gravity/keeper" - "github.com/onomyprotocol/arc/module/x/gravity/types" + _ "github.com/onomyprotocol/arc/module/bnb/config" + "github.com/onomyprotocol/arc/module/bnb/x/gravity/keeper" + "github.com/onomyprotocol/arc/module/bnb/x/gravity/types" ) //nolint: exhaustivestruct diff --git a/module/x/gravity/keeper/attestation.go b/module/x/gravity/keeper/attestation.go index 26317038e..08ea0914d 100644 --- a/module/x/gravity/keeper/attestation.go +++ b/module/x/gravity/keeper/attestation.go @@ -9,7 +9,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/onomyprotocol/arc/module/x/gravity/types" + "github.com/onomyprotocol/arc/module/bnb/x/gravity/types" ) // TODO-JT: carefully look at atomicity of this function diff --git a/module/x/gravity/keeper/attestation_handler.go b/module/x/gravity/keeper/attestation_handler.go index 9f337d1ce..17600f823 100644 --- a/module/x/gravity/keeper/attestation_handler.go +++ b/module/x/gravity/keeper/attestation_handler.go @@ -11,7 +11,7 @@ import ( bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" distypes "github.com/cosmos/cosmos-sdk/x/distribution/types" - "github.com/onomyprotocol/arc/module/x/gravity/types" + "github.com/onomyprotocol/arc/module/bnb/x/gravity/types" ) // Check that distKeeper implements the expected type diff --git a/module/x/gravity/keeper/attestation_test.go b/module/x/gravity/keeper/attestation_test.go index e33106a9d..dde8fc2bf 100644 --- a/module/x/gravity/keeper/attestation_test.go +++ b/module/x/gravity/keeper/attestation_test.go @@ -5,7 +5,7 @@ import ( codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdktypes "github.com/cosmos/cosmos-sdk/types" - "github.com/onomyprotocol/arc/module/x/gravity/types" + "github.com/onomyprotocol/arc/module/bnb/x/gravity/types" "github.com/stretchr/testify/require" ) diff --git a/module/x/gravity/keeper/batch.go b/module/x/gravity/keeper/batch.go index db915d32a..957a69310 100644 --- a/module/x/gravity/keeper/batch.go +++ b/module/x/gravity/keeper/batch.go @@ -8,7 +8,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/onomyprotocol/arc/module/x/gravity/types" + "github.com/onomyprotocol/arc/module/bnb/x/gravity/types" ) const OutgoingTxBatchSize = 100 diff --git a/module/x/gravity/keeper/batch_test.go b/module/x/gravity/keeper/batch_test.go index 41a5c00dc..85fcf46d9 100644 --- a/module/x/gravity/keeper/batch_test.go +++ b/module/x/gravity/keeper/batch_test.go @@ -10,7 +10,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onomyprotocol/arc/module/x/gravity/types" + "github.com/onomyprotocol/arc/module/bnb/x/gravity/types" ) //nolint: exhaustivestruct diff --git a/module/x/gravity/keeper/cosmos-originated.go b/module/x/gravity/keeper/cosmos-originated.go index 03bbd22e5..6f85b5b3b 100644 --- a/module/x/gravity/keeper/cosmos-originated.go +++ b/module/x/gravity/keeper/cosmos-originated.go @@ -7,7 +7,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/onomyprotocol/arc/module/x/gravity/types" + "github.com/onomyprotocol/arc/module/bnb/x/gravity/types" ) func (k Keeper) GetCosmosOriginatedDenom(ctx sdk.Context, tokenContract types.EthAddress) (string, bool) { diff --git a/module/x/gravity/keeper/evidence.go b/module/x/gravity/keeper/evidence.go index 6477beeaf..990725d57 100644 --- a/module/x/gravity/keeper/evidence.go +++ b/module/x/gravity/keeper/evidence.go @@ -8,7 +8,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/onomyprotocol/arc/module/x/gravity/types" + "github.com/onomyprotocol/arc/module/bnb/x/gravity/types" ) func (k Keeper) CheckBadSignatureEvidence( diff --git a/module/x/gravity/keeper/evidence_test.go b/module/x/gravity/keeper/evidence_test.go index 1ceb9072b..088f76f58 100644 --- a/module/x/gravity/keeper/evidence_test.go +++ b/module/x/gravity/keeper/evidence_test.go @@ -8,7 +8,7 @@ import ( codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/ethereum/go-ethereum/crypto" - "github.com/onomyprotocol/arc/module/x/gravity/types" + "github.com/onomyprotocol/arc/module/bnb/x/gravity/types" "github.com/stretchr/testify/require" ) diff --git a/module/x/gravity/keeper/genesis.go b/module/x/gravity/keeper/genesis.go index ea0b18c3b..6e1230965 100644 --- a/module/x/gravity/keeper/genesis.go +++ b/module/x/gravity/keeper/genesis.go @@ -6,7 +6,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/onomyprotocol/arc/module/x/gravity/types" + "github.com/onomyprotocol/arc/module/bnb/x/gravity/types" ) // InitGenesis starts a chain from a genesis state diff --git a/module/x/gravity/keeper/genesis_test.go b/module/x/gravity/keeper/genesis_test.go index af6042d28..4e2d73951 100644 --- a/module/x/gravity/keeper/genesis_test.go +++ b/module/x/gravity/keeper/genesis_test.go @@ -7,7 +7,7 @@ import ( "time" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/onomyprotocol/arc/module/x/gravity/types" + "github.com/onomyprotocol/arc/module/bnb/x/gravity/types" "github.com/stretchr/testify/require" ) diff --git a/module/x/gravity/keeper/governance_proposals.go b/module/x/gravity/keeper/governance_proposals.go index 2a74f2933..21c721144 100644 --- a/module/x/gravity/keeper/governance_proposals.go +++ b/module/x/gravity/keeper/governance_proposals.go @@ -8,7 +8,7 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" disttypes "github.com/cosmos/cosmos-sdk/x/distribution/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - "github.com/onomyprotocol/arc/module/x/gravity/types" + "github.com/onomyprotocol/arc/module/bnb/x/gravity/types" ) // this file contains code related to custom governance proposals diff --git a/module/x/gravity/keeper/governance_proposals_test.go b/module/x/gravity/keeper/governance_proposals_test.go index 8e267d83d..57e6fe3c9 100644 --- a/module/x/gravity/keeper/governance_proposals_test.go +++ b/module/x/gravity/keeper/governance_proposals_test.go @@ -6,7 +6,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" disttypes "github.com/cosmos/cosmos-sdk/x/distribution/types" - "github.com/onomyprotocol/arc/module/x/gravity/types" + "github.com/onomyprotocol/arc/module/bnb/x/gravity/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/module/x/gravity/keeper/grpc_query.go b/module/x/gravity/keeper/grpc_query.go index b139ccae9..4ceee437e 100644 --- a/module/x/gravity/keeper/grpc_query.go +++ b/module/x/gravity/keeper/grpc_query.go @@ -9,7 +9,7 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" - "github.com/onomyprotocol/arc/module/x/gravity/types" + "github.com/onomyprotocol/arc/module/bnb/x/gravity/types" ) var _ types.QueryServer = Keeper{ diff --git a/module/x/gravity/keeper/invariants.go b/module/x/gravity/keeper/invariants.go index cf199fdd3..702177970 100644 --- a/module/x/gravity/keeper/invariants.go +++ b/module/x/gravity/keeper/invariants.go @@ -4,7 +4,7 @@ import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/onomyprotocol/arc/module/x/gravity/types" + "github.com/onomyprotocol/arc/module/bnb/x/gravity/types" ) // TODO: Add any future invariants here diff --git a/module/x/gravity/keeper/invariants_test.go b/module/x/gravity/keeper/invariants_test.go index 7aab9f069..c7f3e9ab2 100644 --- a/module/x/gravity/keeper/invariants_test.go +++ b/module/x/gravity/keeper/invariants_test.go @@ -7,7 +7,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" - "github.com/onomyprotocol/arc/module/x/gravity/types" + "github.com/onomyprotocol/arc/module/bnb/x/gravity/types" "github.com/stretchr/testify/require" ) diff --git a/module/x/gravity/keeper/keeper.go b/module/x/gravity/keeper/keeper.go index e523d373e..bf2a82cae 100644 --- a/module/x/gravity/keeper/keeper.go +++ b/module/x/gravity/keeper/keeper.go @@ -17,7 +17,7 @@ import ( stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/tendermint/tendermint/libs/log" - "github.com/onomyprotocol/arc/module/x/gravity/types" + "github.com/onomyprotocol/arc/module/bnb/x/gravity/types" ) // Check that our expected keeper types are implemented diff --git a/module/x/gravity/keeper/keeper_batch.go b/module/x/gravity/keeper/keeper_batch.go index 3ce63fbbf..ab0567573 100644 --- a/module/x/gravity/keeper/keeper_batch.go +++ b/module/x/gravity/keeper/keeper_batch.go @@ -5,7 +5,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/onomyprotocol/arc/module/x/gravity/types" + "github.com/onomyprotocol/arc/module/bnb/x/gravity/types" ) ///////////////////////////// diff --git a/module/x/gravity/keeper/keeper_delegate_key.go b/module/x/gravity/keeper/keeper_delegate_key.go index 5aedf9d12..c856c996e 100644 --- a/module/x/gravity/keeper/keeper_delegate_key.go +++ b/module/x/gravity/keeper/keeper_delegate_key.go @@ -9,7 +9,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/onomyprotocol/arc/module/x/gravity/types" + "github.com/onomyprotocol/arc/module/bnb/x/gravity/types" ) ///////////////////////////// diff --git a/module/x/gravity/keeper/keeper_logic_call.go b/module/x/gravity/keeper/keeper_logic_call.go index 9c9a7c3bd..f4cd4ffd8 100644 --- a/module/x/gravity/keeper/keeper_logic_call.go +++ b/module/x/gravity/keeper/keeper_logic_call.go @@ -7,7 +7,7 @@ import ( "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/onomyprotocol/arc/module/x/gravity/types" + "github.com/onomyprotocol/arc/module/bnb/x/gravity/types" ) ///////////////////////////// diff --git a/module/x/gravity/keeper/keeper_test.go b/module/x/gravity/keeper/keeper_test.go index e8ed116ed..d56f45349 100644 --- a/module/x/gravity/keeper/keeper_test.go +++ b/module/x/gravity/keeper/keeper_test.go @@ -12,7 +12,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onomyprotocol/arc/module/x/gravity/types" + "github.com/onomyprotocol/arc/module/bnb/x/gravity/types" ) //nolint: exhaustivestruct diff --git a/module/x/gravity/keeper/keeper_valset.go b/module/x/gravity/keeper/keeper_valset.go index 418e67fc8..ec2bd00c0 100644 --- a/module/x/gravity/keeper/keeper_valset.go +++ b/module/x/gravity/keeper/keeper_valset.go @@ -11,7 +11,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/onomyprotocol/arc/module/x/gravity/types" + "github.com/onomyprotocol/arc/module/bnb/x/gravity/types" ) ///////////////////////////// diff --git a/module/x/gravity/keeper/msg_server.go b/module/x/gravity/keeper/msg_server.go index c1701c8bb..7b6259e5e 100644 --- a/module/x/gravity/keeper/msg_server.go +++ b/module/x/gravity/keeper/msg_server.go @@ -10,7 +10,7 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/onomyprotocol/arc/module/x/gravity/types" + "github.com/onomyprotocol/arc/module/bnb/x/gravity/types" ) type msgServer struct { diff --git a/module/x/gravity/keeper/pool.go b/module/x/gravity/keeper/pool.go index 0c98a1d38..dca59e1b7 100644 --- a/module/x/gravity/keeper/pool.go +++ b/module/x/gravity/keeper/pool.go @@ -9,7 +9,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/onomyprotocol/arc/module/x/gravity/types" + "github.com/onomyprotocol/arc/module/bnb/x/gravity/types" ) // AddToOutgoingPool creates a transaction and adds it to the pool, returns the id of the unbatched transaction diff --git a/module/x/gravity/keeper/pool_test.go b/module/x/gravity/keeper/pool_test.go index 8177761d8..bec5b6620 100644 --- a/module/x/gravity/keeper/pool_test.go +++ b/module/x/gravity/keeper/pool_test.go @@ -9,7 +9,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onomyprotocol/arc/module/x/gravity/types" + "github.com/onomyprotocol/arc/module/bnb/x/gravity/types" ) // Tests that the pool is populated with the created transactions before any batch is created diff --git a/module/x/gravity/keeper/querier.go b/module/x/gravity/keeper/querier.go index 5047e2d2c..59efbd309 100644 --- a/module/x/gravity/keeper/querier.go +++ b/module/x/gravity/keeper/querier.go @@ -6,7 +6,7 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" abci "github.com/tendermint/tendermint/abci/types" - "github.com/onomyprotocol/arc/module/x/gravity/types" + "github.com/onomyprotocol/arc/module/bnb/x/gravity/types" ) const ( diff --git a/module/x/gravity/keeper/querier_test.go b/module/x/gravity/keeper/querier_test.go index 5d807a69d..43ebe3db5 100644 --- a/module/x/gravity/keeper/querier_test.go +++ b/module/x/gravity/keeper/querier_test.go @@ -14,8 +14,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - _ "github.com/onomyprotocol/arc/module/config" - "github.com/onomyprotocol/arc/module/x/gravity/types" + _ "github.com/onomyprotocol/arc/module/bnb/config" + "github.com/onomyprotocol/arc/module/bnb/x/gravity/types" ) func TestQueryValsetConfirm(t *testing.T) { @@ -50,7 +50,7 @@ func TestQueryValsetConfirm(t *testing.T) { "all good": { src: types.QueryValsetConfirmRequest{Nonce: 1, Address: myValidatorCosmosAddr.String()}, - //expResp: []byte(`{"type":"gravity/MsgValsetConfirm", "value":{"eth_address":"0x3232323232323232323232323232323232323232", "nonce": "1", "orchestrator": "cosmos1ees2tqhhhm9ahlhceh2zdguww9lqn2ckukn86l", "signature": "alksdjhflkasjdfoiasjdfiasjdfoiasdj"}}`), + //expResp: []byte(`{"type":"arcbnb/MsgValsetConfirm", "value":{"eth_address":"0x3232323232323232323232323232323232323232", "nonce": "1", "orchestrator": "cosmos1ees2tqhhhm9ahlhceh2zdguww9lqn2ckukn86l", "signature": "alksdjhflkasjdfoiasjdfiasjdfoiasdj"}}`), expResp: types.QueryValsetConfirmResponse{ Confirm: types.NewMsgValsetConfirm(1, *myValidatorEthereumAddr, myValidatorCosmosAddr, "alksdjhflkasjdfoiasjdfiasjdfoiasdj")}, expErr: false, diff --git a/module/x/gravity/keeper/test_common.go b/module/x/gravity/keeper/test_common.go index e860cde96..3b56edb96 100644 --- a/module/x/gravity/keeper/test_common.go +++ b/module/x/gravity/keeper/test_common.go @@ -57,7 +57,7 @@ import ( tmversion "github.com/tendermint/tendermint/proto/tendermint/version" dbm "github.com/tendermint/tm-db" - "github.com/onomyprotocol/arc/module/x/gravity/types" + "github.com/onomyprotocol/arc/module/bnb/x/gravity/types" ) var ( diff --git a/module/x/gravity/module.go b/module/x/gravity/module.go index 3b3093161..b57bc076d 100644 --- a/module/x/gravity/module.go +++ b/module/x/gravity/module.go @@ -19,10 +19,10 @@ import ( bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" abci "github.com/tendermint/tendermint/abci/types" - "github.com/onomyprotocol/arc/module/x/gravity/client/cli" - "github.com/onomyprotocol/arc/module/x/gravity/client/rest" - "github.com/onomyprotocol/arc/module/x/gravity/keeper" - "github.com/onomyprotocol/arc/module/x/gravity/types" + "github.com/onomyprotocol/arc/module/bnb/x/gravity/client/cli" + "github.com/onomyprotocol/arc/module/bnb/x/gravity/client/rest" + "github.com/onomyprotocol/arc/module/bnb/x/gravity/keeper" + "github.com/onomyprotocol/arc/module/bnb/x/gravity/types" ) // type check to ensure the interface is properly implemented diff --git a/module/x/gravity/types/batch_test.go b/module/x/gravity/types/batch_test.go index cbd2b6ff5..936ecf226 100644 --- a/module/x/gravity/types/batch_test.go +++ b/module/x/gravity/types/batch_test.go @@ -5,7 +5,7 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - _ "github.com/onomyprotocol/arc/module/config" + _ "github.com/onomyprotocol/arc/module/bnb/config" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/module/x/gravity/types/codec.go b/module/x/gravity/types/codec.go index 593df466f..b33f8501e 100644 --- a/module/x/gravity/types/codec.go +++ b/module/x/gravity/types/codec.go @@ -15,7 +15,7 @@ func init() { RegisterCodec(ModuleCdc) } -//nolint: exhaustivestruct +// nolint: exhaustivestruct // RegisterInterfaces registers the interfaces for the proto stuff func RegisterInterfaces(registry types.InterfaceRegistry) { registry.RegisterImplementations((*sdk.Msg)(nil), @@ -35,7 +35,7 @@ func RegisterInterfaces(registry types.InterfaceRegistry) { ) registry.RegisterInterface( - "gravity.v1beta1.EthereumClaim", + "arcbnb.v1beta1.EthereumClaim", (*EthereumClaim)(nil), &MsgSendToCosmosClaim{}, &MsgBatchSendToEthClaim{}, @@ -46,32 +46,32 @@ func RegisterInterfaces(registry types.InterfaceRegistry) { registry.RegisterImplementations((*govtypes.Content)(nil), &UnhaltBridgeProposal{}, &AirdropProposal{}, &IBCMetadataProposal{}) - registry.RegisterInterface("gravity.v1beta1.EthereumSigned", (*EthereumSigned)(nil), &Valset{}, &OutgoingTxBatch{}, &OutgoingLogicCall{}) + registry.RegisterInterface("arcbnb.v1beta1.EthereumSigned", (*EthereumSigned)(nil), &Valset{}, &OutgoingTxBatch{}, &OutgoingLogicCall{}) msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) } -//nolint: exhaustivestruct +// nolint: exhaustivestruct // RegisterCodec registers concrete types on the Amino codec func RegisterCodec(cdc *codec.LegacyAmino) { cdc.RegisterInterface((*EthereumClaim)(nil), nil) - cdc.RegisterConcrete(&MsgSetOrchestratorAddress{}, "gravity/MsgSetOrchestratorAddress", nil) - cdc.RegisterConcrete(&MsgValsetConfirm{}, "gravity/MsgValsetConfirm", nil) - cdc.RegisterConcrete(&MsgSendToEth{}, "gravity/MsgSendToEth", nil) - cdc.RegisterConcrete(&MsgRequestBatch{}, "gravity/MsgRequestBatch", nil) - cdc.RegisterConcrete(&MsgConfirmBatch{}, "gravity/MsgConfirmBatch", nil) - cdc.RegisterConcrete(&MsgConfirmLogicCall{}, "gravity/MsgConfirmLogicCall", nil) - cdc.RegisterConcrete(&Valset{}, "gravity/Valset", nil) - cdc.RegisterConcrete(&MsgSendToCosmosClaim{}, "gravity/MsgSendToCosmosClaim", nil) - cdc.RegisterConcrete(&MsgBatchSendToEthClaim{}, "gravity/MsgBatchSendToEthClaim", nil) - cdc.RegisterConcrete(&MsgERC20DeployedClaim{}, "gravity/MsgERC20DeployedClaim", nil) - cdc.RegisterConcrete(&MsgLogicCallExecutedClaim{}, "gravity/MsgLogicCallExecutedClaim", nil) - cdc.RegisterConcrete(&MsgValsetUpdatedClaim{}, "gravity/MsgValsetUpdatedClaim", nil) - cdc.RegisterConcrete(&OutgoingTxBatch{}, "gravity/OutgoingTxBatch", nil) - cdc.RegisterConcrete(&MsgCancelSendToEth{}, "gravity/MsgCancelSendToEth", nil) - cdc.RegisterConcrete(&OutgoingTransferTx{}, "gravity/OutgoingTransferTx", nil) - cdc.RegisterConcrete(&ERC20Token{}, "gravity/ERC20Token", nil) - cdc.RegisterConcrete(&IDSet{}, "gravity/IDSet", nil) - cdc.RegisterConcrete(&Attestation{}, "gravity/Attestation", nil) - cdc.RegisterConcrete(&MsgSubmitBadSignatureEvidence{}, "gravity/MsgSubmitBadSignatureEvidence", nil) + cdc.RegisterConcrete(&MsgSetOrchestratorAddress{}, "arcbnb/MsgSetOrchestratorAddress", nil) + cdc.RegisterConcrete(&MsgValsetConfirm{}, "arcbnb/MsgValsetConfirm", nil) + cdc.RegisterConcrete(&MsgSendToEth{}, "arcbnb/MsgSendToEth", nil) + cdc.RegisterConcrete(&MsgRequestBatch{}, "arcbnb/MsgRequestBatch", nil) + cdc.RegisterConcrete(&MsgConfirmBatch{}, "arcbnb/MsgConfirmBatch", nil) + cdc.RegisterConcrete(&MsgConfirmLogicCall{}, "arcbnb/MsgConfirmLogicCall", nil) + cdc.RegisterConcrete(&Valset{}, "arcbnb/Valset", nil) + cdc.RegisterConcrete(&MsgSendToCosmosClaim{}, "arcbnb/MsgSendToCosmosClaim", nil) + cdc.RegisterConcrete(&MsgBatchSendToEthClaim{}, "arcbnb/MsgBatchSendToEthClaim", nil) + cdc.RegisterConcrete(&MsgERC20DeployedClaim{}, "arcbnb/MsgERC20DeployedClaim", nil) + cdc.RegisterConcrete(&MsgLogicCallExecutedClaim{}, "arcbnb/MsgLogicCallExecutedClaim", nil) + cdc.RegisterConcrete(&MsgValsetUpdatedClaim{}, "arcbnb/MsgValsetUpdatedClaim", nil) + cdc.RegisterConcrete(&OutgoingTxBatch{}, "arcbnb/OutgoingTxBatch", nil) + cdc.RegisterConcrete(&MsgCancelSendToEth{}, "arcbnb/MsgCancelSendToEth", nil) + cdc.RegisterConcrete(&OutgoingTransferTx{}, "arcbnb/OutgoingTransferTx", nil) + cdc.RegisterConcrete(&ERC20Token{}, "arcbnb/ERC20Token", nil) + cdc.RegisterConcrete(&IDSet{}, "arcbnb/IDSet", nil) + cdc.RegisterConcrete(&Attestation{}, "arcbnb/Attestation", nil) + cdc.RegisterConcrete(&MsgSubmitBadSignatureEvidence{}, "arcbnb/MsgSubmitBadSignatureEvidence", nil) } diff --git a/orchestrator/gbt/src/client/cosmos_to_eth.rs b/orchestrator/gbt/src/client/cosmos_to_eth.rs index 9fd1ca84d..21e328cb1 100644 --- a/orchestrator/gbt/src/client/cosmos_to_eth.rs +++ b/orchestrator/gbt/src/client/cosmos_to_eth.rs @@ -32,8 +32,7 @@ pub async fn cosmos_to_eth( Ok(v) => v.cosmos_originated, Err(e) => { return Err(GravityError::UnrecoverableError(format!( - "Could not lookup denom is it valid? {:?}", - e + "Could not lookup denom is it valid? {e:?}" ))); } }; @@ -105,8 +104,7 @@ pub async fn cosmos_to_eth( Ok(tx_id) => info!("Send to Eth txid {}", tx_id.txhash), Err(e) => { return Err(GravityError::UnrecoverableError(format!( - "Failed to send tokens! {:?}", - e + "Failed to send tokens! {e:?}" ))) } } diff --git a/orchestrator/gbt/src/client/deploy_erc20_representation.rs b/orchestrator/gbt/src/client/deploy_erc20_representation.rs index fe6f4af5d..26ed9f161 100644 --- a/orchestrator/gbt/src/client/deploy_erc20_representation.rs +++ b/orchestrator/gbt/src/client/deploy_erc20_representation.rs @@ -52,8 +52,7 @@ pub async fn deploy_erc20_representation( if let Ok(val) = res { let erc20 = val.into_inner().erc20; return Err(GravityError::UnrecoverableError(format!( - "Asset {} already has ERC20 representation {}", - denom, erc20 + "Asset {denom} already has ERC20 representation {erc20}" ))); } @@ -119,8 +118,7 @@ pub async fn deploy_erc20_representation( Ok(()) } Err(e) => Err(GravityError::UnrecoverableError(format!( - "Unable to make metadata request, check grpc {:?}", - e + "Unable to make metadata request, check grpc {e:?}" ))), } } diff --git a/orchestrator/gbt/src/client/eth_to_cosmos.rs b/orchestrator/gbt/src/client/eth_to_cosmos.rs index a0ba99a0f..6bd494e53 100644 --- a/orchestrator/gbt/src/client/eth_to_cosmos.rs +++ b/orchestrator/gbt/src/client/eth_to_cosmos.rs @@ -40,13 +40,11 @@ pub async fn eth_to_cosmos(args: EthToCosmosOpts, prefix: String) -> Result<(), if erc20_balance.is_zero() { return Err(GravityError::UnrecoverableError(format!( - "You have zero {} tokens, please double check your sender and erc20 addresses!", - erc20_address + "You have zero {erc20_address} tokens, please double check your sender and erc20 addresses!" ))); } else if amount > erc20_balance { return Err(GravityError::UnrecoverableError(format!( - "Insufficient balance {} > {}", - amount, erc20_balance + "Insufficient balance {amount} > {erc20_balance}" ))); } @@ -70,8 +68,7 @@ pub async fn eth_to_cosmos(args: EthToCosmosOpts, prefix: String) -> Result<(), Ok(tx_id) => info!("Send to Cosmos txid: {:#066x}", tx_id), Err(e) => { return Err(GravityError::UnrecoverableError(format!( - "Failed to send tokens! {:?}", - e + "Failed to send tokens! {e:?}" ))) } } diff --git a/orchestrator/gbt/src/config.rs b/orchestrator/gbt/src/config.rs index 3a2ead3cf..cd09ca37c 100644 --- a/orchestrator/gbt/src/config.rs +++ b/orchestrator/gbt/src/config.rs @@ -74,8 +74,7 @@ pub fn load_config(home_dir: &Path) -> Result Ok(v.into()), Err(e) => Err(GravityError::UnrecoverableError(format!( - "Invalid config! {:?}", - e + "Invalid config! {e:?}" ))), } } diff --git a/orchestrator/gbt/src/gov/proposals.rs b/orchestrator/gbt/src/gov/proposals.rs index 453762832..27507203f 100644 --- a/orchestrator/gbt/src/gov/proposals.rs +++ b/orchestrator/gbt/src/gov/proposals.rs @@ -40,24 +40,21 @@ pub async fn submit_ibc_metadata( Ok(r) => info!("Successfully submitted proposal with txid {}", r.txhash), Err(e) => { return Err(GravityError::UnrecoverableError(format!( - "Failed to submit proposal with {:?}", - e + "Failed to submit proposal with {e:?}" ))) } } } Err(e) => { return Err(GravityError::UnrecoverableError(format!( - "Failed to deserialize your proposal.json, check the contents! {:?}", - e + "Failed to deserialize your proposal.json, check the contents! {e:?}" ))) } } } Err(e) => { return Err(GravityError::UnrecoverableError(format!( - "Failed to read your proposal.json check the file path! {:?}", - e + "Failed to read your proposal.json check the file path! {e:?}" ))) } } @@ -89,24 +86,21 @@ pub async fn submit_airdrop(opts: AirdropProposalOpts, prefix: String) -> Result Ok(r) => info!("Successfully submitted proposal with txid {}", r.txhash), Err(e) => { return Err(GravityError::UnrecoverableError(format!( - "Failed to submit proposal with {:?}", - e + "Failed to submit proposal with {e:?}" ))) } } } Err(e) => { return Err(GravityError::UnrecoverableError(format!( - "Failed to deserialize your proposal.json, check the contents! {:?}", - e + "Failed to deserialize your proposal.json, check the contents! {e:?}" ))) } } } Err(e) => { return Err(GravityError::UnrecoverableError(format!( - "Failed to read your proposal.json check the file path! {:?}", - e + "Failed to read your proposal.json check the file path! {e:?}" ))) } } @@ -138,24 +132,21 @@ pub async fn submit_emergency_bridge_halt( Ok(r) => info!("Successfully submitted proposal with txid {}", r.txhash), Err(e) => { return Err(GravityError::UnrecoverableError(format!( - "Failed to submit proposal with {:?}", - e + "Failed to submit proposal with {e:?}" ))) } } } Err(e) => { return Err(GravityError::UnrecoverableError(format!( - "Failed to deserialize your proposal.json, check the contents! {:?}", - e + "Failed to deserialize your proposal.json, check the contents! {e:?}" ))) } } } Err(e) => { return Err(GravityError::UnrecoverableError(format!( - "Failed to read your proposal.json check the file path! {:?}", - e + "Failed to read your proposal.json check the file path! {e:?}" ))) } } @@ -188,24 +179,21 @@ pub async fn submit_oracle_unhalt( Ok(r) => info!("Successfully submitted proposal with txid {}", r.txhash), Err(e) => { return Err(GravityError::UnrecoverableError(format!( - "Failed to submit proposal with {:?}", - e + "Failed to submit proposal with {e:?}" ))) } } } Err(e) => { return Err(GravityError::UnrecoverableError(format!( - "Failed to deserialize your proposal.json, check the contents! {:?}", - e + "Failed to deserialize your proposal.json, check the contents! {e:?}" ))) } } } Err(e) => { return Err(GravityError::UnrecoverableError(format!( - "Failed to read your proposal.json check the file path! {:?}", - e + "Failed to read your proposal.json check the file path! {e:?}" ))) } } diff --git a/orchestrator/gbt/src/gov/queries.rs b/orchestrator/gbt/src/gov/queries.rs index b14e8761c..eed44c843 100644 --- a/orchestrator/gbt/src/gov/queries.rs +++ b/orchestrator/gbt/src/gov/queries.rs @@ -67,8 +67,7 @@ pub async fn query_airdrops(opts: AirdropQueryOpts, prefix: String) -> Result<() } Err(e) => { return Err(GravityError::UnrecoverableError(format!( - "Failed to get proposals, check your cosmos gRPC {:?}", - e + "Failed to get proposals, check your cosmos gRPC {e:?}" ))) } } diff --git a/orchestrator/gbt/src/keys/register_orchestrator_address.rs b/orchestrator/gbt/src/keys/register_orchestrator_address.rs index e2c3e2a18..e3a1ba283 100644 --- a/orchestrator/gbt/src/keys/register_orchestrator_address.rs +++ b/orchestrator/gbt/src/keys/register_orchestrator_address.rs @@ -42,7 +42,7 @@ pub async fn register_orchestrator_address( if let Err(e) = res { return Err(GravityError::UnrecoverableError( format!( - "Failed trying to register delegate addresses error {:?}, correct the error and try again", e + "Failed trying to register delegate addresses error {e:?}, correct the error and try again" ) )); } diff --git a/orchestrator/gravity_utils/src/connection_prep.rs b/orchestrator/gravity_utils/src/connection_prep.rs index 5a46fe41a..85b6b4fd2 100644 --- a/orchestrator/gravity_utils/src/connection_prep.rs +++ b/orchestrator/gravity_utils/src/connection_prep.rs @@ -63,8 +63,8 @@ pub async fn create_rpc_connections( let port = url.port().unwrap_or(80); // this should be http or https let prefix = url.scheme(); - let ipv6_url = format!("{}://::1:{}", prefix, port); - let ipv4_url = format!("{}://127.0.0.1:{}", prefix, port); + let ipv6_url = format!("{prefix}://::1:{port}"); + let ipv4_url = format!("{prefix}://127.0.0.1:{port}"); let ipv6 = GravityQueryClient::connect(ipv6_url.clone()).await; let ipv4 = GravityQueryClient::connect(ipv4_url.clone()).await; warn!("Trying fallback urls {} {}", ipv6_url, ipv4_url); @@ -87,8 +87,8 @@ pub async fn create_rpc_connections( panic!("Cosmos gRPC url contains no host? {}", grpc_url) }); // transparently upgrade to https if available, we can't transparently downgrade for obvious security reasons - let https_on_80_url = format!("https://{}:80", body); - let https_on_443_url = format!("https://{}:443", body); + let https_on_80_url = format!("https://{body}:80"); + let https_on_443_url = format!("https://{body}:443"); let https_on_80 = GravityQueryClient::connect(https_on_80_url.clone()).await; let https_on_443 = GravityQueryClient::connect(https_on_443_url.clone()).await; warn!( @@ -135,8 +135,8 @@ pub async fn create_rpc_connections( let port = url.port().unwrap_or(80); // this should be http or https let prefix = url.scheme(); - let ipv6_url = format!("{}://::1:{}", prefix, port); - let ipv4_url = format!("{}://127.0.0.1:{}", prefix, port); + let ipv6_url = format!("{prefix}://::1:{port}"); + let ipv4_url = format!("{prefix}://127.0.0.1:{port}"); let ipv6_web3 = Web3::new(&ipv6_url, timeout); let ipv4_web3 = Web3::new(&ipv4_url, timeout); let ipv6_test = ipv6_web3.eth_block_number().await; @@ -159,8 +159,8 @@ pub async fn create_rpc_connections( panic!("Ethereum rpc url contains no host? {}", eth_rpc_url) }); // transparently upgrade to https if available, we can't transparently downgrade for obvious security reasons - let https_on_80_url = format!("https://{}:80", body); - let https_on_443_url = format!("https://{}:443", body); + let https_on_80_url = format!("https://{body}:80"); + let https_on_443_url = format!("https://{body}:443"); let https_on_80_web3 = Web3::new(&https_on_80_url, timeout); let https_on_443_web3 = Web3::new(&https_on_443_url, timeout); let https_on_80_test = https_on_80_web3.eth_block_number().await; @@ -265,20 +265,18 @@ pub async fn check_delegate_addresses( Err(GravityError::UnrecoverableError(format!( "Your Gravity Delegate addresses are both incorrect! \n \ If you are getting this error you must have made at least two validators and mixed up the keys between them \n \ - You provided {} Correct Value {} \n \ - You provided {} Correct Value {}", - delegate_eth_address, req_delegate_eth_address, - delegate_orchestrator_address, req_delegate_orchestrator_address), + You provided {delegate_eth_address} Correct Value {req_delegate_eth_address} \n \ + You provided {delegate_orchestrator_address} Correct Value {req_delegate_orchestrator_address}"), )) } else if req_delegate_eth_address != delegate_eth_address { Err(GravityError::UnrecoverableError( format!("Your Delegate Ethereum address is incorrect! \n \ - You provided {} Correct Value {}", delegate_eth_address, req_delegate_eth_address) + You provided {delegate_eth_address} Correct Value {req_delegate_eth_address}") )) } else if req_delegate_orchestrator_address != delegate_orchestrator_address { Err(GravityError::UnrecoverableError( format!("Your Delegate Orchestrator address is incorrect! \n \ - You provided {} Correct Value {}", delegate_orchestrator_address, req_delegate_orchestrator_address), + You provided {delegate_orchestrator_address} Correct Value {req_delegate_orchestrator_address}"), )) } else if e.validator_address != o.validator_address { Err(GravityError::UnrecoverableError( @@ -290,12 +288,12 @@ pub async fn check_delegate_addresses( } (Err(e), Ok(_)) => { Err(GravityError::UnrecoverableError(format!( - "Your Gravity Orchestrator Ethereum key is incorrect, please double check you private key. If you can't locate the correct private key you will need to create a new validator {:?}", e + "Your Gravity Orchestrator Ethereum key is incorrect, please double check you private key. If you can't locate the correct private key you will need to create a new validator {e:?}" ))) } (Ok(_), Err(e)) => { Err(GravityError::UnrecoverableError(format!( - "Your Gravity Orchestrator Cosmos key is incorrect, please double check your phrase. If you can't locate the correct phrase you will need to create a new validator {:?}", e + "Your Gravity Orchestrator Cosmos key is incorrect, please double check your phrase. If you can't locate the correct phrase you will need to create a new validator {e:?}" ))) } (Err(_), Err(_)) => { @@ -317,7 +315,7 @@ pub async fn check_for_fee( if let Err(CosmosGrpcError::NoToken) = contact.get_account_info(address).await { return Err(GravityError::ValidationError( format!("Your Orchestrator address has no tokens of any kind. Even if you are paying zero fees this account needs to be 'initialized' by depositing tokens \n\ - Send the smallest possible unit of any token to {} to resolve this error", address), + Send the smallest possible unit of any token to {address} to resolve this error"), )); } return Ok(()); @@ -346,9 +344,9 @@ pub async fn check_for_eth(address: EthAddress, web3: &Web3) -> Result<(), Gravi let balance = get_eth_balances_with_retry(address, web3).await; if balance.is_zero() { Err(GravityError::ValidationError( - format!("You don't have any Ethereum! You will need to send some to {} for this program to work. Dust will do for basic operations, more info about average relaying costs will be presented as the program runs \n \ + format!("You don't have any Ethereum! You will need to send some to {address} for this program to work. Dust will do for basic operations, more info about average relaying costs will be presented as the program runs \n \ You can disable relaying by editing your config file in $HOME/.arcbnbbt/config \n\ - Even if you disable relaying you still need some dust so that the oracle can function", address), + Even if you disable relaying you still need some dust so that the oracle can function"), )) } else { Ok(()) diff --git a/orchestrator/gravity_utils/src/num_conversion.rs b/orchestrator/gravity_utils/src/num_conversion.rs index 0238ee1a4..8b270b38c 100644 --- a/orchestrator/gravity_utils/src/num_conversion.rs +++ b/orchestrator/gravity_utils/src/num_conversion.rs @@ -22,19 +22,19 @@ pub fn fraction_to_exponent(num: f64, exponent: u8) -> Uint256 { pub fn print_eth(input: Uint256) -> String { let float: f64 = input.to_string().parse().unwrap(); let res = float / ONE_ETH_FLOAT; - format!("{:.4}", res) + format!("{res:.4}") } pub fn print_nom(input: Uint256) -> String { let float: f64 = input.to_string().parse().unwrap(); let res = float / ONE_NOM_FLOAT; - format!("{:.4}", res) + format!("{res:.4}") } pub fn print_gwei(input: Uint256) -> String { let float: f64 = input.to_string().parse().unwrap(); let res = float / ONE_GWEI_FLOAT; - format!("{:}", res) + format!("{res:}") } #[test] diff --git a/orchestrator/gravity_utils/src/types/ethereum_events.rs b/orchestrator/gravity_utils/src/types/ethereum_events.rs index c5b6ed983..02302d17e 100644 --- a/orchestrator/gravity_utils/src/types/ethereum_events.rs +++ b/orchestrator/gravity_utils/src/types/ethereum_events.rs @@ -82,8 +82,7 @@ impl ValsetUpdatedEvent { let reward_token = EthAddress::from_slice(&reward_token_data[12..]); if let Err(e) = reward_token { return Err(GravityError::ValidationError(format!( - "Bad reward address, must be incorrect parsing {:?}", - e + "Bad reward address, must be incorrect parsing {e:?}", ))); } let reward_token = reward_token.unwrap(); diff --git a/orchestrator/orchestrator/src/ethereum_event_watcher.rs b/orchestrator/orchestrator/src/ethereum_event_watcher.rs index ef7aa5b2a..1f3de7669 100644 --- a/orchestrator/orchestrator/src/ethereum_event_watcher.rs +++ b/orchestrator/orchestrator/src/ethereum_event_watcher.rs @@ -50,9 +50,8 @@ pub async fn check_for_events( // do this even if `expected_delay` is zero, be extra paranoid if finalized_block.checked_add(expected_delay).unwrap() > unsafe_latest_block { return Err(GravityError::UnrecoverableError(format!( - "the finalized block number ({:?}) does not have the expected minimum delay \ - ({:?}) over the latest block number ({:?})", - finalized_block, expected_delay, unsafe_latest_block + "the finalized block number ({finalized_block:?}) does not have the expected minimum delay \ + ({expected_delay:?}) over the latest block number ({unsafe_latest_block:?})" ))); } diff --git a/orchestrator/proto_build/src/main.rs b/orchestrator/proto_build/src/main.rs index efb782d3d..80f2aedf0 100644 --- a/orchestrator/proto_build/src/main.rs +++ b/orchestrator/proto_build/src/main.rs @@ -142,7 +142,7 @@ fn copy_generated_files(from_dir: &Path, to_dir: &Path) { if !errors.is_empty() { for e in errors { - eprintln!("[error] Error while copying compiled file: {}", e); + eprintln!("[error] Error while copying compiled file: {e}"); } panic!("[error] Aborted."); @@ -153,7 +153,7 @@ fn copy_and_patch(src: impl AsRef, dest: impl AsRef) -> io::Result<( // Skip proto files belonging to `EXCLUDED_PROTO_PACKAGES` for package in EXCLUDED_PROTO_PACKAGES { if let Some(filename) = src.as_ref().file_name().and_then(OsStr::to_str) { - if filename.starts_with(&format!("{}.", package)) { + if filename.starts_with(&format!("{package}.")) { return Ok(()); } } diff --git a/orchestrator/test_runner/src/airdrop_proposal.rs b/orchestrator/test_runner/src/airdrop_proposal.rs index 80db82a35..43b4dd924 100644 --- a/orchestrator/test_runner/src/airdrop_proposal.rs +++ b/orchestrator/test_runner/src/airdrop_proposal.rs @@ -115,7 +115,7 @@ async fn submit_and_pass_airdrop_proposal( keys: &[ValidatorKeys], ) -> Result { let proposal_content = AirdropProposalJson { - title: format!("Proposal to perform {} airdrop", denom), + title: format!("Proposal to perform {denom} airdrop"), description: "Airdrop time!".to_string(), denom, amounts: amounts.to_vec(), @@ -166,7 +166,7 @@ async fn submit_and_fail_airdrop_proposal( } let proposal_content = AirdropProposalMsg { - title: format!("Proposal to perform {} airdrop", denom), + title: format!("Proposal to perform {denom} airdrop"), description: "Airdrop time!".to_string(), denom, amounts: amounts.to_vec(), diff --git a/orchestrator/test_runner/src/bootstrapping.rs b/orchestrator/test_runner/src/bootstrapping.rs index 92812b26f..bf9630b57 100644 --- a/orchestrator/test_runner/src/bootstrapping.rs +++ b/orchestrator/test_runner/src/bootstrapping.rs @@ -137,7 +137,7 @@ pub async fn deploy_contracts(contact: &Contact) { &format!("--eth-privkey={:#x}", *MINER_PRIVATE_KEY), &format!("--contract={}", paths[1]), "--test-mode=true", - &format!("--remote-mode={}", remote_mode), + &format!("--remote-mode={remote_mode}"), ]) .output() .expect("Failed to deploy contracts!") @@ -151,7 +151,7 @@ pub async fn deploy_contracts(contact: &Contact) { &format!("--eth-privkey={:#x}", *MINER_PRIVATE_KEY), &format!("--contract={}", C[1]), "--test-mode=true", - &format!("--remote-mode={}", remote_mode), + &format!("--remote-mode={remote_mode}"), ]) .current_dir(C[2]) .output() diff --git a/orchestrator/test_runner/src/deposit_overflow.rs b/orchestrator/test_runner/src/deposit_overflow.rs index 822dfd6f1..e40330085 100644 --- a/orchestrator/test_runner/src/deposit_overflow.rs +++ b/orchestrator/test_runner/src/deposit_overflow.rs @@ -177,8 +177,8 @@ pub async fn deposit_overflow_test( let dest2_bals = contact.get_balances(dest2).await.unwrap(); assert!( dest2_bals.is_empty(), - "dest2 should have no coins, but they have {:?}", - dest2_bals + "{}", + "dest2 should have no coins, but they have {dest2_bals:?}" ); info!("Successful send of Uint256 max value to cosmos user, unable to overflow the supply!"); } diff --git a/orchestrator/test_runner/src/happy_path.rs b/orchestrator/test_runner/src/happy_path.rs index 671c67c43..36897d2a5 100644 --- a/orchestrator/test_runner/src/happy_path.rs +++ b/orchestrator/test_runner/src/happy_path.rs @@ -354,7 +354,7 @@ pub async fn test_erc20_deposit_result( let mut grpc_client = grpc_client.clone(); let start_coin = contact - .get_balance(dest, format!("{}{}", GRAVITY_DENOM_PREFIX, erc20_address)) + .get_balance(dest, format!("{GRAVITY_DENOM_PREFIX}{erc20_address}")) .await .unwrap(); @@ -393,7 +393,7 @@ pub async fn test_erc20_deposit_result( match ( start_coin.clone(), contact - .get_balance(dest, format!("{}{}", GRAVITY_DENOM_PREFIX, erc20_address)) + .get_balance(dest, format!("{GRAVITY_DENOM_PREFIX}{erc20_address}")) .await .unwrap(), ) { @@ -531,7 +531,7 @@ async fn test_batch( let coin = contact .get_balance( dest_cosmos_address, - format!("{}{}", GRAVITY_DENOM_PREFIX, erc20_contract), + format!("{GRAVITY_DENOM_PREFIX}{erc20_contract}"), ) .await .unwrap() @@ -633,10 +633,7 @@ async fn submit_duplicate_erc20_send( keys: &[ValidatorKeys], ) { let start_coin = contact - .get_balance( - receiver, - format!("{}{}", GRAVITY_DENOM_PREFIX, erc20_address), - ) + .get_balance(receiver, format!("{GRAVITY_DENOM_PREFIX}{erc20_address}")) .await .unwrap() .unwrap(); @@ -675,10 +672,7 @@ async fn submit_duplicate_erc20_send( contact.wait_for_next_block(TOTAL_TIMEOUT).await.unwrap(); let end_coin = contact - .get_balance( - receiver, - format!("{}{}", GRAVITY_DENOM_PREFIX, erc20_address), - ) + .get_balance(receiver, format!("{GRAVITY_DENOM_PREFIX}{erc20_address}")) .await .unwrap() .unwrap(); diff --git a/orchestrator/test_runner/src/ibc_metadata.rs b/orchestrator/test_runner/src/ibc_metadata.rs index f8e75f100..e19895a95 100644 --- a/orchestrator/test_runner/src/ibc_metadata.rs +++ b/orchestrator/test_runner/src/ibc_metadata.rs @@ -133,7 +133,7 @@ async fn submit_and_pass_ibc_metadata_proposal( keys: &[ValidatorKeys], ) { let proposal_content = IbcMetadataProposal { - title: format!("Proposal to set metadata on {}", denom), + title: format!("Proposal to set metadata on {denom}"), description: "IBC METADATA!".to_string(), ibc_denom: denom, metadata: Some(metadata), @@ -159,7 +159,7 @@ async fn submit_and_fail_ibc_metadata_proposal( keys: &[ValidatorKeys], ) { let proposal_content = IbcMetadataProposal { - title: format!("Proposal to set metadata on {}", denom), + title: format!("Proposal to set metadata on {denom}"), description: "IBC METADATA!".to_string(), ibc_denom: denom, metadata: Some(metadata), diff --git a/orchestrator/test_runner/src/invalid_events.rs b/orchestrator/test_runner/src/invalid_events.rs index 9c88dd2d1..ad3cc2577 100644 --- a/orchestrator/test_runner/src/invalid_events.rs +++ b/orchestrator/test_runner/src/invalid_events.rs @@ -35,7 +35,7 @@ pub async fn invalid_events( grpc_client: GravityQueryClient, ) { let mut grpc_client = grpc_client; - let erc20_denom = format!("{}{}", GRAVITY_DENOM_PREFIX, erc20_address); + let erc20_denom = format!("{GRAVITY_DENOM_PREFIX}{erc20_address}"); // figure out how many of a given erc20 we already have on startup so that we can // keep track of incrementation. This makes it possible to run this test again without diff --git a/orchestrator/test_runner/src/pause_bridge.rs b/orchestrator/test_runner/src/pause_bridge.rs index 0661610b9..61656433d 100644 --- a/orchestrator/test_runner/src/pause_bridge.rs +++ b/orchestrator/test_runner/src/pause_bridge.rs @@ -113,7 +113,7 @@ pub async fn pause_bridge_test( let coin = contact .get_balance( user_keys.cosmos_address, - format!("{}{}", GRAVITY_DENOM_PREFIX, erc20_address), + format!("{GRAVITY_DENOM_PREFIX}{erc20_address}"), ) .await .unwrap() @@ -187,7 +187,7 @@ pub async fn pause_bridge_test( let res = contact .get_balance( user_keys.cosmos_address, - format!("{}{}", GRAVITY_DENOM_PREFIX, erc20_address), + format!("{GRAVITY_DENOM_PREFIX}{erc20_address}"), ) .await .unwrap() diff --git a/orchestrator/test_runner/src/relay_market.rs b/orchestrator/test_runner/src/relay_market.rs index 4c49bda31..4123507f3 100644 --- a/orchestrator/test_runner/src/relay_market.rs +++ b/orchestrator/test_runner/src/relay_market.rs @@ -97,8 +97,8 @@ async fn setup_batch_test( .await; assert!( weth_acquired.is_ok(), - "Unable to wrap eth via web30.wrap_eth() {:?}", - weth_acquired + "{}", + "Unable to wrap eth via web30.wrap_eth() {weth_acquired:?}" ); // Acquire 1,000 WETH worth of DAI (probably ~23,000 DAI) info!("Starting swap!"); @@ -131,8 +131,8 @@ async fn setup_batch_test( info!("Swap result is {:?}", token_acquired); assert!( token_acquired.is_ok(), - "Unable to give the miner 1000 WETH worth of {}", - erc20_contract + "{}", + "Unable to give the miner 1000 WETH worth of {erc20_contract}" ); // Generate an address to send funds @@ -179,7 +179,7 @@ async fn setup_batch_test( let cdai_held = contact .get_balance( dest_cosmos_address, - format!("{}{}", GRAVITY_DENOM_PREFIX, erc20_contract), + format!("{GRAVITY_DENOM_PREFIX}{erc20_contract}"), ) .await .unwrap() @@ -348,8 +348,7 @@ async fn test_good_batch( assert_eq!( dest_eth_bal, send_amount, - "destination eth balance {} != {}", - dest_eth_bal, send_amount, + "destination eth balance {dest_eth_bal} != {send_amount}", ); info!( @@ -405,8 +404,7 @@ async fn test_bad_batch( assert_ne!( dest_eth_bal, send_amount, - "destination eth balance {} == {}", - dest_eth_bal, send_amount, + "destination eth balance {dest_eth_bal} == {send_amount}", ); info!( diff --git a/orchestrator/test_runner/src/tx_cancel.rs b/orchestrator/test_runner/src/tx_cancel.rs index fbfd4b919..97a770f2b 100644 --- a/orchestrator/test_runner/src/tx_cancel.rs +++ b/orchestrator/test_runner/src/tx_cancel.rs @@ -44,7 +44,7 @@ pub async fn send_to_eth_and_cancel( ) .await; - let token_name = format!("{}{}", GRAVITY_DENOM_PREFIX, erc20_address); + let token_name = format!("{GRAVITY_DENOM_PREFIX}{erc20_address}"); let bridge_denom_fee = Coin { denom: token_name.clone(), diff --git a/orchestrator/test_runner/src/utils.rs b/orchestrator/test_runner/src/utils.rs index ca655df2e..348ca78c0 100644 --- a/orchestrator/test_runner/src/utils.rs +++ b/orchestrator/test_runner/src/utils.rs @@ -306,8 +306,8 @@ pub async fn start_orchestrators( .expect("Failed to get Gravity Bridge module parameters!"); // but that will execute all the orchestrators in our test in parallel - // by spwaning to tokio's future executor - let _ = tokio::spawn(async move { + // by spawning to tokio's future executor + drop(tokio::spawn(async move { let web30 = gravity_utils::web30::client::Web3::new(ETH_NODE.as_str(), OPERATION_TIMEOUT); @@ -330,7 +330,7 @@ pub async fn start_orchestrators( config, ) .await; - }); + })); // used to break out of the loop early to simulate one validator // not running an orchestrator count += 1; diff --git a/orchestrator/test_runner/src/valset_rewards.rs b/orchestrator/test_runner/src/valset_rewards.rs index 8c150692b..cbe9d1778 100644 --- a/orchestrator/test_runner/src/valset_rewards.rs +++ b/orchestrator/test_runner/src/valset_rewards.rs @@ -55,7 +55,7 @@ pub async fn valset_rewards_test( let gravity_address_param = ParamChange { subspace: "arcbnb".to_string(), key: "BridgeEthereumAddress".to_string(), - value: format!("\"{}\"", gravity_address), + value: format!("\"{gravity_address}\""), }; params_to_change.push(gravity_address_param); let json_value = serde_json::to_string(&valset_reward).unwrap().to_string();