Skip to content

feat(x/photon): validate fee ante decorator #49

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

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
8b65111
exp: draft oh the photon module
tbruyelle Oct 1, 2024
9bce90f
burn msg
tbruyelle Oct 1, 2024
4584002
wip: MsgBurn implementation
tbruyelle Oct 2, 2024
d23aeb9
apply conversion
tbruyelle Oct 10, 2024
bfe0b5c
separate method for conversion rate
tbruyelle Oct 10, 2024
78dc06b
query conversion rate
tbruyelle Oct 10, 2024
bdae728
photon cli conversion-rate
tbruyelle Oct 10, 2024
f81fb27
photon tx cli burn
tbruyelle Oct 10, 2024
604e3df
rename file
tbruyelle Oct 10, 2024
2d0d772
remove x/params usage
tbruyelle Oct 10, 2024
86228e8
photon MsgUpdateParams
tbruyelle Oct 10, 2024
8b6ef34
setup tests with mocks
tbruyelle Oct 10, 2024
249b7bb
chore: add mockgen in devdeps
tbruyelle Oct 28, 2024
d142c79
test: add TestMsgServerUpdateParams
tbruyelle Oct 28, 2024
d0cb9b0
test: TestMsgServerBurn
tbruyelle Oct 28, 2024
8a6e583
TODO addressed
tbruyelle Oct 28, 2024
426dd55
fix photon max supply
tbruyelle Oct 28, 2024
63ad065
add TODO
tbruyelle Oct 28, 2024
be00193
chore: rename MsgBurn to MsgMintPhoton
tbruyelle Oct 29, 2024
0bd5deb
test: photon simulation
tbruyelle Oct 29, 2024
dfc1e03
fix lint
tbruyelle Nov 7, 2024
2de5cc2
feat(photon): add events for MintPhoton tx
tbruyelle Nov 7, 2024
b2e06d7
chore: improve start-localnet-ci target
tbruyelle Nov 7, 2024
148abcc
fix(photon): cli mint command
tbruyelle Nov 7, 2024
434edf6
test: add e2e test for minting photons
tbruyelle Nov 7, 2024
69532da
test: ConversionRate query
tbruyelle Nov 8, 2024
189ee74
add types.Denom const
tbruyelle Nov 8, 2024
9e328bd
move max supply into types pkg
tbruyelle Nov 8, 2024
3f2493b
test(e2e): photon param change proposal
tbruyelle Nov 8, 2024
22a813e
never return negative convert rate
tbruyelle Nov 8, 2024
aa16949
wip: photon fee decorator
tbruyelle Nov 14, 2024
69c34f6
test AnteDecorator
tbruyelle Nov 15, 2024
20de40d
improve spelling
tbruyelle Nov 18, 2024
445fb5a
dont validate fees for gentxs
tbruyelle Nov 18, 2024
cf46e18
fix and improve tests
tbruyelle Nov 18, 2024
b5f7adc
e2e tests working + uatone const
tbruyelle Nov 19, 2024
8d2e7a2
tests(e2e): address TODOs
tbruyelle Nov 20, 2024
fd3e9f5
feat(photon): ante handler allows 0 fee
tbruyelle Nov 20, 2024
1e48c2c
remove confusing NOTE
tbruyelle Nov 20, 2024
003910f
refac: allow any other fee if tx is excepted
tbruyelle Nov 21, 2024
fcb9b0d
introduce txFeeExceptions wildcard
tbruyelle Nov 21, 2024
41110e1
docs: improve comments
tbruyelle Nov 21, 2024
b1a3a1e
remove unused error definition
tbruyelle Nov 21, 2024
d3232b3
clarify comment
tbruyelle Nov 21, 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
18 changes: 13 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,13 @@ docker-build-hermes:

docker-build-all: docker-build-debug docker-build-hermes

.PHONY: docker-build-debug docker-build-hermes docker-build-all
mockgen_cmd=$(rundep) github.com/golang/mock/mockgen

mocks-gen:
$(mockgen_cmd) -source=x/gov/testutil/expected_keepers.go -package testutil -destination x/gov/testutil/expected_keepers_mocks.go
$(mockgen_cmd) -source=x/photon/types/expected_keepers.go -package testutil -destination x/photon/testutil/expected_keepers_mocks.go

.PHONY: docker-build-debug docker-build-hermes docker-build-all mocks-gen

###############################################################################
### Linting ###
Expand Down Expand Up @@ -258,14 +264,16 @@ update-swagger-docs: proto-swagger-gen

