module

package
v3.2.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 10, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

README

Tax2gas

Testcases

  • Normal tx success
  • Not supported tx will not be deducted tax amount
  • Special IBC tx will be bypass when gas usage is not exceeded
  • Forward tx should minus the amount to tx origin
  • Multiple forward works
  • Error forward tx should return the fund
  • Out of gas should return the tax and not consumed gas
  • Grant msg should work
  • Allow pay with multiple fees should work
  • Try to pay with non value token denom should fail
No Name Scenario Expect Result Covered by
1 Normal transaction should success User transfer or make some special transactions which send coins to different address Tax should be deducted with correct amount TestFeeTax
TestFeeTaxWasm
2 Not supported tx will not be deducted tax amount User transfer or make some special transactions that not in the tax list Tax shouldn't be deducted with correct amount TestFeeTaxNotSupport
3 Special IBC tx will be bypass when gas limit is not exceeded User make IBC transactions that happen both cases:
- Gas usage does not exceeded maxTotalBypassMinFeeMsgGasUsage
-Gas usage exceeded maxTotalBypassMinFeeMsgGasUsage
Bypass when gas limit not exceeded and deduct fee when exceed 🛑 Not figure out the way to make update client in e2e, should be test in testnet
4 Forward transaction should deduct the amount to tx origin User execute contract that will trigger an execute msg to another contract - User should be the tx origin of the execute msg
- Tax should be deducted with correct amount
TestFeeTaxForwardWasm
5 Multiple forward works Contracts will trigger another contracts multiple times - User should be the tx origin of the execute msg
- Tax should be deducted with correct amount
TestFeeTaxForwardWasm
6 Error forward tx should return the tax and not consumed gas User execute contract that will trigger an execute msg to another contract. The execute msg to another contract will be failed Tax and not consumed gas should be revert to user TestFeeTaxForwardWasm
7 Out of gas should return the tax and not consumed gas User make some transactions with limited gas amount that will lead to cause out of gas error Tax and not consumed gas should be revert to user 🛑 Not figure out the way to make out of gas error occur, should be test in testnet
8 Grant msg should work User grant multiple type of permissions to different transactions Grant permission msg will only can deduct one denom in ante handler and one denom in post hanlder TestFeeTaxGrant
9 Allow pay with multiple fees should work User make transaction with multiple coins as fee Fee can be paid by multiple denom, if one denom is not enough, then it will deduct other denom TestFeeTaxMultipleDenoms
10 Try to pay with non value token denom should fail User make transaction that use a different denom as fee That denom should be reject and the tx should only accept denom listed in params TestFeeTaxNotAcceptDenom

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitGenesis

func InitGenesis(ctx sdk.Context, keeper keeper.Keeper, data *types.GenesisState)

InitGenesis initializes default parameters and the keeper's address to pubkey map

Types

type AppModule

type AppModule struct {
	AppModuleBasic
	// contains filtered or unexported fields
}

func NewAppModule

func NewAppModule(cdc codec.Codec, tax2gasKeeper keeper.Keeper) AppModule

func (AppModule) BeginBlock

func (AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock)

BeginBlock performs TODO.

func (AppModule) ConsensusVersion

func (AppModule) ConsensusVersion() uint64

ConsensusVersion implements AppModule/ConsensusVersion.

func (AppModule) EndBlock

EndBlock performs TODO.

func (AppModule) ExportGenesis

func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage

ExportGenesis returns the exported genesis state as raw bytes for the tax2gas. module.

func (AppModule) InitGenesis

func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, gs json.RawMessage) []abci.ValidatorUpdate

InitGenesis performs genesis initialization for the tax2gas module. no validator updates.

func (AppModule) QuerierRoute

func (AppModule) QuerierRoute() string

QuerierRoute returns the tax2gas module's querier route name.

func (AppModule) RegisterInvariants

func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry)

func (AppModule) RegisterServices

func (am AppModule) RegisterServices(cfg module.Configurator)

type AppModuleBasic

type AppModuleBasic struct {
	// contains filtered or unexported fields
}

func (AppModuleBasic) DefaultGenesis

func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage

func (AppModuleBasic) GetQueryCmd

func (b AppModuleBasic) GetQueryCmd() *cobra.Command

func (AppModuleBasic) GetTxCmd

func (b AppModuleBasic) GetTxCmd() *cobra.Command

func (AppModuleBasic) Name

func (AppModuleBasic) Name() string

func (AppModuleBasic) RegisterGRPCGatewayRoutes

func (b AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux)

--------------------------------------- Interfaces.

func (AppModuleBasic) RegisterInterfaces

func (AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry)

RegisterInterfaces registers interfaces and implementations of the tax2gas module.

func (AppModuleBasic) RegisterLegacyAminoCodec

func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)

func (AppModuleBasic) ValidateGenesis

ValidateGenesis performs genesis state validation for the tax2gas module.

Directories

Path Synopsis
client
cli
DONTCOVER
DONTCOVER
Package types is a reverse proxy.
Package types is a reverse proxy.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL