Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(hard-fork): Implement rollapp hard fork #1354

Merged
merged 76 commits into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from 75 commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
c658ec5
initial renames according to adr
mtsitrin Oct 22, 2024
777dc32
reverting states
mtsitrin Oct 22, 2024
b713df3
removed frozen notation. added revision number in rollapp object
mtsitrin Oct 22, 2024
c3a08a5
Merge branch 'main' into mtsitrin/937-rollapp-hard-fork-hub-side
mtsitrin Oct 27, 2024
4d7ca18
cleanup
mtsitrin Oct 27, 2024
fffe076
UT compiles
mtsitrin Oct 27, 2024
e61d2af
fixed state deletion on fraud
mtsitrin Oct 27, 2024
654b069
UT pass
mtsitrin Oct 27, 2024
6782578
fixed StateInfoByHeight UT
mtsitrin Oct 28, 2024
c4d25ac
chainId revision check moved back to create rollapp. as it mess up dy…
mtsitrin Oct 28, 2024
3e06f20
PR comments
mtsitrin Oct 30, 2024
411f4c5
fixed basic sequencer logic to unbond all
mtsitrin Oct 30, 2024
b08a106
feat(hard_fork): part2 (Delyayed ack callback) (#1355)
mtsitrin Oct 31, 2024
617fa63
feat(hard_fork): Lightclient rollback (#1363)
mtsitrin Oct 31, 2024
076136a
feat(hard_fork): DRS and stateUpdate (#1369)
mtsitrin Oct 31, 2024
fe49c1c
feat(hard_fork): rollapp fraud proposal (#1371)
mtsitrin Nov 3, 2024
209f91e
feat(hard_fork): revision start height (#1373)
mtsitrin Nov 3, 2024
8e943b8
cleanup
mtsitrin Nov 3, 2024
31d5d25
Merge branch 'main' into mtsitrin/937-rollapp-hard-fork-hub-side
mtsitrin Nov 3, 2024
9f298af
lightClient doesn't trigger hard fork
mtsitrin Nov 3, 2024
67ec46a
clearing consesnsus state in descending order
mtsitrin Nov 3, 2024
3fda55a
fix UT
mtsitrin Nov 3, 2024
612a673
fraud proposal validates genesis bridge completed
mtsitrin Nov 3, 2024
4078e39
validate revision in header.Header.Version.App
mtsitrin Nov 3, 2024
e57988a
linter
mtsitrin Nov 3, 2024
13a56a5
linter
mtsitrin Nov 3, 2024
e6122d1
feat(hard_fork): delayed ack should create commitment after rolling b…
mtsitrin Nov 3, 2024
ef4afb1
register proposal handler
mtsitrin Nov 4, 2024
d2f8152
updating next proposer on state infos
mtsitrin Nov 4, 2024
d5933ff
feat(hard_fork): update hard fork to support new `x/sequencer` update…
mtsitrin Nov 6, 2024
1ca02de
Merge branch 'main' into mtsitrin/937-rollapp-hard-fork-hub-side
mtsitrin Nov 6, 2024
99e00ac
linter
mtsitrin Nov 6, 2024
10186d4
UT fix
mtsitrin Nov 6, 2024
839b3f3
minor update to fraud proposal
mtsitrin Nov 6, 2024
5a25e6d
delete pendingPacketsByAddress on the delayedAck
mtsitrin Nov 6, 2024
3639156
fixed seqeucner heoght pruning
mtsitrin Nov 6, 2024
c656859
fraud proposal supports future heights
mtsitrin Nov 6, 2024
204de23
fork hook doesn't return error
mtsitrin Nov 6, 2024
e318180
rotation doesn't go through sentinel proposer
mtsitrin Nov 6, 2024
5ec9170
simplified k.UpdateRollappPacketWithStatus interface
mtsitrin Nov 6, 2024
7c40f53
minor
mtsitrin Nov 6, 2024
5a3f9b5
minor log
mtsitrin Nov 6, 2024
6fc604a
Merge branch 'main' into mtsitrin/937-rollapp-hard-fork-hub-side
mtsitrin Nov 7, 2024
6914afb
fixed lightclient when setting canonical channel
mtsitrin Nov 7, 2024
47be8d3
feat(migrations): renamed vulnerable rollapps to obsolete (#1436)
keruch Nov 8, 2024
4f5c5bd
Danwt/mtsitrin 937 rollapp hard fork hub side rewardee (#1441)
danwt Nov 8, 2024
c4b48a7
Danwt/fix upgrade conflicts (#1442)
danwt Nov 8, 2024
5c42bf8
fix frozen
danwt Nov 8, 2024
569ff8f
Merge branch 'main' into mtsitrin/937-rollapp-hard-fork-hub-side
mtsitrin Nov 9, 2024
94f52ec
refactored to use Finalaization queue by rollappId
mtsitrin Nov 9, 2024
40b3557
fixed pruning of finalization queue
mtsitrin Nov 10, 2024
29bd020
cleared unused expected methods
mtsitrin Nov 10, 2024
44eccc4
linter
mtsitrin Nov 10, 2024
f44f36c
more cleanup
mtsitrin Nov 10, 2024
9c43639
comments
mtsitrin Nov 10, 2024
e3570f5
fixed packet commitment and lightclient comments
mtsitrin Nov 10, 2024
9cbc795
return err on HardFork hooks
mtsitrin Nov 10, 2024
44b14e2
not forking on state update with obsolete DRS
mtsitrin Nov 10, 2024
7e51835
linter
mtsitrin Nov 10, 2024
9743b8b
Merge branch 'main' into mtsitrin/937-rollapp-hard-fork-hub-side
mtsitrin Nov 10, 2024
5f6c7f6
renamed fraudHeight
mtsitrin Nov 10, 2024
9a482ba
add error to kickProposer flow
mtsitrin Nov 10, 2024
c25d2bc
fixed UT
mtsitrin Nov 10, 2024
3a876f4
deleteBySender moved to DeletePacket
mtsitrin Nov 10, 2024
5f69b7f
fixed surprise linter
mtsitrin Nov 10, 2024
861a25d
Merge branch 'main' into mtsitrin/937-rollapp-hard-fork-hub-side
mtsitrin Nov 10, 2024
73636ee
DRY pruneSigners code
mtsitrin Nov 11, 2024
93a59c8
feat(sequencer): hardforking when rotating to sentinel (#1455)
mtsitrin Nov 12, 2024
5fceea4
Merge branch 'main' into mtsitrin/937-rollapp-hard-fork-hub-side
mtsitrin Nov 12, 2024
14a5e85
PR comments
mtsitrin Nov 12, 2024
9f8b3ce
AfterRecoveryFromHalt hook cleanup
mtsitrin Nov 12, 2024
d0fb6c8
fixed missing setConsensusMetadata. fixed kicked proposer unbond
mtsitrin Nov 13, 2024
4918834
fixed unbond store
mtsitrin Nov 13, 2024
b4547dd
func renames for clarity
mtsitrin Nov 13, 2024
7bad2d0
inc case of future height fork, allow finalized last state
mtsitrin Nov 13, 2024
6b75606
feat(lightclient): export hard fork keys to genesis (#1470)
zale144 Nov 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app/ante/reject_msgs.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package ante

import (
"errors"
"fmt"

errorsmod "cosmossdk.io/errors"
Expand Down Expand Up @@ -59,7 +60,7 @@ func (rmd RejectMessagesDecorator) AnteHandle(
next sdk.AnteHandler,
) (sdk.Context, error) {
if err := rmd.checkMsgs(ctx, tx.GetMsgs(), 0); err != nil {
return ctx, errorsmod.Wrapf(sdkerrors.ErrUnauthorized, err.Error())
return ctx, errors.Join(sdkerrors.ErrUnauthorized, err)
}
return next(ctx, tx, simulate)
}
Expand Down
2 changes: 1 addition & 1 deletion app/apptesting/delayedack.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func GenerateTestPacket(t *testing.T, sequence uint64) *channeltypes.Packet {
func GenerateRollappPackets(t *testing.T, rollappId string, num uint64) []commontypes.RollappPacket {
t.Helper()
var packets []commontypes.RollappPacket
for i := uint64(0); i < num; i++ {
for i := uint64(1); i <= num; i++ {
packets = append(packets, commontypes.RollappPacket{
RollappId: rollappId,
Packet: GenerateTestPacket(t, i),
Expand Down
4 changes: 2 additions & 2 deletions app/apptesting/test_suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func (s *KeeperTestHelper) CreateRollappByName(name string) {

s.FundForAliasRegistration(msgCreateRollapp)

msgServer := rollappkeeper.NewMsgServerImpl(*s.App.RollappKeeper)
msgServer := rollappkeeper.NewMsgServerImpl(s.App.RollappKeeper)
_, err := msgServer.CreateRollapp(s.Ctx, &msgCreateRollapp)
s.Require().NoError(err)
}
Expand Down Expand Up @@ -135,7 +135,7 @@ func (s *KeeperTestHelper) PostStateUpdateWithDRSVersion(ctx sdk.Context, rollap
BDs: bds,
Last: false,
}
msgServer := rollappkeeper.NewMsgServerImpl(*s.App.RollappKeeper)
msgServer := rollappkeeper.NewMsgServerImpl(s.App.RollappKeeper)
_, err = msgServer.UpdateState(ctx, &updateState)
return startHeight + numOfBlocks, err
}
Expand Down
17 changes: 8 additions & 9 deletions app/keepers/keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ import (
lightclientmoduletypes "github.com/dymensionxyz/dymension/v3/x/lightclient/types"
lockupkeeper "github.com/dymensionxyz/dymension/v3/x/lockup/keeper"
lockuptypes "github.com/dymensionxyz/dymension/v3/x/lockup/types"
rollappmodule "github.com/dymensionxyz/dymension/v3/x/rollapp"
"github.com/dymensionxyz/dymension/v3/x/rollapp/genesisbridge"
rollappmodulekeeper "github.com/dymensionxyz/dymension/v3/x/rollapp/keeper"
rollappmoduletypes "github.com/dymensionxyz/dymension/v3/x/rollapp/types"
Expand Down Expand Up @@ -348,17 +347,11 @@ func (a *AppKeepers) InitKeepers(
a.ScopedIBCKeeper,
)

a.DenomMetadataKeeper = denommetadatamodulekeeper.NewKeeper(
a.BankKeeper,
)

a.RollappKeeper = rollappmodulekeeper.NewKeeper(
appCodec,
a.keys[rollappmoduletypes.StoreKey],
a.GetSubspace(rollappmoduletypes.ModuleName),
a.AccountKeeper,
a.IBCKeeper.ChannelKeeper,
a.IBCKeeper.ClientKeeper,
nil,
a.BankKeeper,
a.TransferKeeper,
Expand Down Expand Up @@ -403,6 +396,11 @@ func (a *AppKeepers) InitKeepers(
a.RollappKeeper.SetSequencerKeeper(a.SequencerKeeper)
a.RollappKeeper.SetCanonicalClientKeeper(a.LightClientKeeper)

a.DenomMetadataKeeper = denommetadatamodulekeeper.NewKeeper(
a.BankKeeper,
a.RollappKeeper,
)

a.IncentivesKeeper = incentiveskeeper.NewKeeper(
a.keys[incentivestypes.StoreKey],
a.GetSubspace(incentivestypes.ModuleName),
Expand Down Expand Up @@ -484,6 +482,7 @@ func (a *AppKeepers) InitKeepers(
a.DelayedAckKeeper = *delayedackkeeper.NewKeeper(
appCodec,
a.keys[delayedacktypes.StoreKey],
a.keys[ibcexported.StoreKey],
a.GetSubspace(delayedacktypes.ModuleName),
a.RollappKeeper,
a.IBCKeeper.ChannelKeeper,
Expand All @@ -503,7 +502,6 @@ func (a *AppKeepers) InitKeepers(
AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(a.UpgradeKeeper)).
AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(a.IBCKeeper.ClientKeeper)).
AddRoute(streamermoduletypes.RouterKey, streamermodule.NewStreamerProposalHandler(a.StreamerKeeper)).
AddRoute(rollappmoduletypes.RouterKey, rollappmodule.NewRollappProposalHandler(a.RollappKeeper)).
AddRoute(denommetadatamoduletypes.RouterKey, denommetadatamodule.NewDenomMetadataProposalHandler(a.DenomMetadataKeeper)).
AddRoute(dymnstypes.RouterKey, dymnsmodule.NewDymNsProposalHandler(a.DymNSKeeper)).
AddRoute(evmtypes.RouterKey, evm.NewEvmProposalHandler(a.EvmKeeper))
Expand Down Expand Up @@ -628,11 +626,12 @@ func (a *AppKeepers) SetupHooks() {
a.RollappKeeper.SetHooks(rollappmoduletypes.NewMultiRollappHooks(
// insert rollapp hooks receivers here
a.SequencerKeeper.RollappHooks(),
a.delayedAckMiddleware,
a.DelayedAckKeeper,
a.StreamerKeeper.Hooks(),
a.DymNSKeeper.GetRollAppHooks(),
a.LightClientKeeper.RollappHooks(),
a.IROKeeper,
a.DenomMetadataKeeper.RollappHooks(),
))
}

Expand Down
2 changes: 0 additions & 2 deletions app/keepers/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ import (
lightclientmodule "github.com/dymensionxyz/dymension/v3/x/lightclient"
lightclientmoduletypes "github.com/dymensionxyz/dymension/v3/x/lightclient/types"
"github.com/dymensionxyz/dymension/v3/x/rollapp"
rollappmoduleclient "github.com/dymensionxyz/dymension/v3/x/rollapp/client"
rollappmoduletypes "github.com/dymensionxyz/dymension/v3/x/rollapp/types"
"github.com/dymensionxyz/dymension/v3/x/sequencer"
sequencertypes "github.com/dymensionxyz/dymension/v3/x/sequencer/types"
Expand Down Expand Up @@ -130,7 +129,6 @@ var ModuleBasics = module.NewBasicManager(
streamermoduleclient.TerminateStreamHandler,
streamermoduleclient.ReplaceStreamHandler,
streamermoduleclient.UpdateStreamHandler,
rollappmoduleclient.SubmitFraudHandler,
denommetadatamoduleclient.CreateDenomMetadataHandler,
denommetadatamoduleclient.UpdateDenomMetadataHandler,
dymnsmoduleclient.MigrateChainIdsProposalHandler,
Expand Down
3 changes: 2 additions & 1 deletion app/upgrades/v4/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,6 @@ func ConvertOldRollappToNew(oldRollapp rollapptypes.Rollapp) rollapptypes.Rollap
Owner: oldRollapp.Owner,
GenesisState: oldRollapp.GenesisState,
ChannelId: oldRollapp.ChannelId,
Frozen: oldRollapp.Frozen,
Metadata: &rollapptypes.RollappMetadata{ // Can be updated in runtime
Website: "",
Description: "",
Expand All @@ -336,6 +335,8 @@ func ConvertOldRollappToNew(oldRollapp rollapptypes.Rollapp) rollapptypes.Rollap
PreLaunchTime: nil, // We can just let it be zero. Existing rollapps are already launched.
LivenessEventHeight: 0, // Filled lazily in runtime
LastStateUpdateHeight: 0, // Filled lazily in runtime
RevisionNumber: 0,
RevisionStartHeight: 0,
}
}

Expand Down
5 changes: 5 additions & 0 deletions ibctesting/bridging_fee_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ func TestBridgingFeeTestSuite(t *testing.T) {
suite.Run(t, new(bridgingFeeSuite))
}

func (s *bridgingFeeSuite) SetupTest() {
s.utilSuite.SetupTest()
s.hubApp().LightClientKeeper.SetEnabled(false)
}

func (s *bridgingFeeSuite) TestNotRollappNoBridgingFee() {
// setup between cosmosChain and hubChain
path := s.newTransferPath(s.hubChain(), s.cosmosChain())
Expand Down
114 changes: 114 additions & 0 deletions ibctesting/delayed_ack_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ import (
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
"github.com/cosmos/ibc-go/v7/modules/apps/transfer/types"
clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types"
channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types"
ibcmerkle "github.com/cosmos/ibc-go/v7/modules/core/23-commitment/types"
host "github.com/cosmos/ibc-go/v7/modules/core/24-host"
ibctesting "github.com/cosmos/ibc-go/v7/testing"
"github.com/cosmos/ibc-go/v7/testing/simapp"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"
)

Expand All @@ -25,6 +30,8 @@ func TestDelayedAckTestSuite(t *testing.T) {

func (s *delayedAckSuite) SetupTest() {
s.utilSuite.SetupTest()
s.hubApp().LightClientKeeper.SetEnabled(false)

s.hubApp().BankKeeper.SetDenomMetaData(s.hubCtx(), banktypes.Metadata{
Base: sdk.DefaultBondDenom,
})
Expand Down Expand Up @@ -235,3 +242,110 @@ func (s *delayedAckSuite) TestHubToRollappTimeout() {
postFinalizeBalance := bankKeeper.GetBalance(s.hubCtx(), senderAccount, sdk.DefaultBondDenom)
s.Require().Equal(preSendBalance.Amount, postFinalizeBalance.Amount)
}

// TestHardFork tests the hard fork handling for outgoing packets from the hub to the rollapp.
// we assert the packets commitments are restored and the pending packets are ackable after the hard fork.
func (s *delayedAckSuite) TestHardFork_HubToRollapp() {
path := s.newTransferPath(s.hubChain(), s.rollappChain())
s.coordinator.Setup(path)

// Setup endpoints
var (
hubEndpoint = path.EndpointA
hubIBCKeeper = s.hubChain().App.GetIBCKeeper()
senderAccount = s.hubChain().SenderAccount.GetAddress()
receiverAccount = s.rollappChain().SenderAccount.GetAddress()

amount, _ = sdk.NewIntFromString("1000000000000000000") // 1DYM
coinToSendToB = sdk.NewCoin(sdk.DefaultBondDenom, amount)
timeoutHeight = clienttypes.Height{RevisionNumber: 1, RevisionHeight: 50}
)

// Create rollapp and update its initial state
s.createRollappWithFinishedGenesis(path.EndpointA.ChannelID)
s.setRollappLightClientID(s.rollappCtx().ChainID(), path.EndpointA.ClientID)
s.registerSequencer()
s.updateRollappState(uint64(s.rollappCtx().BlockHeight()))

// send from hubChain to rollappChain
balanceBefore := s.hubApp().BankKeeper.GetBalance(s.hubCtx(), senderAccount, sdk.DefaultBondDenom)
msg := types.NewMsgTransfer(hubEndpoint.ChannelConfig.PortID, hubEndpoint.ChannelID, coinToSendToB, senderAccount.String(), receiverAccount.String(), timeoutHeight, disabledTimeoutTimestamp, "")
res, err := s.hubChain().SendMsgs(msg)
s.Require().NoError(err)
packet, err := ibctesting.ParsePacketFromEvents(res.GetEvents())
s.Require().NoError(err)

// assert commitments are created
found := hubIBCKeeper.ChannelKeeper.HasPacketCommitment(s.hubCtx(), packet.GetSourcePort(), packet.GetSourceChannel(), packet.GetSequence())
s.Require().True(found)

// Update the client
err = hubEndpoint.UpdateClient()
s.Require().NoError(err)

err = path.RelayPacket(packet)
s.Require().NoError(err) // expecting error as no AcknowledgePacket expected to return

// progress the rollapp chain
s.coordinator.CommitNBlocks(s.rollappChain(), 110)

// Update the client
err = hubEndpoint.UpdateClient()
s.Require().NoError(err)

// write ack optimistically
err = path.EndpointA.AcknowledgePacket(packet, []byte{0x1})
s.Require().NoError(err)

// assert commitments are no longer available
found = hubIBCKeeper.ChannelKeeper.HasPacketCommitment(s.hubCtx(), packet.GetSourcePort(), packet.GetSourceChannel(), packet.GetSequence())
s.Require().False(found)

// timeout the packet, can't check for error (ErrNoOp). we assert the balance refund
err = path.EndpointA.TimeoutPacket(packet)
s.Require().NoError(err)
balanceAfter := s.hubApp().BankKeeper.GetBalance(s.hubCtx(), senderAccount, sdk.DefaultBondDenom)
s.Require().NotEqual(balanceBefore.String(), balanceAfter.String())

// hard fork
err = s.hubApp().DelayedAckKeeper.OnHardFork(s.hubCtx(), s.rollappCtx().ChainID(), 5)
s.Require().NoError(err)

// assert commitments are created again
found = hubIBCKeeper.ChannelKeeper.HasPacketCommitment(s.hubCtx(), packet.GetSourcePort(), packet.GetSourceChannel(), packet.GetSequence())
s.Require().True(found)

// Update the client
err = hubEndpoint.UpdateClient()
s.Require().NoError(err)

// timeout the packet. we expect for verification error
timeoutMsg := getTimeOutPacket(hubEndpoint, packet)
_, _, err = simapp.SignAndDeliver(
path.EndpointA.Chain.T,
path.EndpointA.Chain.TxConfig,
path.EndpointA.Chain.App.GetBaseApp(),
path.EndpointA.Chain.GetContext().BlockHeader(),
[]sdk.Msg{timeoutMsg},
path.EndpointA.Chain.ChainID,
[]uint64{path.EndpointA.Chain.SenderAccount.GetAccountNumber()},
[]uint64{path.EndpointA.Chain.SenderAccount.GetSequence()},
true, false, path.EndpointA.Chain.SenderPrivKey,
)
s.Require().ErrorIs(err, ibcmerkle.ErrInvalidProof)
}

func getTimeOutPacket(endpoint *ibctesting.Endpoint, packet channeltypes.Packet) *channeltypes.MsgTimeout {
packetKey := host.PacketReceiptKey(packet.GetDestPort(), packet.GetDestChannel(), packet.GetSequence())
counterparty := endpoint.Counterparty
proof, proofHeight := counterparty.QueryProof(packetKey)
nextSeqRecv, found := counterparty.Chain.App.GetIBCKeeper().ChannelKeeper.GetNextSequenceRecv(counterparty.Chain.GetContext(), counterparty.ChannelConfig.PortID, counterparty.ChannelID)
require.True(endpoint.Chain.T, found)

timeoutMsg := channeltypes.NewMsgTimeout(
packet, nextSeqRecv,
proof, proofHeight, endpoint.Chain.SenderAccount.GetAddress().String(),
)

return timeoutMsg
}
2 changes: 2 additions & 0 deletions ibctesting/eibc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ func TestEIBCTestSuite(t *testing.T) {

func (s *eibcSuite) SetupTest() {
s.utilSuite.SetupTest()
s.hubApp().LightClientKeeper.SetEnabled(false)

s.hubApp().BankKeeper.SetDenomMetaData(s.hubCtx(), banktypes.Metadata{
Base: sdk.DefaultBondDenom,
})
Expand Down
7 changes: 2 additions & 5 deletions ibctesting/genesis_bridge_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ func TestTransferGenesisTestSuite(t *testing.T) {

func (s *transferGenesisSuite) SetupTest() {
s.utilSuite.SetupTest()
s.hubApp().LightClientKeeper.SetEnabled(false)

path := s.newTransferPath(s.hubChain(), s.rollappChain())
s.coordinator.SetupConnections(path)
s.createRollapp(false, nil) // genesis protocol is not finished yet
Expand All @@ -45,11 +47,6 @@ func (s *transferGenesisSuite) SetupTest() {
iroFee := sdk.NewCoin(appparams.BaseDenom, s.hubApp().IROKeeper.GetParams(s.hubCtx()).CreationFee)
apptesting.FundAccount(s.hubApp(), s.hubCtx(), s.hubChain().SenderAccount.GetAddress(), sdk.NewCoins(iroFee))

// FIXME: remove?
// fund the iro module account for pool creation fee
poolFee := s.hubApp().GAMMKeeper.GetParams(s.hubCtx()).PoolCreationFee
apptesting.FundAccount(s.hubApp(), s.hubCtx(), sdk.MustAccAddressFromBech32(s.hubApp().IROKeeper.GetModuleAccountAddress()), poolFee)

// set the canonical client before creating channels
s.path = path
s.hubApp().LightClientKeeper.SetCanonicalClient(s.hubCtx(), rollappChainID(), s.path.EndpointA.ClientID)
Expand Down
Loading
Loading