start-localnet-ci: build
rm -rf ~/.atomoned-liveness
./build/atomoned init liveness --chain-id liveness --home ~/.atomoned-liveness
./build/atomoned init liveness --default-denom uatone --chain-id liveness --home ~/.atomoned-liveness
./build/atomoned config chain-id liveness --home ~/.atomoned-liveness
./build/atomoned config keyring-backend test --home ~/.atomoned-liveness
./build/atomoned keys add val --home ~/.atomoned-liveness
./build/atomoned genesis add-genesis-account val 10000000000000000000000000stake --home ~/.atomoned-liveness --keyring-backend test
./build/atomoned genesis gentx val 1000000000stake --home ~/.atomoned-liveness --chain-id liveness
./build/atomoned genesis add-genesis-account val 1000000000000uatone --home ~/.atomoned-liveness --keyring-backend test
./build/atomoned keys add user --home ~/.atomoned-liveness
./build/atomoned genesis add-genesis-account user 1000000000uatone --home ~/.atomoned-liveness --keyring-backend test
./build/atomoned genesis gentx val 1000000000uatone --home ~/.atomoned-liveness --chain-id liveness
./build/atomoned genesis collect-gentxs --home ~/.atomoned-liveness
sed -i.bak'' 's/minimum-gas-prices = ""/minimum-gas-prices = "0uatone"/' ~/.atomoned-liveness/config/app.toml
sed -i.bak'' 's/minimum-gas-prices = ""/minimum-gas-prices = "0.001uatone,0.001uphoton"/' ~/.atomoned-liveness/config/app.toml
./build/atomoned start --home ~/.atomoned-liveness --x-crisis-skip-assert-invariants

.PHONY: start-localnet-ci
Expand Down
8 changes: 7 additions & 1 deletion ante/ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import (
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"

atomoneerrors "github.com/atomone-hub/atomone/types/errors"
photonante "github.com/atomone-hub/atomone/x/photon/ante"
photonkeeper "github.com/atomone-hub/atomone/x/photon/keeper"
)

// HandlerOptions extend the SDK's AnteHandler options by requiring the IBC
Expand All @@ -21,6 +23,7 @@ type HandlerOptions struct {
Codec codec.BinaryCodec
IBCkeeper *ibckeeper.Keeper
StakingKeeper *stakingkeeper.Keeper
PhotonKeeper *photonkeeper.Keeper
TxFeeChecker ante.TxFeeChecker
}

