Documentation
¶
Index ¶
- Constants
- Variables
- func AddTestAddrs(app *DSC, ctx sdk.Context, accNum int, accAmt sdk.Coins) []sdk.AccAddress
- func AddTestAddrsIncremental(app *DSC, ctx sdk.Context, accNum int, accAmt sdk.Coins) []sdk.AccAddress
- func ConsumeMultisignatureVerificationGas(meter sdk.GasMeter, sig *signing.MultiSignatureData, pubkey multisig.PubKey, ...) error
- func ConvertAddrsToValAddrs(addrs []sdk.AccAddress) []sdk.ValAddress
- func CreateAddr() sdk.AccAddress
- func GenesisStateWithValSet(codec codec.Codec, genesisState map[string]json.RawMessage, ...) (map[string]json.RawMessage, error)
- func GetAddrs(dsc *DSC, ctx sdk.Context, number int) []sdk.AccAddress
- func GetMaccPerms() map[string][]string
- func ObservabilityViews() (views []*view.View)
- func RegisterSwaggerAPI(_ client.Context, rtr *mux.Router)
- func SigVerificationGasConsumer(meter sdk.GasMeter, sig signing.SignatureV2, params authtypes.Params) error
- func TestAddr(addr string, bech string) (sdk.AccAddress, error)
- type DSC
- func NewDSC(logger tmlog.Logger, db tmdb.DB, traceStore io.Writer, loadLatest bool, ...) *DSC
- func Setup(t *testing.T, isCheckTx bool, feemarketGenesis *feemarkettypes.GenesisState) *DSC
- func SetupWithGenesisAccounts(t *testing.T, feemarketGenesis *feemarkettypes.GenesisState, ...) *DSC
- func SetupWithGenesisValSet(t *testing.T, valSet *tmtypes.ValidatorSet, ...) *DSC
- func (app *DSC) AppCodec() codec.Codec
- func (app *DSC) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock
- func (app *DSC) BlockedAddrs() map[string]bool
- func (app *DSC) DeliverTx(req abci.RequestDeliverTx) (res abci.ResponseDeliverTx)
- func (app *DSC) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock
- func (app *DSC) ExportAppStateAndValidators(forZeroHeight bool, jailAllowedAddrs []string) (servertypes.ExportedApp, error)
- func (app *DSC) GetBaseApp() *baseapp.BaseApp
- func (app *DSC) GetIBCKeeper() *ibckeeper.Keeper
- func (app *DSC) GetKey(storeKey string) *store.KVStoreKey
- func (app *DSC) GetMemKey(storeKey string) *store.MemoryStoreKey
- func (app *DSC) GetScopedIBCKeeper() capabilitykeeper.ScopedKeeper
- func (app *DSC) GetStakingKeeper() validatorkeeper.Keeper
- func (app *DSC) GetSubspace(moduleName string) paramstypes.Subspace
- func (app *DSC) GetTKey(storeKey string) *store.TransientStoreKey
- func (app *DSC) GetTxConfig() client.TxConfig
- func (app *DSC) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain
- func (app *DSC) InterfaceRegistry() types.InterfaceRegistry
- func (app *DSC) LegacyAmino() *codec.LegacyAmino
- func (app *DSC) LoadHeight(height int64) error
- func (app *DSC) ModuleAccountAddrs() map[string]bool
- func (app *DSC) Name() string
- func (app *DSC) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig)
- func (app *DSC) RegisterTendermintService(clientCtx client.Context)
- func (app *DSC) RegisterTxService(clientCtx client.Context)
- func (app *DSC) SimulationManager() *module.SimulationManager
- type GenerateAccountStrategy
- type GenesisState
- type UpgradeCreator
Constants ¶
const (
UpgraderAddress = "d01y7sex8yvrazyd8pljjxvnvpndaavn99tk2j52y"
)
TODO: Move to some other place and use address with known private key!
Variables ¶
var ( // MainnetChainIDPrefix defines the EVM EIP155 chain ID prefix for Decimal mainnet. MainnetChainIDPrefix = fmt.Sprintf("%s_%d", cmdcfg.AppName, cmdcfg.MainnetChainID) // TestnetChainIDPrefix defines the EVM EIP155 chain ID prefix for Decimal testnet. TestnetChainIDPrefix = fmt.Sprintf("%s_%d", cmdcfg.AppName, cmdcfg.TestnetChainID) )
var ( // DefaultNodeHome defines default home directory for the application daemon. DefaultNodeHome = os.ExpandEnv(fmt.Sprintf("$HOME/.%s/daemon", cmdcfg.AppName)) )
var DummyUpgradeHandlerCreator = func(app *DSC, mm *module.Manager, configurator module.Configurator) upgradetypes.UpgradeHandler { return func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { return mm.RunMigrations(ctx, configurator, fromVM) } }
var FixSendUpgradeHandlerCreator = func(app *DSC, mm *module.Manager, configurator module.Configurator) upgradetypes.UpgradeHandler { return func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { adrSender := sdk.MustAccAddressFromBech32("d01xzrwvvxddfttzlmkcn25wv56n2vf0ljs2uhlgt") adrReceiver := sdk.MustAccAddressFromBech32("d01nm52q526jjsexspzysqlzev6sqydle6nufxz4y") coins := app.BankKeeper.GetAllBalances(ctx, adrSender) app.BankKeeper.SendCoins(ctx, adrSender, adrReceiver, coins) return mm.RunMigrations(ctx, configurator, fromVM) } }
var ( // ModuleBasics defines the module BasicManager is in charge of setting up basic, // non-dependant module elements, such as codec registration and genesis verification. ModuleBasics = module.NewBasicManager( auth.AppModuleBasic{}, genutil.AppModuleBasic{}, bank.AppModuleBasic{}, capability.AppModuleBasic{}, gov.NewAppModuleBasic([]govclient.ProposalHandler{ paramsclient.ProposalHandler, distrclient.ProposalHandler, upgradeclient.LegacyProposalHandler, upgradeclient.LegacyCancelProposalHandler, ibcclientclient.UpdateClientProposalHandler, ibcclientclient.UpgradeProposalHandler, }), params.AppModuleBasic{}, crisis.AppModuleBasic{}, authzmodule.AppModuleBasic{}, feegrantmodule.AppModuleBasic{}, upgrade.AppModuleBasic{}, ibc.AppModuleBasic{}, evm.AppModuleBasic{}, coin.AppModuleBasic{}, legacy.AppModuleBasic{}, nft.AppModuleBasic{}, multisig.AppModuleBasic{}, swap.AppModuleBasic{}, fee.AppModuleBasic{}, validator.AppModuleBasic{}, ) )
var UpgradeList = []UpgradeCreator{ {"https://testnet-repo.decimalchain.com/6489301", FixSendUpgradeHandlerCreator}, }
UpgradeList is application upgrade table. Different for different environments
Functions ¶
func AddTestAddrs ¶
AddTestAddrs constructs and returns accNum amount of accounts with an initial balance of accAmt in random order
func AddTestAddrsIncremental ¶
func AddTestAddrsIncremental(app *DSC, ctx sdk.Context, accNum int, accAmt sdk.Coins) []sdk.AccAddress
AddTestAddrsIncremental constructs and returns accNum amount of accounts with an initial balance of accAmt in random order
func ConsumeMultisignatureVerificationGas ¶
func ConsumeMultisignatureVerificationGas( meter sdk.GasMeter, sig *signing.MultiSignatureData, pubkey multisig.PubKey, params authtypes.Params, accSeq uint64, ) error
ConsumeMultisignatureVerificationGas consumes gas from a GasMeter for verifying a multisig pubkey signature
func ConvertAddrsToValAddrs ¶
func ConvertAddrsToValAddrs(addrs []sdk.AccAddress) []sdk.ValAddress
ConvertAddrsToValAddrs converts the provided addresses to ValAddress.
func CreateAddr ¶
func CreateAddr() sdk.AccAddress
func GenesisStateWithValSet ¶ added in v0.0.8
func GenesisStateWithValSet(codec codec.Codec, genesisState map[string]json.RawMessage, valSet *tmtypes.ValidatorSet, genAccs []authtypes.GenesisAccount, balances ...banktypes.Balance, ) (map[string]json.RawMessage, error)
GenesisStateWithValSet returns a new genesis state with the validator set
func GetMaccPerms ¶
GetMaccPerms returns a copy of the module account permissions
func ObservabilityViews ¶
func RegisterSwaggerAPI ¶
RegisterSwaggerAPI registers swagger route with API Server
func SigVerificationGasConsumer ¶
func SigVerificationGasConsumer( meter sdk.GasMeter, sig signing.SignatureV2, params authtypes.Params, ) error
SigVerificationGasConsumer is the Decimal implementation of SignatureVerificationGasConsumer. It consumes gas for signature verification based upon the public key type. The cost is fetched from the given params and is matched by the concrete type. The types of keys supported are:
- ed25519 (Validators)
- secp256k1 (Cosmos SDK keys)
- ethsecp256k1 (Ethereum keys)
- multisig (Cosmos SDK multisigs)
Types ¶
type DSC ¶
type DSC struct { *baseapp.BaseApp // SDK keepers AccountKeeper authkeeper.AccountKeeper BankKeeper bankkeeper.Keeper CapabilityKeeper *capabilitykeeper.Keeper //StakingKeeper stakingkeeper.Keeper //SlashingKeeper slashingkeeper.Keeper //DistrKeeper distrkeeper.Keeper GovKeeper govkeeper.Keeper CrisisKeeper crisiskeeper.Keeper UpgradeKeeper upgradekeeper.Keeper ParamsKeeper paramskeeper.Keeper FeeGrantKeeper feegrantkeeper.Keeper AuthzKeeper authzkeeper.Keeper // IBC keepers IBCKeeper *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly // Make scoped keepers public for test purposes ScopedIBCKeeper capabilitykeeper.ScopedKeeper // Ethermint keepers EvmKeeper *evmkeeper.Keeper // Decimal keepers CoinKeeper coinkeeper.Keeper SwapKeeper swapkeeper.Keeper MultisigKeeper multisigkeeper.Keeper NFTKeeper nftkeeper.Keeper FeeKeeper feekeeper.Keeper LegacyKeeper legacykeeper.Keeper ValidatorKeeper validatorkeeper.Keeper // contains filtered or unexported fields }
DSC implements an extended ABCI application. It is an application that may process transactions through Ethereum's EVM running atop of Tendermint consensus.
func NewDSC ¶
func NewDSC( logger tmlog.Logger, db tmdb.DB, traceStore io.Writer, loadLatest bool, skipUpgradeHeights map[int64]bool, homePath string, invCheckPeriod uint, encodingConfig simappparams.EncodingConfig, appOpts servertypes.AppOptions, baseAppOptions ...func(*baseapp.BaseApp), ) *DSC
NewDSC returns a reference to a new initialized Decimal application.
func Setup ¶
func Setup( t *testing.T, isCheckTx bool, feemarketGenesis *feemarkettypes.GenesisState, ) *DSC
Setup initializes a new DSC. A Nop logger is set in DSC.
func SetupWithGenesisAccounts ¶ added in v0.0.8
func SetupWithGenesisAccounts(t *testing.T, feemarketGenesis *feemarkettypes.GenesisState, genAccs []authtypes.GenesisAccount, balances ...banktypes.Balance) *DSC
func SetupWithGenesisValSet ¶ added in v0.0.8
func SetupWithGenesisValSet(t *testing.T, valSet *tmtypes.ValidatorSet, feemarketGenesis *feemarkettypes.GenesisState, genAccs []authtypes.GenesisAccount, balances ...banktypes.Balance) *DSC
func (*DSC) AppCodec ¶
AppCodec returns DSC's app codec.
NOTE: This is solely to be used for testing purposes as it may be desirable for modules to register their own custom testing types.
func (*DSC) BeginBlocker ¶
func (app *DSC) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock
BeginBlocker updates every begin block.
func (*DSC) BlockedAddrs ¶
BlockedAddrs returns all the app's module account addresses that are not allowed to receive external tokens.
func (*DSC) DeliverTx ¶
func (app *DSC) DeliverTx(req abci.RequestDeliverTx) (res abci.ResponseDeliverTx)
We are intentionally decomposing the DeliverTx method so as to calculate the transactions per second.
func (*DSC) EndBlocker ¶
func (app *DSC) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock
EndBlocker updates every end block.
func (*DSC) ExportAppStateAndValidators ¶
func (app *DSC) ExportAppStateAndValidators( forZeroHeight bool, jailAllowedAddrs []string, ) (servertypes.ExportedApp, error)
ExportAppStateAndValidators exports the state of the application for a genesis file.
func (*DSC) GetBaseApp ¶
GetBaseApp implements the TestingApp interface.
func (*DSC) GetIBCKeeper ¶
GetIBCKeeper implements the TestingApp interface.
func (*DSC) GetKey ¶
func (app *DSC) GetKey(storeKey string) *store.KVStoreKey
GetKey returns the KVStoreKey for the provided store key.
NOTE: This is solely to be used for testing purposes.
func (*DSC) GetMemKey ¶
func (app *DSC) GetMemKey(storeKey string) *store.MemoryStoreKey
GetMemKey returns the MemStoreKey for the provided mem key.
NOTE: This is solely used for testing purposes.
func (*DSC) GetScopedIBCKeeper ¶ added in v0.0.8
func (app *DSC) GetScopedIBCKeeper() capabilitykeeper.ScopedKeeper
GetScopedIBCKeeper implements the TestingApp interface.
func (*DSC) GetStakingKeeper ¶
func (app *DSC) GetStakingKeeper() validatorkeeper.Keeper
GetStakingKeeper implements the TestingApp interface. TODO: fix it?
func (*DSC) GetSubspace ¶
func (app *DSC) GetSubspace(moduleName string) paramstypes.Subspace
GetSubspace returns a param subspace for a given module name.
NOTE: This is solely to be used for testing purposes.
func (*DSC) GetTKey ¶
func (app *DSC) GetTKey(storeKey string) *store.TransientStoreKey
GetTKey returns the TransientStoreKey for the provided store key.
NOTE: This is solely to be used for testing purposes.
func (*DSC) GetTxConfig ¶
GetTxConfig implements the TestingApp interface.
func (*DSC) InitChainer ¶
func (app *DSC) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain
InitChainer updates at chain initialization.
func (*DSC) InterfaceRegistry ¶
func (app *DSC) InterfaceRegistry() types.InterfaceRegistry
InterfaceRegistry returns DSC's InterfaceRegistry
func (*DSC) LegacyAmino ¶
func (app *DSC) LegacyAmino() *codec.LegacyAmino
LegacyAmino returns DSC's amino codec.
NOTE: This is solely to be used for testing purposes as it may be desirable for modules to register their own custom testing types.
func (*DSC) LoadHeight ¶
LoadHeight loads state at a particular height.
func (*DSC) ModuleAccountAddrs ¶
ModuleAccountAddrs returns all the app's module account addresses.
func (*DSC) RegisterAPIRoutes ¶
RegisterAPIRoutes registers all application module routes with the provided API server.
func (*DSC) RegisterTendermintService ¶
func (*DSC) RegisterTxService ¶
func (*DSC) SimulationManager ¶
func (app *DSC) SimulationManager() *module.SimulationManager
SimulationManager implements the SimulationApp interface
type GenerateAccountStrategy ¶
type GenerateAccountStrategy func(int) []sdk.AccAddress
type GenesisState ¶ added in v0.0.8
type GenesisState map[string]json.RawMessage
GenesisState of the blockchain is represented here as a map of raw json messages key'd by a identifier string. The identifier is used to determine which module genesis information belongs to so it may be appropriately routed during init chain. Within this application default genesis information is retrieved from the ModuleBasicManager which populates json from each BasicModule object provided to it during init.
func GenesisStateWithSingleValidator ¶ added in v0.0.8
func GenesisStateWithSingleValidator(t *testing.T, app *DSC) GenesisState
GenesisStateWithSingleValidator initializes GenesisState with a single validator and genesis accounts that also act as delegators.
func NewDefaultGenesisState ¶
func NewDefaultGenesisState(cdc codec.JSONCodec) GenesisState
NewDefaultGenesisState generates the default state for the application.
type UpgradeCreator ¶ added in v0.1.1
type UpgradeCreator struct {
// contains filtered or unexported fields
}
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
Package ante defines the SDK auth module's AnteHandler as well as an internal AnteHandler for an Ethereum transaction (i.e MsgEthereumTx).
|
Package ante defines the SDK auth module's AnteHandler as well as an internal AnteHandler for an Ethereum transaction (i.e MsgEthereumTx). |