app

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2025 License: Apache-2.0 Imports: 175 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Prefix of bech32 encoded address
	AccountAddressPrefix = "kii"
	// Application name
	AppName = "kiichain3"

	OptimisticProcessingTimeoutInSeconds = 5
)
View Source
const (
	// SC Store configs
	FlagSCEnable              = "state-commit.sc-enable"
	FlagSCDirectory           = "state-commit.sc-directory"
	FlagSCAsyncCommitBuffer   = "state-commit.sc-async-commit-buffer"
	FlagSCZeroCopy            = "state-commit.sc-zero-copy"
	FlagSCSnapshotKeepRecent  = "state-commit.sc-keep-recent"
	FlagSCSnapshotInterval    = "state-commit.sc-snapshot-interval"
	FlagSCSnapshotWriterLimit = "state-commit.sc-snapshot-writer-limit"
	FlagSCCacheSize           = "state-commit.sc-cache-size"

	// SS Store configs
	FlagSSEnable            = "state-store.ss-enable"
	FlagSSDirectory         = "state-store.ss-db-directory"
	FlagSSBackend           = "state-store.ss-backend"
	FlagSSAsyncWriterBuffer = "state-store.ss-async-write-buffer"
	FlagSSKeepRecent        = "state-store.ss-keep-recent"
	FlagSSPruneInterval     = "state-store.ss-prune-interval"
	FlagSSImportNumWorkers  = "state-store.ss-import-num-workers"

	// Other configs
	FlagSnapshotInterval = "state-sync.snapshot-interval"
)
View Source
const ShellEVMTxType = math.MaxUint32
View Source
const TestContract = "TEST"
View Source
const TestUser = "kii14jekmh7yruasqx4k372mrktsd7hwz454snw0us"

Variables

View Source
var (
	// DefaultNodeHome default home directories for the application daemon
	DefaultNodeHome string

	// 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(
		aclmodule.AppModuleBasic{},
		auth.AppModuleBasic{},
		authzmodule.AppModuleBasic{},
		genutil.AppModuleBasic{},
		bank.AppModuleBasic{},
		capability.AppModuleBasic{},
		staking.AppModuleBasic{},
		mint.AppModuleBasic{},
		distr.AppModuleBasic{},
		gov.NewAppModuleBasic(getGovProposalHandlers()...),
		params.AppModuleBasic{},
		crisis.AppModuleBasic{},
		slashing.AppModuleBasic{},
		feegrantmodule.AppModuleBasic{},
		ibc.AppModuleBasic{},
		upgrade.AppModuleBasic{},
		evidence.AppModuleBasic{},
		transfer.AppModuleBasic{},
		vesting.AppModuleBasic{},
		evm.AppModuleBasic{},
		wasm.AppModuleBasic{},
		epochmodule.AppModuleBasic{},
		tokenfactorymodule.AppModuleBasic{},
	)

	// WasmProposalsEnabled enables all x/wasm proposals when it's value is "true"
	// and EnableSpecificWasmProposals is empty. Otherwise, all x/wasm proposals
	// are disabled.
	// Used as a flag to turn it on and off
	WasmProposalsEnabled = "true"

	// EnableSpecificWasmProposals, if set, must be comma-separated list of values
	// that are all a subset of "EnableAllProposals", which takes precedence over
	// WasmProposalsEnabled.
	//
	// See: https://github.com/CosmWasm/wasmd/blob/02a54d33ff2c064f3539ae12d75d027d9c665f05/x/wasm/internal/types/proposal.go#L28-L34
	EnableSpecificWasmProposals = ""

	// EmptyWasmOpts defines a type alias for a list of wasm options.
	EmptyWasmOpts []wasm.Option

	// Boolean to only emit kiichaind version and git commit metric once per chain initialization
	EmittedKiichaindVersionMetric = false
	// EmptyAclmOpts defines a type alias for a list of wasm options.
	EmptyACLOpts []aclkeeper.Option
	// EnableOCC allows tests to override default OCC enablement behavior
	EnableOCC       = true
	EmptyAppOptions []AppOption
)
View Source
var DefaultGenesisConfig = genesistypes.GenesisImportConfig{
	StreamGenesisImport: false,
	GenesisStreamFile:   "",
}
View Source
var DefaultLightInvarianceConfig = LightInvarianceConfig{
	SupplyEnabled: true,
}
View Source
var ERC20ApprovalTopic = common.HexToHash("0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925")
View Source
var ERC20TransferTopic = common.HexToHash("0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef")
View Source
var ERC721ApprovalTopic = common.HexToHash("0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925")
View Source
var ERC721ApproveAllTopic = common.HexToHash("0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31")
View Source
var ERC721TransferTopic = common.HexToHash("0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef")
View Source
var EmptyHash = common.HexToHash("0x0")
View Source
var TrueHash = common.HexToHash("0x1")

Functions

func AddressFromValidatorsKey

func AddressFromValidatorsKey(key []byte) []byte

AddressFromValidatorsKey creates the validator operator address from ValidatorsKey

func BlockTest

func BlockTest(a *App, bt *ethtests.BlockTest)

func GetAmountAttribute

func GetAmountAttribute(event abci.Event) (*big.Int, bool)

func GetAttributeValue

func GetAttributeValue(event abci.Event, attribute string) (string, bool)

func GetChannelsFromSignalMapping

func GetChannelsFromSignalMapping(signalMapping acltypes.MessageCompletionSignalMapping) sdkacltypes.MessageAccessOpsChannelMapping

Returns a mapping of the accessOperation to the channels

func GetEventsOfType

func GetEventsOfType(rdtx sdk.DeliverTxHookInput, ty string) (res []abci.Event)

func GetMaccPerms

func GetMaccPerms() map[string][]string

GetMaccPerms returns a copy of the module account permissions

func GetTokenIDAttribute

func GetTokenIDAttribute(event abci.Event) *big.Int

func GetWasmEnabledProposals

func GetWasmEnabledProposals() []wasm.ProposalType

GetWasmEnabledProposals parses the WasmProposalsEnabled and EnableSpecificWasmProposals values to produce a list of enabled proposals to pass into the application.

func IsWithdrawalAddress

func IsWithdrawalAddress(addr common.Address, blocks []*ethtypes.Block) bool

func MakeEncodingConfig

func MakeEncodingConfig() params.EncodingConfig

MakeEncodingConfig creates an EncodingConfig for testing.

func NewAnteHandlerAndDepGenerator

func NewAnteHandlerAndDepGenerator(options HandlerOptions) (sdk.AnteHandler, sdk.AnteDepGenerator, error)

func RegisterSwaggerAPI

func RegisterSwaggerAPI(rtr *mux.Router)

RegisterSwaggerAPI registers swagger route with API Server

func Replay

func Replay(a *App)

func SetupSeiDB

func SetupSeiDB(
	logger log.Logger,
	homePath string,
	appOpts servertypes.AppOptions,
	baseAppOptions []func(*baseapp.BaseApp),
) []func(*baseapp.BaseApp)

Types

type AllowanceResponse

type AllowanceResponse struct {
	Allowance sdk.Int         `json:"allowance"`
	Expires   json.RawMessage `json:"expires"`
}

type App

type App struct {
	*baseapp.BaseApp

	// keepers
	AccessControlKeeper aclkeeper.Keeper
	AccountKeeper       authkeeper.AccountKeeper
	AuthzKeeper         authzkeeper.Keeper
	BankKeeper          bankkeeper.Keeper
	CapabilityKeeper    *capabilitykeeper.Keeper
	StakingKeeper       stakingkeeper.Keeper
	SlashingKeeper      slashingkeeper.Keeper
	MintKeeper          mintkeeper.Keeper
	DistrKeeper         distrkeeper.Keeper
	GovKeeper           govkeeper.Keeper
	CrisisKeeper        crisiskeeper.Keeper
	UpgradeKeeper       upgradekeeper.Keeper
	ParamsKeeper        paramskeeper.Keeper
	IBCKeeper           *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly
	EvidenceKeeper      evidencekeeper.Keeper
	TransferKeeper      ibctransferkeeper.Keeper
	FeeGrantKeeper      feegrantkeeper.Keeper
	WasmKeeper          wasm.Keeper
	EvmKeeper           evmkeeper.Keeper

	// make scoped keepers public for test purposes
	ScopedIBCKeeper      capabilitykeeper.ScopedKeeper
	ScopedTransferKeeper capabilitykeeper.ScopedKeeper
	ScopedWasmKeeper     capabilitykeeper.ScopedKeeper

	EpochKeeper epochmodulekeeper.Keeper

	TokenFactoryKeeper tokenfactorykeeper.Keeper

	HardForkManager *upgrades.HardForkManager
	// contains filtered or unexported fields
}