Expand All @@ -37,10 +40,12 @@ func NewAnteHandler(opts HandlerOptions) (sdk.AnteHandler, error) {
if opts.IBCkeeper == nil {
return nil, errorsmod.Wrap(atomoneerrors.ErrLogic, "IBC keeper is required for AnteHandler")
}

if opts.StakingKeeper == nil {
return nil, errorsmod.Wrap(atomoneerrors.ErrNotFound, "staking param store is required for AnteHandler")
}
if opts.PhotonKeeper == nil {
return nil, errorsmod.Wrap(atomoneerrors.ErrNotFound, "photon keeper is required for AnteHandler")
}

sigGasConsumer := opts.SigGasConsumer
if sigGasConsumer == nil {
Expand All @@ -54,6 +59,7 @@ func NewAnteHandler(opts HandlerOptions) (sdk.AnteHandler, error) {
ante.NewValidateMemoDecorator(opts.AccountKeeper),
ante.NewConsumeGasForTxSizeDecorator(opts.AccountKeeper),
NewGovVoteDecorator(opts.Codec, opts.StakingKeeper),
photonante.NewValidateFeeDecorator(opts.PhotonKeeper),
ante.NewDeductFeeDecorator(opts.AccountKeeper, opts.BankKeeper, opts.FeegrantKeeper, opts.TxFeeChecker),
ante.NewSetPubKeyDecorator(opts.AccountKeeper), // SetPubKeyDecorator must be called before all signature verification decorators
ante.NewValidateSigCountDecorator(opts.AccountKeeper),
Expand Down
1 change: 1 addition & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ func NewAtomOneApp(
Codec: appCodec,
IBCkeeper: app.IBCKeeper,
StakingKeeper: app.StakingKeeper,
PhotonKeeper: app.PhotonKeeper,
// If TxFeeChecker is nil the default ante TxFeeChecker is used
TxFeeChecker: nil,
},
Expand Down
12 changes: 12 additions & 0 deletions app/keepers/keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ import (
govtypes "github.com/atomone-hub/atomone/x/gov/types"
govv1 "github.com/atomone-hub/atomone/x/gov/types/v1"
govv1beta1 "github.com/atomone-hub/atomone/x/gov/types/v1beta1"
photonkeeper "github.com/atomone-hub/atomone/x/photon/keeper"
photontypes "github.com/atomone-hub/atomone/x/photon/types"
)

type AppKeepers struct {
Expand Down Expand Up @@ -90,6 +92,7 @@ type AppKeepers struct {
FeeGrantKeeper feegrantkeeper.Keeper
AuthzKeeper authzkeeper.Keeper
ConsensusParamsKeeper consensusparamkeeper.Keeper
PhotonKeeper *photonkeeper.Keeper

// Modules
ICAModule ica.AppModule
Expand Down Expand Up @@ -208,6 +211,15 @@ func NewAppKeeper(
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
)

appKeepers.PhotonKeeper = photonkeeper.NewKeeper(
appCodec,
appKeepers.keys[photontypes.StoreKey],
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
appKeepers.BankKeeper,
appKeepers.AccountKeeper,
appKeepers.StakingKeeper,
)

appKeepers.MintKeeper = mintkeeper.NewKeeper(
appCodec,
appKeepers.keys[minttypes.StoreKey],
Expand Down
2 changes: 2 additions & 0 deletions app/keepers/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"

govtypes "github.com/atomone-hub/atomone/x/gov/types"
photontypes "github.com/atomone-hub/atomone/x/photon/types"
)

func (appKeepers *AppKeepers) GenerateKeys() {
Expand All @@ -47,6 +48,7 @@ func (appKeepers *AppKeepers) GenerateKeys() {
feegrant.StoreKey,
authzkeeper.StoreKey,
consensusparamtypes.StoreKey,
photontypes.StoreKey,
)

// Define transient store keys
Expand Down
12 changes: 10 additions & 2 deletions app/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ import (
"github.com/atomone-hub/atomone/x/gov"
govclient "github.com/atomone-hub/atomone/x/gov/client"
govtypes "github.com/atomone-hub/atomone/x/gov/types"
"github.com/atomone-hub/atomone/x/photon"
photontypes "github.com/atomone-hub/atomone/x/photon/types"
)

var maccPerms = map[string][]string{
Expand All @@ -58,8 +60,8 @@ var maccPerms = map[string][]string{
stakingtypes.BondedPoolName: {authtypes.Burner, authtypes.Staking},
stakingtypes.NotBondedPoolName: {authtypes.Burner, authtypes.Staking},
govtypes.ModuleName: {authtypes.Burner},
// liquiditytypes.ModuleName: {authtypes.Minter, authtypes.Burner},
ibctransfertypes.ModuleName: {authtypes.Minter, authtypes.Burner},
ibctransfertypes.ModuleName: {authtypes.Minter, authtypes.Burner},
photontypes.ModuleName: {authtypes.Minter, authtypes.Burner},
}

// ModuleBasics defines the module BasicManager is in charge of setting up basic,
Expand All @@ -85,6 +87,7 @@ var ModuleBasics = module.NewBasicManager(
sdkparams.AppModuleBasic{},
crisis.AppModuleBasic{},
slashing.AppModuleBasic{},
photon.AppModuleBasic{},
feegrantmodule.AppModuleBasic{},
authzmodule.AppModuleBasic{},
ibc.AppModuleBasic{},
Expand Down Expand Up @@ -121,6 +124,7 @@ func appModules(
slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.GetSubspace(slashingtypes.ModuleName)),
distr.NewAppModule(appCodec, app.DistrKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.GetSubspace(distrtypes.ModuleName)),
staking.NewAppModule(appCodec, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(stakingtypes.ModuleName)),
photon.NewAppModule(appCodec, *app.PhotonKeeper, app.BankKeeper, app.AccountKeeper, app.StakingKeeper),
upgrade.NewAppModule(app.UpgradeKeeper),
evidence.NewAppModule(app.EvidenceKeeper),
feegrantmodule.NewAppModule(appCodec, app.AccountKeeper, app.BankKeeper, app.FeeGrantKeeper, app.interfaceRegistry),
Expand Down Expand Up @@ -150,6 +154,7 @@ func simulationModules(
gov.NewAppModule(appCodec, app.GovKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(govtypes.ModuleName)),
mint.NewAppModule(appCodec, app.MintKeeper, app.AccountKeeper, nil, app.GetSubspace(minttypes.ModuleName)),
staking.NewAppModule(appCodec, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(stakingtypes.ModuleName)),
photon.NewAppModule(appCodec, *app.PhotonKeeper, app.BankKeeper, app.AccountKeeper, app.StakingKeeper),
distr.NewAppModule(appCodec, app.DistrKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.GetSubspace(distrtypes.ModuleName)),
slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.GetSubspace(slashingtypes.ModuleName)),
sdkparams.NewAppModule(app.ParamsKeeper),
Expand Down Expand Up @@ -185,6 +190,7 @@ func orderBeginBlockers() []string {
stakingtypes.ModuleName,
authtypes.ModuleName,
banktypes.ModuleName,
photontypes.ModuleName,
govtypes.ModuleName,
crisistypes.ModuleName,
ibcexported.ModuleName,
Expand Down Expand Up @@ -218,6 +224,7 @@ func orderEndBlockers() []string {
capabilitytypes.ModuleName,
authtypes.ModuleName,
banktypes.ModuleName,
photontypes.ModuleName,
distrtypes.ModuleName,
slashingtypes.ModuleName,
minttypes.ModuleName,
Expand Down Expand Up @@ -248,6 +255,7 @@ func orderInitBlockers() []string {
distrtypes.ModuleName,
govtypes.ModuleName,
stakingtypes.ModuleName,
photontypes.ModuleName,
slashingtypes.ModuleName,
minttypes.ModuleName,
crisistypes.ModuleName,
Expand Down
20 changes: 20 additions & 0 deletions app/params/config.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package params

const (
BondDenom = "uatone"

Bech32PrefixAccAddr = "atone"
)

var (
// Bech32PrefixAccPub defines the Bech32 prefix of an account's public key.
Bech32PrefixAccPub = Bech32PrefixAccAddr + "pub"
// Bech32PrefixValAddr defines the Bech32 prefix of a validator's operator address.
Bech32PrefixValAddr = Bech32PrefixAccAddr + "valoper"
// Bech32PrefixValPub defines the Bech32 prefix of a validator's operator public key.
Bech32PrefixValPub = Bech32PrefixAccAddr + "valoperpub"
// Bech32PrefixConsAddr defines the Bech32 prefix of a consensus node address.
Bech32PrefixConsAddr = Bech32PrefixAccAddr + "valcons"
// Bech32PrefixConsPub defines the Bech32 prefix of a consensus node public key.
Bech32PrefixConsPub = Bech32PrefixAccAddr + "valconspub"
)
7 changes: 0 additions & 7 deletions app/params/params.go

This file was deleted.

3 changes: 2 additions & 1 deletion cmd/atomoned/cmd/bech32_convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (

"github.com/spf13/cobra"

appparams "github.com/atomone-hub/atomone/app/params"
addressutil "github.com/atomone-hub/atomone/pkg/address"
)

Expand Down Expand Up @@ -41,7 +42,7 @@ Example:
},
}

cmd.Flags().StringP(flagBech32Prefix, "p", "atone", "Bech32 Prefix to encode to")
cmd.Flags().StringP(flagBech32Prefix, "p", appparams.Bech32PrefixAccAddr, "Bech32 Prefix to encode to")

return cmd
}
Expand Down
23 changes: 4 additions & 19 deletions cmd/atomoned/cmd/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,14 @@ package cmd

import (
sdk "github.com/cosmos/cosmos-sdk/types"
)

const (
Bech32PrefixAccAddr = "atone"
)

var (
// Bech32PrefixAccPub defines the Bech32 prefix of an account's public key.
Bech32PrefixAccPub = Bech32PrefixAccAddr + "pub"
// Bech32PrefixValAddr defines the Bech32 prefix of a validator's operator address.
Bech32PrefixValAddr = Bech32PrefixAccAddr + "valoper"
// Bech32PrefixValPub defines the Bech32 prefix of a validator's operator public key.
Bech32PrefixValPub = Bech32PrefixAccAddr + "valoperpub"
// Bech32PrefixConsAddr defines the Bech32 prefix of a consensus node address.
Bech32PrefixConsAddr = Bech32PrefixAccAddr + "valcons"
// Bech32PrefixConsPub defines the Bech32 prefix of a consensus node public key.
Bech32PrefixConsPub = Bech32PrefixAccAddr + "valconspub"
appparams "github.com/atomone-hub/atomone/app/params"
)

func InitSDKConfig() {
cfg := sdk.GetConfig()
cfg.SetBech32PrefixForAccount(Bech32PrefixAccAddr, Bech32PrefixAccPub)
cfg.SetBech32PrefixForValidator(Bech32PrefixValAddr, Bech32PrefixValPub)
cfg.SetBech32PrefixForConsensusNode(Bech32PrefixConsAddr, Bech32PrefixConsPub)
cfg.SetBech32PrefixForAccount(appparams.Bech32PrefixAccAddr, appparams.Bech32PrefixAccPub)
cfg.SetBech32PrefixForValidator(appparams.Bech32PrefixValAddr, appparams.Bech32PrefixValPub)
cfg.SetBech32PrefixForConsensusNode(appparams.Bech32PrefixConsAddr, appparams.Bech32PrefixConsPub)
cfg.Seal()
}
1 change: 1 addition & 0 deletions contrib/devdeps/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module github.com/atomone-hub/atomone/contrib/devdeps
go 1.21

require (
github.com/golang/mock v1.6.0
github.com/golangci/golangci-lint v1.56.0
github.com/goreleaser/goreleaser v1.25.1
github.com/rakyll/statik v0.1.7
Expand Down
2 changes: 2 additions & 0 deletions contrib/devdeps/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,8 @@ github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt
github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4=
github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc=
github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
Expand Down
5 changes: 4 additions & 1 deletion contrib/devdeps/tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@
package devdeps

import (
// required for formatting, linting, pls.
// formatting
_ "mvdan.cc/gofumpt"

// linter
_ "github.com/golangci/golangci-lint/cmd/golangci-lint"

// mocks
_ "github.com/golang/mock/mockgen"

// for releases
_ "github.com/goreleaser/goreleaser"

Expand Down
13 changes: 13 additions & 0 deletions proto/atomone/photon/v1/genesis.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
syntax = "proto3";
package atomone.photon.v1;

import "gogoproto/gogo.proto";
import "atomone/photon/v1/photon.proto";
import "amino/amino.proto";

option go_package = "github.com/atomone-hub/atomone/x/photon/types";

// GenesisState defines the x/photon module's genesis state.
message GenesisState {
Params params = 1 [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ];
}
17 changes: 17 additions & 0 deletions proto/atomone/photon/v1/photon.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
syntax = "proto3";
package atomone.photon.v1;

import "gogoproto/gogo.proto";

option go_package = "github.com/atomone-hub/atomone/x/photon/types";

// Params defines the parameters for the x/photon module.
message Params {
// Allow to mint photon or not
bool mint_disabled = 1;
// tx_fee_exceptions holds the msg type urls that are allowed to use some
// different tx fee coins than photon.
// A wildcard "*" can be used to indicate that all transactions are fee
// excepted.
repeated string tx_fee_exceptions = 2;
}
42 changes: 42 additions & 0 deletions proto/atomone/photon/v1/query.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
syntax = "proto3";
package atomone.photon.v1;

import "gogoproto/gogo.proto";
import "google/api/annotations.proto";
import "cosmos/base/query/v1beta1/pagination.proto";
import "atomone/photon/v1/photon.proto";
import "cosmos/base/v1beta1/coin.proto";
import "amino/amino.proto";
import "cosmos_proto/cosmos.proto";

option go_package = "github.com/atomone-hub/atomone/x/photon/types";

// Query defines the gRPC querier service.
service Query {
// Parameters queries the parameters of the module.
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
option (google.api.http).get = "/atomone/photon/v1/params";
}
// ConversionRate queries the photon's conversion rate
rpc ConversionRate(QueryConversionRateRequest) returns (QueryConversionRateResponse) {
option (google.api.http).get = "/atomone/photon/v1/conversion_rate";
}
}

// QueryParamsRequest is request type for the Query/Params RPC method.
message QueryParamsRequest {}

// QueryParamsResponse is response type for the Query/Params RPC method.
message QueryParamsResponse {
// params holds all the parameters of this module.
Params params = 1 [ (gogoproto.nullable) = false ];
}

// QueryConversionRateRequest is request type for the Query/ConversionRate RPC method.
message QueryConversionRateRequest {}

// QueryConversionRateResponse is response type for the Query/ConversionRate RPC method.
message QueryConversionRateResponse {
// conversion_rate represents the factor used to convert atone to photon.
string conversion_rate = 1 [ (cosmos_proto.scalar) = "cosmos.Dec" ];
}
Loading
Loading