Documentation ¶
Overview ¶
nolint autogenerated code using github.com/rigelrozanski/multitool aliases generated for the following subdirectories: ALIASGEN: github.com/hbtc-chain/bhchain/x/auth/types
Index ¶
- Constants
- Variables
- func CheckCUType(ctx sdk.Context, ck CUKeeper, signers []sdk.CUAddress) sdk.Result
- func DeductFees(supplyKeeper internal.SupplyKeeper, ctx sdk.Context, cu CU, fees sdk.Coins) sdk.Result
- func DefaultSigVerificationGasConsumer(meter sdk.GasMeter, sig []byte, pubkey crypto.PubKey, params Params) sdk.Result
- func EnsureSufficientMempoolFees(ctx sdk.Context, stdFee StdFee) sdk.Result
- func GetSignBytes(chainID string, stdTx StdTx, cu CU, genesis bool) []byte
- func InitGenesis(ctx sdk.Context, ak CUKeeper, data GenesisState)
- func NewAnteHandler(ck CUKeeper, supplyKeeper internal.SupplyKeeper, ...) sdk.AnteHandler
- func NewGasRefundHandler(supplyKeeper internal.SupplyKeeper) sdk.GasRefundHandler
- func NewQuerier(keeper CUKeeper) sdk.Querier
- func ProcessPubKey(cu CU, sig StdSignature, simulate bool) (crypto.PubKey, sdk.Result)
- func SetGasMeter(simulate bool, ctx sdk.Context, gasLimit uint64) sdk.Context
- func ValidateMemo(stdTx StdTx, params Params) sdk.Result
- func ValidateSigCount(stdTx StdTx, params Params) sdk.Result
- type AppModule
- func (AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock)
- func (AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate
- func (am AppModule) ExportGenesis(ctx sdk.Context) json.RawMessage
- func (am AppModule) InitGenesis(ctx sdk.Context, data json.RawMessage) []abci.ValidatorUpdate
- func (AppModule) Name() string
- func (AppModule) NewHandler() sdk.Handler
- func (am AppModule) NewQuerierHandler() sdk.Querier
- func (AppModule) QuerierRoute() string
- func (AppModule) RegisterInvariants(_ sdk.InvariantRegistry)
- func (AppModule) Route() string
- type AppModuleBasic
- func (AppModuleBasic) DefaultGenesis() json.RawMessage
- func (AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command
- func (AppModuleBasic) GetTxCmd(cdc *codec.Codec) *cobra.Command
- func (AppModuleBasic) Name() string
- func (AppModuleBasic) RegisterCodec(cdc *codec.Codec)
- func (AppModuleBasic) RegisterRESTRoutes(ctx context.CLIContext, rtr *mux.Router)
- func (AppModuleBasic) ValidateGenesis(bz json.RawMessage) error
- type BaseCU
- type CU
- type CUKeeper
- func (ck CUKeeper) GetAllCUs(ctx sdk.Context) []exported.CustodianUnit
- func (ck CUKeeper) GetCU(context sdk.Context, addresses sdk.CUAddress) exported.CustodianUnit
- func (ck CUKeeper) GetCUFromExtAddress(ctx sdk.Context, chain, extAddress string) (sdk.CUAddress, error)
- func (ck CUKeeper) GetOpCUs(ctx sdk.Context, symbol string) []exported.CustodianUnit
- func (ck CUKeeper) GetOrNewCU(context sdk.Context, cuType sdk.CUType, addr sdk.CUAddress) exported.CustodianUnit
- func (ck CUKeeper) GetParams(ctx sdk.Context) (params types.Params)
- func (ck CUKeeper) IterateCUs(ctx sdk.Context, process func(exported.CustodianUnit) (stop bool))
- func (ck CUKeeper) Logger(ctx sdk.Context) log.Logger
- func (ck CUKeeper) NewCU(ctx sdk.Context, cu exported.CustodianUnit) exported.CustodianUnit
- func (ck CUKeeper) NewCUWithAddress(ctx sdk.Context, cuType sdk.CUType, addr sdk.CUAddress) exported.CustodianUnit
- func (ck CUKeeper) NewCUWithPubkey(ctx sdk.Context, cuType sdk.CUType, pub crypto.PubKey) exported.CustodianUnit
- func (ck CUKeeper) NewOpCUWithAddress(ctx sdk.Context, symbol string, addr sdk.CUAddress) exported.CustodianUnit
- func (ck CUKeeper) RemoveCU(ctx sdk.Context, cu exported.CustodianUnit)
- func (ck CUKeeper) SetCU(ctx sdk.Context, cu exported.CustodianUnit)
- func (ck CUKeeper) SetExtAddressWithCU(ctx sdk.Context, chain, extAddress string, cuAddress sdk.CUAddress)
- func (ck CUKeeper) SetParams(ctx sdk.Context, params types.Params)
- func (ck *CUKeeper) SetStakingKeeper(sk internal.StakingKeeper)
- type CUKeeperI
- type GenesisState
- type Params
- type QueryAccountParams
- type SignatureVerificationGasConsumer
- type StdFee
- type StdSignDoc
- type StdSignMsg
- type StdSignature
- type StdTx
- type TxBuilder
- type VestingAccount
Constants ¶
const ( ModuleName = types.ModuleName StoreKey = types.StoreKey FeeCollectorName = types.FeeCollectorName QuerierRoute = types.QuerierRoute DefaultParamspace = types.DefaultParamspace DefaultMaxMemoCharacters = types.DefaultMaxMemoCharacters DefaultTxSigLimit = types.DefaultTxSigLimit DefaultTxSizeCostPerByte = types.DefaultTxSizeCostPerByte DefaultSigVerifyCostED25519 = types.DefaultSigVerifyCostED25519 DefaultSigVerifyCostSecp256k1 = types.DefaultSigVerifyCostSecp256k1 QueryCU = types.QueryCU )
const (
DefaultGasUsedForRefund = uint64(20000)
)
Variables ¶
var ( // functions aliases NewBaseCU = types.NewBaseCU ProtoBaseCU = types.ProtoBaseCU NewBaseCUWithAddress = types.NewBaseCUWithAddress RegisterCodec = types.RegisterCodec NewGenesisState = types.NewGenesisState DefaultGenesisState = types.DefaultGenesisState ValidateGenesis = types.ValidateGenesis AddressStoreKey = types.AddressStoreKey NewParams = types.NewParams ParamKeyTable = types.ParamKeyTable DefaultParams = types.DefaultParams NewQueryAccountParams = types.NewQueryCUParams NewStdTx = types.NewStdTx CountSubKeys = types.CountSubKeys NewStdFee = types.NewStdFee StdSignBytes = types.StdSignBytes DefaultTxDecoder = types.DefaultTxDecoder DefaultTxEncoder = types.DefaultTxEncoder NewTxBuilder = types.NewTxBuilder NewTxBuilderFromCLI = types.NewTxBuilderFromCLI MakeSignature = types.MakeSignature NewAccountRetriever = types.NewCURetriever // variable aliases ModuleCdc = types.ModuleCdc AddressStoreKeyPrefix = types.AddressStoreKeyPrefix GlobalCUNumberKey = types.GlobalCUNumberKey KeyMaxMemoCharacters = types.KeyMaxMemoCharacters KeyTxSigLimit = types.KeyTxSigLimit KeyTxSizeCostPerByte = types.KeyTxSizeCostPerByte KeySigVerifyCostED25519 = types.KeySigVerifyCostED25519 KeySigVerifyCostSecp256k1 = types.KeySigVerifyCostSecp256k1 QueryCUForTest = queryCU )
Functions ¶
func CheckCUType ¶
func DeductFees ¶
func DeductFees(supplyKeeper internal.SupplyKeeper, ctx sdk.Context, cu CU, fees sdk.Coins) sdk.Result
DeductFees deducts fees from the given CU.
NOTE: We could use the CoinKeeper (in addition to the CUKeeper, because the CoinKeeper doesn't give us accounts), but it seems easier to do this.
func DefaultSigVerificationGasConsumer ¶
func DefaultSigVerificationGasConsumer( meter sdk.GasMeter, sig []byte, pubkey crypto.PubKey, params Params, ) sdk.Result
DefaultSigVerificationGasConsumer is the default 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.
func EnsureSufficientMempoolFees ¶
EnsureSufficientMempoolFees verifies that the given transaction has supplied enough fees to cover a proposer's minimum fees. A result object is returned indicating success or failure.
Contract: This should only be called during CheckTx as it cannot be part of consensus.
func GetSignBytes ¶
GetSignBytes returns a slice of bytes to sign over for a given transaction and an CU.
func InitGenesis ¶
func InitGenesis(ctx sdk.Context, ak CUKeeper, data GenesisState)
InitGenesis - Init store state from genesis data
CONTRACT: old coins from the FeeCollectionKeeper need to be transferred through a genesis port script to the new fee collector CU
func NewAnteHandler ¶
func NewAnteHandler(ck CUKeeper, supplyKeeper internal.SupplyKeeper, stakingKeeper internal.StakingKeeper, sigGasConsumer SignatureVerificationGasConsumer) sdk.AnteHandler
NewAnteHandler returns an AnteHandler that checks and increments sequence numbers, checks signatures & CU numbers, and deducts fees from the first signer.
func NewGasRefundHandler ¶ added in v0.9.3
func NewGasRefundHandler(supplyKeeper internal.SupplyKeeper) sdk.GasRefundHandler
func NewQuerier ¶
creates a querier for auth REST endpoints
func ProcessPubKey ¶
ProcessPubKey verifies that the given CU address matches that of the StdSignature. In addition, it will set the public key of the CU if it has not been set.
func SetGasMeter ¶
SetGasMeter returns a new context with a gas meter set from a given context.
func ValidateMemo ¶
ValidateMemo validates the memo size.
Types ¶
type AppModule ¶
type AppModule struct { AppModuleBasic // contains filtered or unexported fields }
___________________________ app module object
func NewAppModule ¶
NewAppModule creates a new AppModule object
func (AppModule) BeginBlock ¶
func (AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock)
module begin-block
func (AppModule) EndBlock ¶
func (AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate
module end-block
func (AppModule) ExportGenesis ¶
func (am AppModule) ExportGenesis(ctx sdk.Context) json.RawMessage
module export genesis
func (AppModule) InitGenesis ¶
func (am AppModule) InitGenesis(ctx sdk.Context, data json.RawMessage) []abci.ValidatorUpdate
module init-genesis
func (AppModule) NewQuerierHandler ¶
module querier
func (AppModule) RegisterInvariants ¶
func (AppModule) RegisterInvariants(_ sdk.InvariantRegistry)
register invariants
type AppModuleBasic ¶
type AppModuleBasic struct{}
app module basics object
func (AppModuleBasic) DefaultGenesis ¶
func (AppModuleBasic) DefaultGenesis() json.RawMessage
default genesis state
func (AppModuleBasic) GetQueryCmd ¶
func (AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command
get the root query command of this module
func (AppModuleBasic) GetTxCmd ¶
func (AppModuleBasic) GetTxCmd(cdc *codec.Codec) *cobra.Command
get the root tx command of this module
func (AppModuleBasic) RegisterCodec ¶
func (AppModuleBasic) RegisterCodec(cdc *codec.Codec)
register module codec
func (AppModuleBasic) RegisterRESTRoutes ¶
func (AppModuleBasic) RegisterRESTRoutes(ctx context.CLIContext, rtr *mux.Router)
register rest routes
func (AppModuleBasic) ValidateGenesis ¶
func (AppModuleBasic) ValidateGenesis(bz json.RawMessage) error
module validate genesis
type CU ¶
type CU = exported.CustodianUnit
type CUKeeper ¶
CUKeeper encodes/decodes CUs using the go-amino (binary) encoding/decoding library.
func NewCUKeeper ¶
func NewCUKeeper( cdc *codec.Codec, key sdk.StoreKey, paramstore subspace.Subspace, proto func() exported.CustodianUnit, ) CUKeeper
NewCUKeeper returns a new CUKeeper that uses go-amino to (binary) encode and decode concrete sdk.CustodianUnits. nolint
func (CUKeeper) GetAllCUs ¶
func (ck CUKeeper) GetAllCUs(ctx sdk.Context) []exported.CustodianUnit
GetAllCUs returns all custodian units in the CUKeeper.
func (CUKeeper) GetCUFromExtAddress ¶
func (ck CUKeeper) GetCUFromExtAddress(ctx sdk.Context, chain, extAddress string) (sdk.CUAddress, error)
------------------------------------------------ GetCUFromExtAddresse get the CU's address which has the etxAddress,
func (CUKeeper) GetOpCUs ¶
GetOpCUs returns all operation custodian units of the symbol . if symbol is empty return all operation custodian units of the symbol.
func (CUKeeper) GetOrNewCU ¶
func (ck CUKeeper) GetOrNewCU(context sdk.Context, cuType sdk.CUType, addr sdk.CUAddress) exported.CustodianUnit
GetOrNewCU get or new a CustodianUnit. If CustodianUnit is not found, and CU type is user, new one but not yet save it. If CustodianUnit is not found, and CU type not user, return CustodianUnit(nil).
func (CUKeeper) IterateCUs ¶
IterateCUs implements sdk.CUKeeper.
func (CUKeeper) NewCU ¶
func (ck CUKeeper) NewCU(ctx sdk.Context, cu exported.CustodianUnit) exported.CustodianUnit
NewCU set CUNumber for the CustodianUnit the CustodianUnit may not created by the proto func, for example: ModuleAccountI
func (CUKeeper) NewCUWithAddress ¶
func (CUKeeper) NewCUWithPubkey ¶
func (ck CUKeeper) NewCUWithPubkey(ctx sdk.Context, cuType sdk.CUType, pub crypto.PubKey) exported.CustodianUnit
------implement CUKeeperI---
func (CUKeeper) NewOpCUWithAddress ¶
func (ck CUKeeper) NewOpCUWithAddress(ctx sdk.Context, symbol string, addr sdk.CUAddress) exported.CustodianUnit
NewOpCUWithAddress create OP CU
func (CUKeeper) RemoveCU ¶
func (ck CUKeeper) RemoveCU(ctx sdk.Context, cu exported.CustodianUnit)
RemoveCU removes an cu for the cu mapper store. NOTE: this will cause supply invariant violation if called
func (CUKeeper) SetCU ¶
func (ck CUKeeper) SetCU(ctx sdk.Context, cu exported.CustodianUnit)
SetCU implements sdk.CUKeeper.
func (CUKeeper) SetExtAddressWithCU ¶ added in v0.9.3
func (ck CUKeeper) SetExtAddressWithCU(ctx sdk.Context, chain, extAddress string, cuAddress sdk.CUAddress)
SetExtAddresseWithCU
func (*CUKeeper) SetStakingKeeper ¶
func (ck *CUKeeper) SetStakingKeeper(sk internal.StakingKeeper)
type CUKeeperI ¶
type CUKeeperI interface { // CU functions NewCUWithPubkey(ctx sdk.Context, cuType sdk.CUType, pub crypto.PubKey) exported.CustodianUnit NewCUWithAddress(ctx sdk.Context, cuType sdk.CUType, cuaddr sdk.CUAddress) exported.CustodianUnit NewCU(ctx sdk.Context, cu exported.CustodianUnit) exported.CustodianUnit NewOpCUWithAddress(ctx sdk.Context, symbol string, addr sdk.CUAddress) exported.CustodianUnit GetCU(context sdk.Context, addresses sdk.CUAddress) exported.CustodianUnit GetOrNewCU(context sdk.Context, cuType sdk.CUType, addresses sdk.CUAddress) exported.CustodianUnit SetCU(ctx sdk.Context, cu exported.CustodianUnit) GetAllCUs(ctx sdk.Context) []exported.CustodianUnit GetOpCUs(ctx sdk.Context, symbol string) []exported.CustodianUnit RemoveCU(ctx sdk.Context, cu exported.CustodianUnit) IterateCUs(ctx sdk.Context, process func(exported.CustodianUnit) (stop bool)) // param funcsions SetParams(ctx sdk.Context, params types.Params) GetParams(ctx sdk.Context) (params types.Params) Logger(ctx sdk.Context) log.Logger SetExtAddressWithCU(ctx sdk.Context, symbol, extAddress string, cuAddress sdk.CUAddress) GetCUFromExtAddress(ctx sdk.Context, symbol, extAddress string) (sdk.CUAddress, error) }
type GenesisState ¶
type GenesisState = types.GenesisState
func ExportGenesis ¶
func ExportGenesis(ctx sdk.Context, ck CUKeeper) GenesisState
ExportGenesis returns a GenesisState for a given context and keeper
type QueryAccountParams ¶
type QueryAccountParams = types.QueryCUParams
type SignatureVerificationGasConsumer ¶
type SignatureVerificationGasConsumer = func(meter sdk.GasMeter, sig []byte, pubkey crypto.PubKey, params Params) sdk.Result
SignatureVerificationGasConsumer is the type of function that is used to both consume gas when verifying signatures and also to accept or reject different types of PubKey's. This is where apps can define their own PubKey
type StdSignDoc ¶
type StdSignDoc = types.StdSignDoc
type StdSignMsg ¶
type StdSignMsg = types.StdSignMsg
type StdSignature ¶
type StdSignature = types.StdSignature