App extends an ABCI application, but with most of its parameters exported. They are exported for convenience in creating helper functions, as object capabilities aren't needed for testing.

func New

func New(
	logger log.Logger,
	db dbm.DB,
	traceStore io.Writer,
	_ bool,
	skipUpgradeHeights map[int64]bool,
	homePath string,
	invCheckPeriod uint,
	enableCustomEVMPrecompiles bool,
	tmConfig *tmcfg.Config,
	encodingConfig appparams.EncodingConfig,
	enabledProposals []wasm.ProposalType,
	appOpts servertypes.AppOptions,
	wasmOpts []wasm.Option,
	aclOpts []aclkeeper.Option,
	appOptions []AppOption,
	baseAppOptions ...func(*baseapp.BaseApp),
) *App

New returns a reference to an initialized blockchain app

func Setup

func Setup(isCheckTx bool, enableEVMCustomPrecompiles bool, baseAppOptions ...func(*baseapp.BaseApp)) (res *App)

func SetupTestingAppWithLevelDb

func SetupTestingAppWithLevelDb(isCheckTx bool, enableEVMCustomPrecompiles bool) (*App, func())

func SetupWithSc

func SetupWithSc(isCheckTx bool, enableEVMCustomPrecompiles bool, baseAppOptions ...func(*baseapp.BaseApp)) (res *App)

func (*App) AddCosmosEventsToEVMReceiptIfApplicable

func (app *App) AddCosmosEventsToEVMReceiptIfApplicable(ctx sdk.Context, tx sdk.Tx, checksum [32]byte, response sdk.DeliverTxHookInput)

func (*App) AppCodec

func (app *App) AppCodec() codec.Codec

AppCodec returns an 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 (*App) BeginBlock

func (app *App) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock) (res abci.ResponseBeginBlock)

func (*App) BeginBlocker

func (app *App) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock

BeginBlocker application updates every begin block

func (*App) BlacklistedAccAddrs

func (app *App) BlacklistedAccAddrs() map[string]bool

func (*App) BuildDependenciesAndRunTxs

func (app *App) BuildDependenciesAndRunTxs(ctx sdk.Context, txs [][]byte, typedTxs []sdk.Tx, absoluteTxIndices []int) ([]*abci.ExecTxResult, sdk.Context)

BuildDependenciesAndRunTxs deprecated, use ProcessTXsWithOCC instead Deprecated: this will be removed after OCC releases

func (*App) CacheContext

func (app *App) CacheContext(ctx sdk.Context) (sdk.Context, sdk.CacheMultiStore)

cacheContext returns a new context based off of the provided context with a branched multi-store.

func (*App) CheckTx

func (app *App) CheckTx(ctx context.Context, req *abci.RequestCheckTx) (*abci.ResponseCheckTxV2, error)

func (*App) ClearOptimisticProcessingInfo

func (app *App) ClearOptimisticProcessingInfo()

func (*App) Commit

func (app *App) Commit(ctx context.Context) (res *abci.ResponseCommit, err error)

func (*App) DecodeTransactionsConcurrently

func (app *App) DecodeTransactionsConcurrently(ctx sdk.Context, txs [][]byte) []sdk.Tx

func (*App) DeliverTx

func (app *App) DeliverTx(ctx sdk.Context, req abci.RequestDeliverTx, tx sdk.Tx, checksum [32]byte) abci.ResponseDeliverTx

