Skip to content

Commit

Permalink
Remove hard code initial amount deposits of osmosis pool
Browse files Browse the repository at this point in the history
  • Loading branch information
tnv1 committed May 31, 2024
1 parent ace5b74 commit 35fada8
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion tests/interchaintest/ibc_transfer_customfee_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,10 @@ func TestFeeabsGaiaIBCTransferWithIBCFee(t *testing.T) {
require.Equal(t, amountToSend, osmosisUserBalance)

// Create pool Osmosis(stake)/uosmo on Osmosis, with 1:1 ratio
initAmount := amountToSend.Uint64() / 2
poolID, err := feeabsCli.CreatePool(osmosis, ctx, osmosisUser.KeyName(), cosmos.OsmosisPoolParams{
Weights: fmt.Sprintf("5%s,5%s", stakeOnOsmosis, osmosis.Config().Denom),
InitialDeposit: fmt.Sprintf("95000000%s,95000000%s", stakeOnOsmosis, osmosis.Config().Denom),
InitialDeposit: fmt.Sprintf("%d%s,%d%s", initAmount, stakeOnOsmosis, initAmount, osmosis.Config().Denom),
SwapFee: "0.01",
ExitFee: "0",
FutureGovernor: "",
Expand Down
3 changes: 2 additions & 1 deletion tests/interchaintest/packet_foward_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,10 @@ func TestPacketForwardMiddleware(t *testing.T) {
require.NoError(t, err)
require.Equal(t, amountToSend, osmosisUserBalance)

initAmount := amountToSend.Uint64() / 2
poolID, err := feeabsCli.CreatePool(osmosis, ctx, osmosisUser.KeyName(), cosmos.OsmosisPoolParams{
Weights: fmt.Sprintf("5%s,5%s", stakeOnOsmosis, uatomOnOsmosis),
InitialDeposit: fmt.Sprintf("95000000%s,950000000%s", stakeOnOsmosis, uatomOnOsmosis),
InitialDeposit: fmt.Sprintf("%d%s,%d%s", initAmount, stakeOnOsmosis, initAmount, uatomOnOsmosis),
SwapFee: "0.01",
ExitFee: "0",
FutureGovernor: "",
Expand Down
3 changes: 2 additions & 1 deletion tests/interchaintest/query_osmosis_twap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,10 @@ func TestQueryOsmosisTwap(t *testing.T) {
require.NoError(t, err)
require.Equal(t, amountToSend, osmosisUserBalance)

initAmount := amountToSend.Uint64() / 2
poolID, err := feeabsCli.CreatePool(osmosis, ctx, osmosisUser.KeyName(), cosmos.OsmosisPoolParams{
Weights: fmt.Sprintf("5%s,5%s", stakeOnOsmosis, osmosis.Config().Denom),
InitialDeposit: fmt.Sprintf("95000000%s,950000000%s", stakeOnOsmosis, osmosis.Config().Denom),
InitialDeposit: fmt.Sprintf("%d%s,%d%s", initAmount, stakeOnOsmosis, initAmount, osmosis.Config().Denom),
SwapFee: "0.01",
ExitFee: "0",
FutureGovernor: "",
Expand Down
4 changes: 1 addition & 3 deletions tests/interchaintest/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ var (
pathFeeabsOsmosis = "feeabs-osmosis"
pathOsmosisGaia = "osmosis-gaia"
genesisWalletAmount = math.NewInt(100_000_000_000)
amountToSend = math.NewInt(1_000_000)
amountToSend = math.NewInt(1_000_000_000)
)

// feeabsEncoding registers the feeabs specific module codecs so that the associated types and msgs
Expand Down Expand Up @@ -136,7 +136,6 @@ func modifyGenesisWhitelistTwapQueryOsmosis() func(ibc.ChainConfig, []byte) ([]b
if err := dyno.Append(g, whitelist, "app_state", "interchainquery", "params", "allow_queries"); err != nil {
return nil, fmt.Errorf("failed to set whitelist in genesis json: %w", err)
}
fmt.Println("Genesis file updated", g)
out, err := json.Marshal(g)
if err != nil {
return nil, fmt.Errorf("failed to marshal genesis bytes to json: %w", err)
Expand Down Expand Up @@ -170,7 +169,6 @@ func modifyGenesisShortProposals(
if err := dyno.Set(g, queryEpochTime, "app_state", "feeabs", "epochs", 1, "duration"); err != nil {
return nil, fmt.Errorf("failed to set query epoch time in genesis json: %w", err)
}
fmt.Println("Genesis file updated", g)
out, err := json.Marshal(g)
if err != nil {
return nil, fmt.Errorf("failed to marshal genesis bytes to json: %w", err)
Expand Down

0 comments on commit 35fada8

Please sign in to comment.