-
Notifications
You must be signed in to change notification settings - Fork 21
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
tbruyelle
wants to merge
44
commits into
atomone-hub:main
from
tbruyelle:tbruyelle/feat/photon-tx-fee-checker
Closed
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 9bce90f
burn msg
tbruyelle 4584002
wip: MsgBurn implementation
tbruyelle d23aeb9
apply conversion
tbruyelle bfe0b5c
separate method for conversion rate
tbruyelle 78dc06b
query conversion rate
tbruyelle bdae728
photon cli conversion-rate
tbruyelle f81fb27
photon tx cli burn
tbruyelle 604e3df
rename file
tbruyelle 2d0d772
remove x/params usage
tbruyelle 86228e8
photon MsgUpdateParams
tbruyelle 8b6ef34
setup tests with mocks
tbruyelle 249b7bb
chore: add mockgen in devdeps
tbruyelle d142c79
test: add TestMsgServerUpdateParams
tbruyelle d0cb9b0
test: TestMsgServerBurn
tbruyelle 8a6e583
TODO addressed
tbruyelle 426dd55
fix photon max supply
tbruyelle 63ad065
add TODO
tbruyelle be00193
chore: rename MsgBurn to MsgMintPhoton
tbruyelle 0bd5deb
test: photon simulation
tbruyelle dfc1e03
fix lint
tbruyelle 2de5cc2
feat(photon): add events for MintPhoton tx
tbruyelle b2e06d7
chore: improve start-localnet-ci target
tbruyelle 148abcc
fix(photon): cli mint command
tbruyelle 434edf6
test: add e2e test for minting photons
tbruyelle 69532da
test: ConversionRate query
tbruyelle 189ee74
add types.Denom const
tbruyelle 9e328bd
move max supply into types pkg
tbruyelle 3f2493b
test(e2e): photon param change proposal
tbruyelle 22a813e
never return negative convert rate
tbruyelle aa16949
wip: photon fee decorator
tbruyelle 69c34f6
test AnteDecorator
tbruyelle 20de40d
improve spelling
tbruyelle 445fb5a
dont validate fees for gentxs
tbruyelle cf46e18
fix and improve tests
tbruyelle b5f7adc
e2e tests working + uatone const
tbruyelle 8d2e7a2
tests(e2e): address TODOs
tbruyelle fd3e9f5
feat(photon): ante handler allows 0 fee
tbruyelle 1e48c2c
remove confusing NOTE
tbruyelle 003910f
refac: allow any other fee if tx is excepted
tbruyelle fcb9b0d
introduce txFeeExceptions wildcard
tbruyelle 41110e1
docs: improve comments
tbruyelle b1a3a1e
remove unused error definition
tbruyelle d3232b3
clarify comment
tbruyelle File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
|
||
) |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ]; | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" ]; | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.