func (*App) DeliverTxBatch

func (app *App) DeliverTxBatch(ctx sdk.Context, req sdk.DeliverTxBatchRequest) (res sdk.DeliverTxBatchResponse)

DeliverTxBatch is not part of the ABCI specification, but this is here for code convention

func (*App) DeliverTxWithResult

func (app *App) DeliverTxWithResult(ctx sdk.Context, tx []byte, typedTx sdk.Tx) *abci.ExecTxResult

func (*App) EndBlock

func (app *App) EndBlock(ctx sdk.Context, req abci.RequestEndBlock) (res abci.ResponseEndBlock)

func (*App) EndBlocker

func (app *App) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock

EndBlocker application updates every end block

func (*App) ExecuteTxsConcurrently

func (app *App) ExecuteTxsConcurrently(ctx sdk.Context, txs [][]byte, typedTxs []sdk.Tx, absoluteTxIndices []int) ([]*abci.ExecTxResult, sdk.Context)

ExecuteTxsConcurrently calls the appropriate function for processing transacitons

func (*App) ExportAppStateAndValidators

func (app *App) ExportAppStateAndValidators(
	forZeroHeight bool, jailAllowedAddrs []string,
) (servertypes.ExportedApp, error)

ExportAppStateAndValidators exports the state of the application for a genesis file.

func (*App) ExportAppToFileStateAndValidators

func (app *App) ExportAppToFileStateAndValidators(
	forZeroHeight bool, jailAllowedAddrs []string, file *os.File,
) (servertypes.ExportedApp, error)

func (*App) FinalizeBlocker

func (app *App) FinalizeBlocker(ctx sdk.Context, req *abci.RequestFinalizeBlock) (*abci.ResponseFinalizeBlock, error)

func (App) GetBaseApp

func (app App) GetBaseApp() *baseapp.BaseApp

GetBaseApp returns the base app of the application

func (*App) GetDeliverTxEntry

func (app *App) GetDeliverTxEntry(ctx sdk.Context, txIndex int, absoluateIndex int, bz []byte, tx sdk.Tx) (res *sdk.DeliverTxEntry)

func (*App) GetEVMMsg

func (app *App) GetEVMMsg(tx sdk.Tx) (res *evmtypes.MsgEVMTransaction)

func (*App) GetEvmAddressAttribute

func (app *App) GetEvmAddressAttribute(ctx sdk.Context, event abci.Event, attribute string) common.Hash

func (*App) GetKey

func (app *App) GetKey(storeKey string) *sdk.KVStoreKey

GetKey returns the KVStoreKey for the provided store key.

NOTE: This is solely to be used for testing purposes.

func (*App) GetMemKey

func (app *App) GetMemKey(storeKey string) *sdk.MemoryStoreKey

GetMemKey returns the MemStoreKey for the provided mem key.

NOTE: This is solely used for testing purposes.

func (*App) GetOptimisticProcessingInfo

func (app *App) GetOptimisticProcessingInfo() *OptimisticProcessingInfo

func (*App) GetSubspace

func (app *App) 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 (*App) GetTKey

func (app *App) GetTKey(storeKey string) *sdk.TransientStoreKey

GetTKey returns the TransientStoreKey for the provided store key.

NOTE: This is solely to be used for testing purposes.

func (*App) GetTxConfig

func (app *App) GetTxConfig() client.TxConfig

func (*App) HandleClose

func (app *App) HandleClose() error

Close closes all items that needs closing (called by baseapp)

func (*App) HandlePreCommit

func (app *App) HandlePreCommit(ctx sdk.Context) error

HandlePreCommit happens right before the block is committed

func (*App) InitChainer

func (app *App) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain

InitChainer application update at chain initialization

func (*App) InterfaceRegistry

func (app *App) InterfaceRegistry() types.InterfaceRegistry

InterfaceRegistry returns an InterfaceRegistry

func (*App) LegacyAmino

func (app *App) LegacyAmino() *codec.LegacyAmino

LegacyAmino returns SimApp'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 (*App) LightInvarianceChecks

