Skip to content

Commit

Permalink
chore: revert #269 (#289)
Browse files Browse the repository at this point in the history
(cherry picked from commit 8b0eb68)

# Conflicts:
#	.changelog/v4.1.0-rc.0/features/269-stable-token-factory.md
#	.changelog/v4.1.0-rc.0/improvements/269-multiple-denom-fees.md
#	.github/mergify.yml
#	app/ante.go
#	app/app.go
#	app/upgrades/v4.1.0/store.go
#	interchaintest/genesis_test.go
#	interchaintest/go.mod
#	proto/stable/tokenfactory/v1/blacklisted.proto
#	proto/stable/tokenfactory/v1/blacklister.proto
#	proto/stable/tokenfactory/v1/genesis.proto
#	proto/stable/tokenfactory/v1/master_minter.proto
#	proto/stable/tokenfactory/v1/minter_controller.proto
#	proto/stable/tokenfactory/v1/minters.proto
#	proto/stable/tokenfactory/v1/minting_denom.proto
#	proto/stable/tokenfactory/v1/owner.proto
#	proto/stable/tokenfactory/v1/params.proto
#	proto/stable/tokenfactory/v1/paused.proto
#	proto/stable/tokenfactory/v1/pauser.proto
#	proto/stable/tokenfactory/v1/query.proto
#	proto/stable/tokenfactory/v1/tx.proto
#	testutil/keeper/stabletokenfactory.go
#	x/blockibc/blockibc.go
#	x/stabletokenfactory/client/cli/query.go
#	x/stabletokenfactory/client/cli/query_blacklisted.go
#	x/stabletokenfactory/client/cli/query_blacklister.go
#	x/stabletokenfactory/client/cli/query_master_minter.go
#	x/stabletokenfactory/client/cli/query_minter_controller.go
#	x/stabletokenfactory/client/cli/query_minters.go
#	x/stabletokenfactory/client/cli/query_minting_denom.go
#	x/stabletokenfactory/client/cli/query_owner.go
#	x/stabletokenfactory/client/cli/query_params.go
#	x/stabletokenfactory/client/cli/query_paused.go
#	x/stabletokenfactory/client/cli/query_pauser.go
#	x/stabletokenfactory/client/cli/tx.go
#	x/stabletokenfactory/client/cli/tx_accept_owner.go
#	x/stabletokenfactory/client/cli/tx_blacklist.go
#	x/stabletokenfactory/client/cli/tx_burn.go
#	x/stabletokenfactory/client/cli/tx_configure_minter.go
#	x/stabletokenfactory/client/cli/tx_configure_minter_controller.go
#	x/stabletokenfactory/client/cli/tx_mint.go
#	x/stabletokenfactory/client/cli/tx_pause.go
#	x/stabletokenfactory/client/cli/tx_remove_minter.go
#	x/stabletokenfactory/client/cli/tx_remove_minter_controller.go
#	x/stabletokenfactory/client/cli/tx_unblacklist.go
#	x/stabletokenfactory/client/cli/tx_unpause.go
#	x/stabletokenfactory/client/cli/tx_update_blacklister.go
#	x/stabletokenfactory/client/cli/tx_update_master_minter.go
#	x/stabletokenfactory/client/cli/tx_update_owner.go
#	x/stabletokenfactory/client/cli/tx_update_pauser.go
#	x/stabletokenfactory/genesis.go
#	x/stabletokenfactory/genesis_test.go
#	x/stabletokenfactory/keeper/blacklisted.go
#	x/stabletokenfactory/keeper/blacklisted_test.go
#	x/stabletokenfactory/keeper/blacklister.go
#	x/stabletokenfactory/keeper/blacklister_test.go
#	x/stabletokenfactory/keeper/grpc_query.go
#	x/stabletokenfactory/keeper/grpc_query_blacklisted.go
#	x/stabletokenfactory/keeper/grpc_query_blacklisted_test.go
#	x/stabletokenfactory/keeper/grpc_query_blacklister.go
#	x/stabletokenfactory/keeper/grpc_query_blacklister_test.go
#	x/stabletokenfactory/keeper/grpc_query_master_minter.go
#	x/stabletokenfactory/keeper/grpc_query_master_minter_test.go
#	x/stabletokenfactory/keeper/grpc_query_minter_controller.go
#	x/stabletokenfactory/keeper/grpc_query_minter_controller_test.go
#	x/stabletokenfactory/keeper/grpc_query_minters.go
#	x/stabletokenfactory/keeper/grpc_query_minters_test.go
#	x/stabletokenfactory/keeper/grpc_query_minting_denom.go
#	x/stabletokenfactory/keeper/grpc_query_minting_denom_test.go
#	x/stabletokenfactory/keeper/grpc_query_owner.go
#	x/stabletokenfactory/keeper/grpc_query_owner_test.go
#	x/stabletokenfactory/keeper/grpc_query_params.go
#	x/stabletokenfactory/keeper/grpc_query_params_test.go
#	x/stabletokenfactory/keeper/grpc_query_paused.go
#	x/stabletokenfactory/keeper/grpc_query_paused_test.go
#	x/stabletokenfactory/keeper/grpc_query_pauser.go
#	x/stabletokenfactory/keeper/grpc_query_pauser_test.go
#	x/stabletokenfactory/keeper/keeper.go
#	x/stabletokenfactory/keeper/master_minter.go
#	x/stabletokenfactory/keeper/master_minter_test.go
#	x/stabletokenfactory/keeper/minter_controller.go
#	x/stabletokenfactory/keeper/minter_controller_test.go
#	x/stabletokenfactory/keeper/minters.go
#	x/stabletokenfactory/keeper/minters_test.go
#	x/stabletokenfactory/keeper/minting_denom.go
#	x/stabletokenfactory/keeper/minting_denom_test.go
#	x/stabletokenfactory/keeper/msg_server.go
#	x/stabletokenfactory/keeper/msg_server_accept_owner.go
#	x/stabletokenfactory/keeper/msg_server_blacklist.go
#	x/stabletokenfactory/keeper/msg_server_burn.go
#	x/stabletokenfactory/keeper/msg_server_configure_minter.go
#	x/stabletokenfactory/keeper/msg_server_configure_minter_controller.go
#	x/stabletokenfactory/keeper/msg_server_mint.go
#	x/stabletokenfactory/keeper/msg_server_pause.go
#	x/stabletokenfactory/keeper/msg_server_remove_minter.go
#	x/stabletokenfactory/keeper/msg_server_remove_minter_controller.go
#	x/stabletokenfactory/keeper/msg_server_unblacklist.go
#	x/stabletokenfactory/keeper/msg_server_unpause.go
#	x/stabletokenfactory/keeper/msg_server_update_blacklister.go
#	x/stabletokenfactory/keeper/msg_server_update_master_minter.go
#	x/stabletokenfactory/keeper/msg_server_update_owner.go
#	x/stabletokenfactory/keeper/msg_server_update_pauser.go
#	x/stabletokenfactory/keeper/owner.go
#	x/stabletokenfactory/keeper/owner_test.go
#	x/stabletokenfactory/keeper/params.go
#	x/stabletokenfactory/keeper/params_test.go
#	x/stabletokenfactory/keeper/paused.go
#	x/stabletokenfactory/keeper/paused_test.go
#	x/stabletokenfactory/keeper/pauser.go
#	x/stabletokenfactory/keeper/pauser_test.go
#	x/stabletokenfactory/module.go
#	x/stabletokenfactory/module_simulation.go
#	x/stabletokenfactory/simulation/blacklist.go
#	x/stabletokenfactory/simulation/burn.go
#	x/stabletokenfactory/simulation/configure_minter.go
#	x/stabletokenfactory/simulation/configure_minter_controller.go
#	x/stabletokenfactory/simulation/mint.go
#	x/stabletokenfactory/simulation/pause.go
#	x/stabletokenfactory/simulation/remove_minter.go
#	x/stabletokenfactory/simulation/remove_minter_controller.go
#	x/stabletokenfactory/simulation/unblacklist.go
#	x/stabletokenfactory/simulation/unpause.go
#	x/stabletokenfactory/simulation/update_blacklister.go
#	x/stabletokenfactory/simulation/update_master_minter.go
#	x/stabletokenfactory/simulation/update_owner.go
#	x/stabletokenfactory/simulation/update_pauser.go
#	x/stabletokenfactory/types/blacklisted.pb.go
#	x/stabletokenfactory/types/blacklister.pb.go
#	x/stabletokenfactory/types/genesis.pb.go
#	x/stabletokenfactory/types/genesis_test.go
#	x/stabletokenfactory/types/master_minter.pb.go
#	x/stabletokenfactory/types/message_blacklist_test.go
#	x/stabletokenfactory/types/message_burn_test.go
#	x/stabletokenfactory/types/message_configure_minter_controller_test.go
#	x/stabletokenfactory/types/message_configure_minter_test.go
#	x/stabletokenfactory/types/message_mint_test.go
#	x/stabletokenfactory/types/message_pause_test.go
#	x/stabletokenfactory/types/message_remove_minter_controller_test.go
#	x/stabletokenfactory/types/message_remove_minter_test.go
#	x/stabletokenfactory/types/message_unblacklist_test.go
#	x/stabletokenfactory/types/message_unpause_test.go
#	x/stabletokenfactory/types/message_update_blacklister_test.go
#	x/stabletokenfactory/types/message_update_master_minter_test.go
#	x/stabletokenfactory/types/message_update_owner_test.go
#	x/stabletokenfactory/types/message_update_pauser_test.go
#	x/stabletokenfactory/types/minter_controller.pb.go
#	x/stabletokenfactory/types/minters.pb.go
#	x/stabletokenfactory/types/minting_denom.pb.go
#	x/stabletokenfactory/types/owner.pb.go
#	x/stabletokenfactory/types/params.pb.go
#	x/stabletokenfactory/types/paused.pb.go
#	x/stabletokenfactory/types/pauser.pb.go
#	x/stabletokenfactory/types/query.pb.go
#	x/stabletokenfactory/types/tx.pb.go
#	x/tariff/types/params.pb.go
  • Loading branch information
