Skip to content

Commit

Permalink
Revert "Require more gas compute for create denom instead of a cost (#14
Browse files Browse the repository at this point in the history
)"

This reverts commit a25effd.
  • Loading branch information
Reecepbcups committed Apr 4, 2023
1 parent a25effd commit c0502fc
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 77 deletions.
2 changes: 1 addition & 1 deletion proto/buf.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ deps:
- remote: buf.build
owner: cosmos
repository: cosmos-sdk
commit: 172f6ce4e9054eb4af8b96e8131da354
commit: 4e1072d2e34943e79c5699c02aad7066
- remote: buf.build
owner: cosmos
repository: gogo-proto
Expand Down
7 changes: 0 additions & 7 deletions proto/osmosis/tokenfactory/v1beta1/params.proto
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,4 @@ message Params {
(gogoproto.moretags) = "yaml:\"denom_creation_fee\"",
(gogoproto.nullable) = false
];
// if denom_creation_fee is an empty array, then this field is used to add more gas consumption
// to the base cost.
// https://github.com/CosmWasm/token-factory/issues/11
uint64 denom_creation_gas_consume = 2 [
(gogoproto.moretags) = "yaml:\"denom_creation_gas_consume\"",
(gogoproto.nullable) = true
];
}
3 changes: 1 addition & 2 deletions scripts/test_node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ from_scratch () {
update_test_genesis '.app_state["gov"]["deposit_params"]["min_deposit"]=[{"denom": "ujuno","amount": "1000000"}]'
update_test_genesis '.app_state["crisis"]["constant_fee"]={"denom": "ujuno","amount": "1000"}'

# removed fee, so it will be nil
update_test_genesis '.app_state["tokenfactory"]["params"]["denom_creation_fee"]=[]'
update_test_genesis '.app_state["tokenfactory"]["params"]["denom_creation_fee"]=[{"denom":"ujuno","amount":"100"}]'

update_test_genesis '.app_state["feeshare"]["params"]["allowed_denoms"]=["ujuno"]'

Expand Down
3 changes: 0 additions & 3 deletions x/tokenfactory/keeper/createdenom.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,6 @@ func (k Keeper) chargeForCreateDenom(ctx sdk.Context, creatorAddr string, _ stri
if err := k.communityPoolKeeper.FundCommunityPool(ctx, creationFee, accAddr); err != nil {
return err
}
} else {
gasIncrease := k.GetParams(ctx).DenomCreationGasConsume
ctx.GasMeter().ConsumeGas(gasIncrease, "consume denom creation gas")
}
return nil
}
1 change: 1 addition & 0 deletions x/tokenfactory/keeper/createdenom_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ func (suite *KeeperTestSuite) TestCreateDenom() {

suite.Require().NoError(err)
suite.Require().Equal(suite.TestAccs[0].String(), queryRes.AuthorityMetadata.Admin)

} else {
suite.Require().Error(err)
// Ensure we don't charge if we expect an error
Expand Down
3 changes: 1 addition & 2 deletions x/tokenfactory/types/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ func DefaultParams() Params {
return Params{
// this was from osmosis
// DenomCreationFee: sdk.NewCoins(sdk.NewInt64Coin(appparams.BaseCoinUnit, 10_000_000)), // 10 OSMO
DenomCreationFee: sdk.NewCoins(sdk.NewInt64Coin(sdk.DefaultBondDenom, 10_000_000)), // 10 OSMO
DenomCreationGasConsume: 2_000_000,
DenomCreationFee: sdk.NewCoins(sdk.NewInt64Coin(sdk.DefaultBondDenom, 10_000_000)), // 10 OSMO
}
}

Expand Down
83 changes: 21 additions & 62 deletions x/tokenfactory/types/params.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c0502fc

Please sign in to comment.