func (app *App) LightInvarianceChecks(cms sdk.CommitMultiStore, config LightInvarianceConfig)

func (*App) LightInvarianceTotalSupply

func (app *App) LightInvarianceTotalSupply(cms sdk.CommitMultiStore)

func (*App) LoadHeight

func (app *App) LoadHeight(height int64) error

LoadHeight loads a particular height

func (*App) LoadLatest

func (app *App) LoadLatest(ctx context.Context, req *abci.RequestLoadLatest) (*abci.ResponseLoadLatest, error)

func (*App) MidBlock

func (app *App) MidBlock(ctx sdk.Context, height int64) []abci.Event

func (*App) MidBlocker

func (app *App) MidBlocker(ctx sdk.Context, height int64) []abci.Event

MidBlocker application updates every mid block

func (*App) ModuleAccountAddrs

func (app *App) ModuleAccountAddrs() map[string]bool

ModuleAccountAddrs returns all the app's module account addresses.

func (*App) Name

func (app *App) Name() string

AppName returns the name of the App

func (*App) PartitionPrioritizedTxs

func (app *App) PartitionPrioritizedTxs(_ sdk.Context, txs [][]byte, typedTxs []sdk.Tx) (
	prioritizedTxs, otherTxs [][]byte,
	prioritizedTypedTxs, otherTypedTxs []sdk.Tx,
	prioritizedIndices, otherIndices []int,
)

func (*App) PrepareProposalHandler

func (app *App) PrepareProposalHandler(_ sdk.Context, req *abci.RequestPrepareProposal) (*abci.ResponsePrepareProposal, error)

func (*App) ProcessBlock

func (app *App) ProcessBlock(ctx sdk.Context, txs [][]byte, req BlockProcessRequest, lastCommit abci.CommitInfo) ([]abci.Event, []*abci.ExecTxResult, abci.ResponseEndBlock, error)

func (*App) ProcessBlockConcurrent

func (app *App) ProcessBlockConcurrent(
	ctx sdk.Context,
	txs [][]byte,
	typedTxs []sdk.Tx,
	completionSignalingMap map[int]acltypes.MessageCompletionSignalMapping,
	blockingSignalsMap map[int]acltypes.MessageCompletionSignalMapping,
	txMsgAccessOpMapping map[int]acltypes.MsgIndexToAccessOpMapping,
	absoluteTxIndices []int,
) ([]*abci.ExecTxResult, bool)

func (*App) ProcessBlockSynchronous

func (app *App) ProcessBlockSynchronous(ctx sdk.Context, txs [][]byte, typedTxs []sdk.Tx, absoluteTxIndices []int) []*abci.ExecTxResult

func (*App) ProcessProposalHandler

func (app *App) ProcessProposalHandler(ctx sdk.Context, req *abci.RequestProcessProposal) (*abci.ResponseProcessProposal, error)

func (*App) ProcessTXsWithOCC

func (app *App) ProcessTXsWithOCC(ctx sdk.Context, txs [][]byte, typedTxs []sdk.Tx, absoluteTxIndices []int) ([]*abci.ExecTxResult, sdk.Context)

ProcessTXsWithOCC runs the transactions concurrently via OCC

func (*App) ProcessTxConcurrent

func (app *App) ProcessTxConcurrent(
	ctx sdk.Context,
	txIndex int,
	absoluateTxIndex int,
	txBytes []byte,
	typedTx sdk.Tx,
	wg *sync.WaitGroup,
	resultChan chan<- ChannelResult,
	txCompletionSignalingMap acltypes.MessageCompletionSignalMapping,
	txBlockingSignalsMap acltypes.MessageCompletionSignalMapping,
	txMsgAccessOpMapping acltypes.MsgIndexToAccessOpMapping,
)

TODO: (occ) this is the roughly analogous to the execution + validation tasks for OCC, but this one performs validation in isolation rather than comparing against a multi-version store The validation happens immediately after execution all part of DeliverTx (which is a path that goes through kii-cosmos to runTx eventually)

func (*App) ProcessTxs