johnletey authored and mergify[bot] committed Nov 23, 2023
1 parent f2b238b commit 7243a8c
Show file tree
Hide file tree
Showing 47 changed files with 232 additions and 2,610 deletions.
11 changes: 11 additions & 0 deletions .github/mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,14 @@ pull_request_rules:
backport:
branches:
- release/v4.1.x
<<<<<<< HEAD
=======
- name: backport patches to v5.0.x branch
conditions:
- base=main
- label=backport/v5.0.x
actions:
backport:
branches:
- release/v5.0.x
>>>>>>> 8b0eb68 (chore: revert #269 (#289))
16 changes: 10 additions & 6 deletions app/ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,14 @@ import (
fiattokenfactory "github.com/circlefin/noble-fiattokenfactory/x/fiattokenfactory/keeper"
fiattokenfactorytypes "github.com/circlefin/noble-fiattokenfactory/x/fiattokenfactory/types"
"github.com/cosmos/cosmos-sdk/types/bech32"
<<<<<<< HEAD

Check failure on line 7 in app/ante.go

View workflow job for this annotation

GitHub Actions / simulation-tests

missing import path

Check failure on line 7 in app/ante.go

View workflow job for this annotation

GitHub Actions / unit-tests

missing import path
stabletokenfactorykeeper "github.com/noble-assets/noble/v4/x/stabletokenfactory/keeper"
tokenfactory "github.com/noble-assets/noble/v4/x/tokenfactory/keeper"
tokenfactorytypes "github.com/noble-assets/noble/v4/x/tokenfactory/types"
=======
tokenfactory "github.com/noble-assets/noble/v5/x/tokenfactory/keeper"
tokenfactorytypes "github.com/noble-assets/noble/v5/x/tokenfactory/types"
>>>>>>> 8b0eb68 (chore: revert #269 (#289))

sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
Expand All @@ -22,12 +27,11 @@ import (

type HandlerOptions struct {
ante.HandlerOptions
tokenFactoryKeeper *tokenfactory.Keeper
fiatTokenFactoryKeeper *fiattokenfactory.Keeper
stableTokenFactoryKeeper *stabletokenfactorykeeper.Keeper
IBCKeeper *ibckeeper.Keeper
GlobalFeeSubspace paramtypes.Subspace
StakingSubspace paramtypes.Subspace
tokenFactoryKeeper *tokenfactory.Keeper
fiatTokenFactoryKeeper *fiattokenfactory.Keeper
IBCKeeper *ibckeeper.Keeper
GlobalFeeSubspace paramtypes.Subspace
StakingSubspace paramtypes.Subspace
}

type IsPausedDecorator struct {
Expand Down
24 changes: 24 additions & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ import (
"github.com/cosmos/cosmos-sdk/x/staking"
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
<<<<<<< HEAD
v4m1p0 "github.com/noble-assets/noble/v4/app/upgrades/v4.1.0"
"github.com/noble-assets/noble/v4/cmd"
"github.com/noble-assets/noble/v4/docs"
Expand All @@ -104,6 +105,18 @@ import (
tokenfactorymodule "github.com/noble-assets/noble/v4/x/tokenfactory"
tokenfactorymodulekeeper "github.com/noble-assets/noble/v4/x/tokenfactory/keeper"
tokenfactorymoduletypes "github.com/noble-assets/noble/v4/x/tokenfactory/types"
=======
"github.com/noble-assets/noble/v5/cmd"
"github.com/noble-assets/noble/v5/docs"
"github.com/noble-assets/noble/v5/x/blockibc"
"github.com/noble-assets/noble/v5/x/globalfee"
tariff "github.com/noble-assets/noble/v5/x/tariff"
tariffkeeper "github.com/noble-assets/noble/v5/x/tariff/keeper"
tarifftypes "github.com/noble-assets/noble/v5/x/tariff/types"
tokenfactorymodule "github.com/noble-assets/noble/v5/x/tokenfactory"
tokenfactorymodulekeeper "github.com/noble-assets/noble/v5/x/tokenfactory/keeper"
tokenfactorymoduletypes "github.com/noble-assets/noble/v5/x/tokenfactory/types"
>>>>>>> 8b0eb68 (chore: revert #269 (#289))

cctp "github.com/circlefin/noble-cctp/x/cctp"
cctpkeeper "github.com/circlefin/noble-cctp/x/cctp/keeper"
Expand Down Expand Up @@ -263,8 +276,13 @@ func New(
authtypes.StoreKey, authz.ModuleName, banktypes.StoreKey, slashingtypes.StoreKey, distrtypes.StoreKey,
paramstypes.StoreKey, ibchost.StoreKey, upgradetypes.StoreKey, feegrant.StoreKey, evidencetypes.StoreKey,
ibctransfertypes.StoreKey, icahosttypes.StoreKey, capabilitytypes.StoreKey,
<<<<<<< HEAD
tokenfactorymoduletypes.StoreKey, fiattokenfactorymoduletypes.StoreKey,
packetforwardtypes.StoreKey, stakingtypes.StoreKey, cctptypes.StoreKey,
=======
tokenfactorymoduletypes.StoreKey, fiattokenfactorymoduletypes.StoreKey, packetforwardtypes.StoreKey, stakingtypes.StoreKey,
cctptypes.StoreKey,
>>>>>>> 8b0eb68 (chore: revert #269 (#289))
)
tkeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey)
memKeys := sdk.NewMemoryStoreKeys(capabilitytypes.MemStoreKey)
Expand Down Expand Up @@ -851,6 +869,7 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino
}

func (app *App) setupUpgradeHandlers() {
<<<<<<< HEAD
// v4.1.0 upgrade
app.UpgradeKeeper.SetUpgradeHandler(
v4m1p0.UpgradeName,
Expand All @@ -860,6 +879,8 @@ func (app *App) setupUpgradeHandlers() {
),
)

=======
>>>>>>> 8b0eb68 (chore: revert #269 (#289))
upgradeInfo, err := app.UpgradeKeeper.ReadUpgradeInfoFromDisk()
if err != nil {
panic(fmt.Errorf("failed to read upgrade info from disk: %w", err))
Expand All @@ -871,8 +892,11 @@ func (app *App) setupUpgradeHandlers() {
var storeLoader baseapp.StoreLoader

switch upgradeInfo.Name {
<<<<<<< HEAD
case v4m1p0.UpgradeName:
storeLoader = v4m1p0.CreateStoreLoader(upgradeInfo.Height)
=======
>>>>>>> 8b0eb68 (chore: revert #269 (#289))
}

if storeLoader != nil {
Expand Down
Empty file added app/upgrades/.gitkeep
Empty file.
2 changes: 1 addition & 1 deletion interchaintest/cctp_deposit_for_burn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func TestCCTP_DepositForBurn(t *testing.T) {
nf := 0

cf := interchaintest.NewBuiltinChainFactory(zaptest.NewLogger(t), []*interchaintest.ChainSpec{
nobleChainSpec(ctx, &gw, "grand-1", nv, nf, false, false, false, true, false, false),
nobleChainSpec(ctx, &gw, "grand-1", nv, nf, false, false, true, false),
})

chains, err := cf.Chains(t.Name())
Expand Down
2 changes: 1 addition & 1 deletion interchaintest/cctp_deposit_for_burn_with_caller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func TestCCTP_DepositForBurnWithCaller(t *testing.T) {
nf := 0

cf := interchaintest.NewBuiltinChainFactory(zaptest.NewLogger(t), []*interchaintest.ChainSpec{
nobleChainSpec(ctx, &gw, "grand-1", nv, nf, false, false, false, true, false, false),
nobleChainSpec(ctx, &gw, "grand-1", nv, nf, false, false, true, false),
})

chains, err := cf.Chains(t.Name())
Expand Down
2 changes: 1 addition & 1 deletion interchaintest/cctp_receive_message_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func TestCCTP_ReceiveMessage(t *testing.T) {
nf := 0

cf := interchaintest.NewBuiltinChainFactory(zaptest.NewLogger(t), []*interchaintest.ChainSpec{
nobleChainSpec(ctx, &gw, "noble-1", nv, nf, true, false, false, true, false, false),
nobleChainSpec(ctx, &gw, "noble-1", nv, nf, true, false, true, false),
})

chains, err := cf.Chains(t.Name())
Expand Down
2 changes: 1 addition & 1 deletion interchaintest/cctp_receive_message_with_caller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func TestCCTP_ReceiveMessageWithCaller(t *testing.T) {
nf := 0

cf := interchaintest.NewBuiltinChainFactory(zaptest.NewLogger(t), []*interchaintest.ChainSpec{
nobleChainSpec(ctx, &gw, "noble-1", nv, nf, true, false, false, true, false, false),
nobleChainSpec(ctx, &gw, "noble-1", nv, nf, true, false, true, false),
})

chains, err := cf.Chains(t.Name())
Expand Down
2 changes: 1 addition & 1 deletion interchaintest/cctp_replace_deposit_for_burn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func TestCCTP_ReplaceDepositForBurn(t *testing.T) {
nf := 0

cf := interchaintest.NewBuiltinChainFactory(zaptest.NewLogger(t), []*interchaintest.ChainSpec{
nobleChainSpec(ctx, &gw, "noble-1", nv, nf, true, false, false, true, false, false),
nobleChainSpec(ctx, &gw, "noble-1", nv, nf, true, false, true, false),
{
Name: "gaia",
Version: "v10.0.2",
Expand Down
8 changes: 4 additions & 4 deletions interchaintest/cctp_roles_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func TestCCTP_UpdateOwner(t *testing.T) {
nf := 0

cf := interchaintest.NewBuiltinChainFactory(zaptest.NewLogger(t), []*interchaintest.ChainSpec{
nobleChainSpec(ctx, &gw, "grand-1", nv, nf, false, false, false, false, false, false),
nobleChainSpec(ctx, &gw, "grand-1", nv, nf, false, false, false, false),
})

chains, err := cf.Chains(t.Name())
Expand Down Expand Up @@ -105,7 +105,7 @@ func TestCCTP_UpdateAttesterManager(t *testing.T) {
nf := 0

cf := interchaintest.NewBuiltinChainFactory(zaptest.NewLogger(t), []*interchaintest.ChainSpec{
nobleChainSpec(ctx, &gw, "grand-1", nv, nf, false, false, false, false, false, false),
nobleChainSpec(ctx, &gw, "grand-1", nv, nf, false, false, false, false),
})

chains, err := cf.Chains(t.Name())
Expand Down Expand Up @@ -167,7 +167,7 @@ func TestCCTP_UpdatePauser(t *testing.T) {
nf := 0

cf := interchaintest.NewBuiltinChainFactory(zaptest.NewLogger(t), []*interchaintest.ChainSpec{
nobleChainSpec(ctx, &gw, "grand-1", nv, nf, false, false, false, false, false, false),
nobleChainSpec(ctx, &gw, "grand-1", nv, nf, false, false, false, false),
})

chains, err := cf.Chains(t.Name())
Expand Down Expand Up @@ -229,7 +229,7 @@ func TestCCTP_UpdateTokenController(t *testing.T) {
nf := 0

cf := interchaintest.NewBuiltinChainFactory(zaptest.NewLogger(t), []*interchaintest.ChainSpec{
nobleChainSpec(ctx, &gw, "grand-1", nv, nf, false, false, false, false, false, false),
nobleChainSpec(ctx, &gw, "grand-1", nv, nf, false, false, false, false),
})

chains, err := cf.Chains(t.Name())
Expand Down
72 changes: 26 additions & 46 deletions interchaintest/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ import (

simappparams "github.com/cosmos/cosmos-sdk/simapp/params"
"github.com/cosmos/cosmos-sdk/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/icza/dyno"
<<<<<<< HEAD
tarifftypes "github.com/noble-assets/noble/v4/x/tariff/types"
tokenfactorytypes "github.com/noble-assets/noble/v4/x/tokenfactory/types"
=======
tokenfactorytypes "github.com/noble-assets/noble/v5/x/tokenfactory/types"
>>>>>>> 8b0eb68 (chore: revert #269 (#289))
"github.com/strangelove-ventures/interchaintest/v4"
"github.com/strangelove-ventures/interchaintest/v4/chain/cosmos"
"github.com/strangelove-ventures/interchaintest/v4/ibc"
Expand Down Expand Up @@ -75,29 +78,11 @@ var (
},
}

denomMetadataUsdlr = DenomMetadata{
Display: "usdlr",
Name: "usdlr",
Base: "uusdlr",
DenomUnits: []DenomUnit{
{
Denom: "uusdlr",
Aliases: []string{
"microusdlr",
},
Exponent: "0",
},
{
Denom: "usdlr",
Exponent: "6",
},
},
}

defaultShare = "0.8"
defaultDistributionEntityShare = "1.0"
defaultTransferBPSFee = sdk.OneInt()
defaultTransferMaxFee = sdk.NewInt(5_000_000)
defaultTransferBPSFee = "1"
defaultTransferMaxFee = "5000000"
defaultTransferFeeDenom = denomMetadataUsdc.Base

relayerImage = relayer.CustomDockerImage("ghcr.io/cosmos/relayer", "v2.4.2", rly.RlyDefaultUidGid)
)
Expand Down Expand Up @@ -387,7 +372,6 @@ type genesisWrapper struct {
chain *cosmos.CosmosChain
tfRoles NobleRoles
fiatTfRoles NobleRoles
stableTfRoles NobleRoles
paramAuthority ibc.Wallet
extraWallets ExtraWallets
}
Expand All @@ -397,8 +381,8 @@ func nobleChainSpec(
gw *genesisWrapper,
chainID string,
nv, nf int,
minSetupTf, minSetupFiatTf, minSetupStableTf bool,
minModifyTf, minModifyFiatTf, minModifyStableTf bool,
minSetupTf, minSetupFiatTf bool,
minModifyTf, minModifyFiatTf bool,
) *interchaintest.ChainSpec {
return &interchaintest.ChainSpec{
NumValidators: &nv,
Expand All @@ -417,13 +401,13 @@ func nobleChainSpec(
NoHostMount: false,
Images: nobleImageInfo,
EncodingConfig: NobleEncoding(),
PreGenesis: preGenesisAll(ctx, gw, minSetupTf, minSetupFiatTf, minSetupStableTf),
ModifyGenesis: modifyGenesisAll(gw, minModifyTf, minModifyFiatTf, minModifyStableTf),
PreGenesis: preGenesisAll(ctx, gw, minSetupTf, minSetupFiatTf),
ModifyGenesis: modifyGenesisAll(gw, minModifyTf, minModifyFiatTf),
},
}
}

func preGenesisAll(ctx context.Context, gw *genesisWrapper, minSetupTf, minSetupFiatTf, minSetupStableTf bool) func(ibc.ChainConfig) error {
func preGenesisAll(ctx context.Context, gw *genesisWrapper, minSetupTf, minSetupFiatTf bool) func(ibc.ChainConfig) error {
return func(cc ibc.ChainConfig) (err error) {
val := gw.chain.Validators[0]

Expand All @@ -447,7 +431,7 @@ func preGenesisAll(ctx context.Context, gw *genesisWrapper, minSetupTf, minSetup
}
}

func modifyGenesisAll(gw *genesisWrapper, minSetupTf, minSetupFiatTf, minSetupStableTf bool) func(cc ibc.ChainConfig, b []byte) ([]byte, error) {
func modifyGenesisAll(gw *genesisWrapper, minSetupTf, minSetupFiatTf bool) func(cc ibc.ChainConfig, b []byte) ([]byte, error) {
return func(cc ibc.ChainConfig, b []byte) ([]byte, error) {
g := make(map[string]interface{})

Expand Down Expand Up @@ -579,28 +563,18 @@ func modifyGenesisTariffDefaults(
genbz map[string]interface{},
distributionEntity string,
) error {
transferFees := []tarifftypes.TransferFee{
{
Bps: defaultTransferBPSFee,
Max: defaultTransferMaxFee,
Denom: denomMetadataUsdc.Base,
},
{
Bps: defaultTransferBPSFee,
Max: defaultTransferMaxFee,
Denom: denomMetadataUsdlr.Base,
},
}

return modifyGenesisTariff(genbz, defaultShare, distributionEntity, defaultDistributionEntityShare, transferFees)
return modifyGenesisTariff(genbz, defaultShare, distributionEntity,
defaultDistributionEntityShare, defaultTransferBPSFee, defaultTransferMaxFee, defaultTransferFeeDenom)
}

func modifyGenesisTariff(
genbz map[string]interface{},
share string,
distributionEntity string,
distributionEntityShare string,
transferFees []tarifftypes.TransferFee,
transferBPSFee string,
transferMaxFee string,
transferDenom string,
) error {
if err := dyno.Set(genbz, share, "app_state", "tariff", "params", "share"); err != nil {
return fmt.Errorf("failed to set params authority in genesis json: %w", err)
Expand All @@ -614,8 +588,14 @@ func modifyGenesisTariff(
if err := dyno.Set(genbz, distributionEntities, "app_state", "tariff", "params", "distribution_entities"); err != nil {
return fmt.Errorf("failed to set upgrade authority address in genesis json: %w", err)
}
if err := dyno.Set(genbz, transferFees, "app_state", "tariff", "params", "transfer_fees"); err != nil {
return fmt.Errorf("failed to set tariff transfer fees in genesis json: %w", err)
if err := dyno.Set(genbz, transferBPSFee, "app_state", "tariff", "params", "transfer_fee_bps"); err != nil {
return fmt.Errorf("failed to set params authority in genesis json: %w", err)
}
if err := dyno.Set(genbz, transferMaxFee, "app_state", "tariff", "params", "transfer_fee_max"); err != nil {
return fmt.Errorf("failed to set params authority in genesis json: %w", err)
}
if err := dyno.Set(genbz, transferDenom, "app_state", "tariff", "params", "transfer_fee_denom"); err != nil {
return fmt.Errorf("failed to set params authority in genesis json: %w", err)
}
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion interchaintest/globalfee_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func TestGlobalFee(t *testing.T) {
var gw genesisWrapper

cf := interchaintest.NewBuiltinChainFactory(zaptest.NewLogger(t), []*interchaintest.ChainSpec{
nobleChainSpec(ctx, &gw, "noble-1", 2, 0, false, true, false, false, true, false),
nobleChainSpec(ctx, &gw, "noble-1", 2, 0, false, true, false, true),
})

chains, err := cf.Chains(t.Name())
Expand Down
5 changes: 5 additions & 0 deletions interchaintest/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,13 @@ require (
github.com/ethereum/go-ethereum v1.12.2
github.com/gogo/protobuf v1.3.3
github.com/icza/dyno v0.0.0-20220812133438-f0b6f8a18845
<<<<<<< HEAD
github.com/strangelove-ventures/interchaintest/v4 v4.0.0-20231026153934-334934f17a68
github.com/noble-assets/noble/v4 v4.0.0
=======
github.com/noble-assets/noble/v5 v5.0.0
github.com/strangelove-ventures/interchaintest/v4 v4.0.0-20231026153934-334934f17a68
>>>>>>> 8b0eb68 (chore: revert #269 (#289))
github.com/strangelove-ventures/paramauthority v1.1.0
github.com/stretchr/testify v1.8.4
go.uber.org/zap v1.24.0
Expand Down
2 changes: 1 addition & 1 deletion interchaintest/ibc_bps_fee_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func TestICS20BPSFees(t *testing.T) {
nf := 0

cf := interchaintest.NewBuiltinChainFactory(zaptest.NewLogger(t), []*interchaintest.ChainSpec{
nobleChainSpec(ctx, &gw, "noble-1", nv, nf, false, false, false, true, false, false),
nobleChainSpec(ctx, &gw, "noble-1", nv, nf, false, false, true, false),
{
Name: "gaia",
Version: "v9.0.2",
Expand Down
2 changes: 1 addition & 1 deletion interchaintest/ibc_client_expire_substitute_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func TestClientSubstitution(t *testing.T) {
nf := 0

cf := interchaintest.NewBuiltinChainFactory(zaptest.NewLogger(t), []*interchaintest.ChainSpec{
nobleChainSpec(ctx, &gw, "noble-1", nv, nf, true, true, true, true, true, true),
nobleChainSpec(ctx, &gw, "noble-1", nv, nf, true, true, true, true),
{
Name: "gaia",
Version: "v10.0.2",
Expand Down
2 changes: 1 addition & 1 deletion interchaintest/noble_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func TestNobleChain(t *testing.T) {
var gw genesisWrapper

cf := interchaintest.NewBuiltinChainFactory(zaptest.NewLogger(t), []*interchaintest.ChainSpec{
nobleChainSpec(ctx, &gw, "noble-1", 2, 1, false, false, false, true, true, true),
nobleChainSpec(ctx, &gw, "noble-1", 2, 1, false, false, true, true),
})

chains, err := cf.Chains(t.Name())
Expand Down
Loading

0 comments on commit 7243a8c

Please sign in to comment.