poe

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2022 License: Apache-2.0 Imports: 31 Imported by: 0

README

Proof of Engagement (PoE)

This module contains the Proof of Engagement (PoE) contracts and integration points. See the Whitepaper for more details about PoE.

This module provides first class support for PoE:

  • Bootstrap and contract instantiation
  • Query and CLI support
  • Genesis import/ export
  • Integration tests
Contracts
  • tg4-group - engagement group with weighted members
  • tg4-stake - validator group weighted by staked amount
  • valset - privileged contract to map a trusted cw4 contract to the Tendermint validator set running the chain
  • mixer - calculates the combined value of stake and engagement points. Source for the valset contract.
Command line interface (CLI)
  • Commands
  tgrade tx poe -h
  • Query
  tgrade query poe -h
Disclaimer

This module uses code that was part on the Cosmos-sdk genutil module.

Credits and big thank you go to the original authors

Documentation

Index

Constants

View Source
const (
	ModuleName = types.ModuleName
	StoreKey   = types.StoreKey
	RouterKey  = types.RouterKey
)

Variables

This section is empty.

Functions

func BeginBlocker

func BeginBlocker(ctx sdk.Context, k interface{ TrackHistoricalInfo(ctx sdk.Context) })

BeginBlocker ABCI begin block callback

func BootstrapPoEContracts added in v0.8.0

func BootstrapPoEContracts(ctx sdk.Context, k wasmtypes.ContractOpsKeeper, tk twasmKeeper, poeKeeper poeKeeper, gs types.SeedContracts) error

BootstrapPoEContracts stores and instantiates all PoE contracts: See https://github.com/confio/tgrade-contracts/blob/main/docs/Architecture.md#multi-level-governance for an overview

func ClearEmbeddedContracts

func ClearEmbeddedContracts()

ClearEmbeddedContracts release memory

func EndBlocker

func EndBlocker(parentCtx sdk.Context, k endBlockKeeper) []abci.ValidatorUpdate

EndBlocker calls the Valset contract for the validator diff.

func NewHandler

func NewHandler(k keeper.PoEKeeper, contractKeeper wasmtypes.ContractOpsKeeper, tk types.TWasmKeeper) sdk.Handler

NewHandler constructor

func VerifyPoEContracts added in v1.0.0

func VerifyPoEContracts(ctx sdk.Context, tk twasmKeeper, poeKeeper keeper.ContractSource) error

VerifyPoEContracts sanity check that verifies all PoE contracts are set up as expected

Types

type AppModule

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

AppModule implements an application module for the genutil module.

func NewAppModule

func NewAppModule(poeKeeper *keeper.Keeper, twasmKeeper twasmKeeper, bankKeeper simulation.BankKeeper, accountKeeper types.AccountKeeper, deliverTx DeliverTxfn, txEncodingConfig client.TxEncodingConfig, contractKeeper wasmtypes.ContractOpsKeeper) AppModule

NewAppModule creates a new AppModule object

func (AppModule) BeginBlock

func (am AppModule) BeginBlock(ctx sdk.Context, block abci.RequestBeginBlock)

func (AppModule) ConsensusVersion added in v0.6.2

func (am AppModule) ConsensusVersion() uint64

ConsensusVersion is a sequence number for state-breaking change of the module. It should be incremented on each consensus-breaking change introduced by the module. To avoid wrong/empty versions, the initial version should be set to 1.

func (AppModule) EndBlock

func (am AppModule) EndBlock(ctx sdk.Context, block abci.RequestEndBlock) []abci.ValidatorUpdate

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 genutil module.

func (AppModule) GenerateGenesisState added in v1.0.0

func (AppModule) GenerateGenesisState(simState *module.SimulationState)

GenerateGenesisState creates a randomized GenState of the PoE module.

func (AppModule) InitGenesis

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

InitGenesis performs genesis initialization for the genutil module. It returns no validator updates.

func (AppModule) LegacyQuerierHandler

func (am AppModule) LegacyQuerierHandler(amino *codec.LegacyAmino) sdk.Querier

func (AppModule) ProposalContents added in v1.0.0

func (AppModule) ProposalContents(simState module.SimulationState) []simtypes.WeightedProposalContent

ProposalContents doesn't return any content functions for governance proposals.

func (AppModule) QuerierRoute

func (am AppModule) QuerierRoute() string

func (AppModule) RandomizedParams added in v1.0.0

func (AppModule) RandomizedParams(r *rand.Rand) []simtypes.ParamChange

RandomizedParams creates randomized PoE param changes for the simulator.

func (AppModule) RegisterInvariants

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

func (AppModule) RegisterServices

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

func (AppModule) RegisterStoreDecoder added in v1.0.0

func (am AppModule) RegisterStoreDecoder(sdr sdk.StoreDecoderRegistry)

RegisterStoreDecoder registers a decoder for PoE module's types

func (AppModule) Route

func (am AppModule) Route() sdk.Route

func (AppModule) WeightedOperations added in v1.0.0

func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation

WeightedOperations returns the all the PoE module operations with their respective weights.

type AppModuleBasic

type AppModuleBasic struct{}

AppModuleBasic defines the basic application module used by the genutil module.

func (AppModuleBasic) DefaultGenesis

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

DefaultGenesis returns default genesis state as raw bytes for the genutil module.

func (AppModuleBasic) GetQueryCmd

func (AppModuleBasic) GetQueryCmd() *cobra.Command

GetQueryCmd returns no root query command for the genutil module.

func (AppModuleBasic) GetTxCmd

func (AppModuleBasic) GetTxCmd() *cobra.Command

GetTxCmd returns no root tx command for the genutil module.

func (AppModuleBasic) Name

func (AppModuleBasic) Name() string

Name returns the genutil module's name.

func (AppModuleBasic) RegisterGRPCGatewayRoutes

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

RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the genutil module.

func (AppModuleBasic) RegisterInterfaces

func (b AppModuleBasic) RegisterInterfaces(registry cdctypes.InterfaceRegistry)

RegisterInterfaces registers the module's interface types

func (AppModuleBasic) RegisterLegacyAminoCodec

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

RegisterLegacyAminoCodec registers the genutil module's types on the given LegacyAmino codec.

func (AppModuleBasic) RegisterRESTRoutes

func (AppModuleBasic) RegisterRESTRoutes(_ client.Context, _ *mux.Router)

RegisterRESTRoutes registers the REST routes for the genutil module.

func (AppModuleBasic) ValidateGenesis

func (b AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, txEncodingConfig client.TxEncodingConfig, bz json.RawMessage) error

ValidateGenesis performs genesis state validation for the genutil module.

type DeductFeeDecorator

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

DeductFeeDecorator deducts fees from the first signer of the tx If the first signer does not have the funds to pay for the fees, return with InsufficientFunds error Call next AnteHandler if fees successfully deducted CONTRACT: Tx must implement FeeTx interface to use DeductFeeDecorator

func (DeductFeeDecorator) AnteHandle

func (dfd DeductFeeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (newCtx sdk.Context, err error)

AnteHandle has the same logic as ante.DeductFeeDecorator except that the fees are transferred to a PoE VALSET contract

func (DeductFeeDecorator) DeductFees added in v0.6.2

func (dfd DeductFeeDecorator) DeductFees(ctx sdk.Context, acc authtypes.AccountI, fees sdk.Coins) error

DeductFees deducts fees from the given account.

type DeliverTxfn

type DeliverTxfn = keeper.DeliverTxFn

Directories

Path Synopsis
cli
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