func (app *App) ProcessTxs(
	ctx sdk.Context,
	txs [][]byte,
	typedTxs []sdk.Tx,
	dependencyDag *acltypes.Dag,
	processBlockConcurrentFunction ProcessBlockConcurrentFunction,
	absoluteTxIndices []int,
) ([]*abci.ExecTxResult, sdk.Context)

func (*App) RegisterAPIRoutes

func (app *App) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig)

RegisterAPIRoutes registers all application module routes with the provided API server.

func (*App) RegisterTendermintService

func (app *App) RegisterTendermintService(clientCtx client.Context)

RegisterTendermintService implements the Application.RegisterTendermintService method.

func (*App) RegisterTxService

func (app *App) RegisterTxService(clientCtx client.Context)

RegisterTxService implements the Application.RegisterTxService method.

func (App) RegisterUpgradeHandlers

func (app App) RegisterUpgradeHandlers()

func (*App) SetStoreUpgradeHandlers

func (app *App) SetStoreUpgradeHandlers()

Add (or remove) keepers when they are introduced / removed in different versions

func (*App) SetTxDecoder

func (app *App) SetTxDecoder(txDecoder sdk.TxDecoder)

test-only

func (*App) SimulationManager

func (app *App) SimulationManager() *module.SimulationManager

SimulationManager implements the SimulationApp interface

type AppOption

type AppOption func(*App)

type BlockProcessRequest

type BlockProcessRequest interface {
	GetHash() []byte
	GetTxs() [][]byte
	GetByzantineValidators() []abci.Misbehavior
	GetHeight() int64
	GetTime() time.Time
}

type ChannelResult

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

type GenesisState

type GenesisState map[string]json.RawMessage

The genesis state 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 NewDefaultGenesisState

func NewDefaultGenesisState(cdc codec.JSONCodec) GenesisState

NewDefaultGenesisState generates the default state for the application.

type HandlerOptions

type HandlerOptions struct {
	ante.HandlerOptions

	IBCKeeper           *ibckeeper.Keeper
	WasmConfig          *wasmtypes.WasmConfig
	WasmKeeper          *wasm.Keeper
	AccessControlKeeper *aclkeeper.Keeper
	EVMKeeper           *evmkeeper.Keeper
	TXCounterStoreKey   sdk.StoreKey
	LatestCtxGetter     func() sdk.Context

	TracingInfo *tracing.Info
}

HandlerOptions extend the SDK's AnteHandler options by requiring the IBC channel keeper.

type InMemoryIterator

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

func NewInMemoryIterator

func NewInMemoryIterator(data map[string][]byte, start, end []byte) *InMemoryIterator

func (*InMemoryIterator) Close

func (it *InMemoryIterator) Close() error

func (*InMemoryIterator) Domain

func (it *InMemoryIterator) Domain() (start, end []byte)

func (*InMemoryIterator) Error

func (it *InMemoryIterator) Error() error

func (*InMemoryIterator) Key

func (it *InMemoryIterator) Key() (key []byte)

func (*InMemoryIterator) Next

func (it *InMemoryIterator) Next()

func (*InMemoryIterator) Valid

func (it *InMemoryIterator) Valid() bool

func (*InMemoryIterator) Value

func (it *InMemoryIterator) Value() (value []byte)

type InMemoryStateStore

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

InMemoryStateStore this implements seidb state store with an inmemory store

func NewInMemoryStateStore

func NewInMemoryStateStore() *InMemoryStateStore

func (*InMemoryStateStore) ApplyChangeset

func (s *InMemoryStateStore) ApplyChangeset(version int64, cs *seidbproto.NamedChangeSet) error

func (*InMemoryStateStore) ApplyChangesetAsync

func (s *InMemoryStateStore) ApplyChangesetAsync(version int64, changesets []*seidbproto.NamedChangeSet) error

func (*InMemoryStateStore) Close

func (s *InMemoryStateStore) Close() error

func (*InMemoryStateStore) Get

func (s *InMemoryStateStore) Get(storeKey string, version int64, key []byte) ([]byte, error)

func (*InMemoryStateStore) GetEarliestVersion

func (s *InMemoryStateStore) GetEarliestVersion() (int64, error)

