poe

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2021 License: Apache-2.0 Imports: 26 Imported by: 1

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) })

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

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, 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) 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.JSONMarshaler) json.RawMessage

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

func (AppModule) InitGenesis

func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONMarshaler, 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) QuerierRoute

func (am AppModule) QuerierRoute() string

func (AppModule) RegisterInvariants

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

func (AppModule) RegisterServices

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

func (AppModule) Route

func (am AppModule) Route() sdk.Route

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.JSONMarshaler) 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.JSONMarshaler, 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 Calls next AnteHandler on success CONTRACT: Tx must implement FeeTx interface to use DeductFeeDecorator

func NewDeductFeeDecorator

func NewDeductFeeDecorator(bk bankKeeper, cs keeper.ContractSource) DeductFeeDecorator

func (DeductFeeDecorator) AnteHandle

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

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