func (*InMemoryStateStore) GetLatestVersion

func (s *InMemoryStateStore) GetLatestVersion() (int64, error)

func (*InMemoryStateStore) Has

func (s *InMemoryStateStore) Has(storeKey string, version int64, key []byte) (bool, error)

func (*InMemoryStateStore) Import

func (s *InMemoryStateStore) Import(version int64, ch <-chan types.SnapshotNode) error

func (*InMemoryStateStore) Iterator

func (s *InMemoryStateStore) Iterator(storeKey string, version int64, start, end []byte) (types.DBIterator, error)

func (*InMemoryStateStore) Prune

func (s *InMemoryStateStore) Prune(version int64) error

func (*InMemoryStateStore) RawImport

func (s *InMemoryStateStore) RawImport(ch <-chan types.RawSnapshotNode) error

func (*InMemoryStateStore) RawIterate

func (s *InMemoryStateStore) RawIterate(storeKey string, fn func([]byte, []byte, int64) bool) (bool, error)

func (*InMemoryStateStore) ReverseIterator

func (s *InMemoryStateStore) ReverseIterator(storeKey string, version int64, start, end []byte) (types.DBIterator, error)

func (*InMemoryStateStore) SetEarliestVersion

func (s *InMemoryStateStore) SetEarliestVersion(version int64) error

func (*InMemoryStateStore) SetLatestVersion

func (s *InMemoryStateStore) SetLatestVersion(version int64) error

type LightInvarianceConfig

type LightInvarianceConfig struct {
	SupplyEnabled bool `mapstructure:"supply_enabled"`
}

func ReadLightInvarianceConfig

func ReadLightInvarianceConfig(opts servertypes.AppOptions) (LightInvarianceConfig, error)

type OptimisticProcessingInfo

type OptimisticProcessingInfo struct {
	Height     int64
	Hash       []byte
	Aborted    bool
	Completion chan struct{}
	// result fields
	Events       []abci.Event
	TxRes        []*abci.ExecTxResult
	EndBlockResp abci.ResponseEndBlock
}

type ProcessBlockConcurrentFunction

type ProcessBlockConcurrentFunction func(
	ctx sdk.Context,
	txs [][]byte,
	typedTxs []sdk.Tx,
	completionSignalingMap map[int]acltypes.MessageCompletionSignalMapping,
	blockingSignalsMap map[int]acltypes.MessageCompletionSignalMapping,
	txMsgAccessOpMapping map[int]acltypes.MsgIndexToAccessOpMapping,
	absoluteTxIndices []int,
) ([]*abci.ExecTxResult, bool)

type TestAppOpts

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

func (TestAppOpts) Get

func (t TestAppOpts) Get(s string) interface{}

type TestTx

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

func NewTestTx

func NewTestTx(msgs []sdk.Msg) TestTx

func (TestTx) GetMsgs

func (t TestTx) GetMsgs() []sdk.Msg

func (TestTx) ValidateBasic

func (t TestTx) ValidateBasic() error

type TestWrapper

type TestWrapper struct {
	suite.Suite

	App *App
	Ctx sdk.Context
}

func NewTestWrapper

func NewTestWrapper(t *testing.T, tm time.Time, valPub crptotypes.PubKey, enableEVMCustomPrecompiles bool, baseAppOptions ...func(*baseapp.BaseApp)) *TestWrapper

func NewTestWrapperWithSc

func NewTestWrapperWithSc(t *testing.T, tm time.Time, valPub crptotypes.PubKey, enableEVMCustomPrecompiles bool, baseAppOptions ...func(*baseapp.BaseApp)) *TestWrapper

func (*TestWrapper) BeginBlock

func (s *TestWrapper) BeginBlock()

func (*TestWrapper) EndBlock

func (s *TestWrapper) EndBlock()

func (*TestWrapper) FundAcc

func (s *TestWrapper) FundAcc(acc sdk.AccAddress, amounts sdk.Coins)

Directories

Path Synopsis
Package params defines the simulation parameters in the simapp.
Package params defines the simulation parameters in the simapp.
v0

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