types

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2021 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const IxoNativeToken = "uixo"
View Source
const (
	ModuleName = "ixo"
)

Variables

View Source
var ModuleCdc *codec.Codec

module wide codec

Functions

func ApproximateFeeForTx

func ApproximateFeeForTx(cliCtx context.CLIContext, tx auth.StdTx, chainId string) (auth.StdFee, error)

func BuildAndSign added in v0.12.1

func BuildAndSign(txBldr auth.TxBuilder, ctx context.CLIContext,
	msgs []sdk.Msg, ixoDid exported.IxoDid) ([]byte, error)

func CompleteAndBroadcastTxCLI

func CompleteAndBroadcastTxCLI(txBldr auth.TxBuilder, cliCtx context.CLIContext, msgs []sdk.Msg, ixoDid exported.IxoDid) error

func GenerateOrBroadcastMsgs

func GenerateOrBroadcastMsgs(cliCtx context.CLIContext, msg sdk.Msg, ixoDid exported.IxoDid) error

func IxoSigVerificationGasConsumer added in v0.12.2

func IxoSigVerificationGasConsumer(
	meter sdk.GasMeter, sig []byte, pubkey crypto.PubKey, params auth.Params,
) error

Identical to DefaultSigVerificationGasConsumer, but with ed25519 allowed

func MakeSignature added in v0.12.1

func MakeSignature(signBytes []byte,
	privateKey ed25519tm.PrivKeyEd25519) (auth.StdSignature, error)

func NewDefaultAnteHandler

func NewDefaultAnteHandler(ak auth.AccountKeeper, supplyKeeper supply.Keeper, sigGasConsumer ante.SignatureVerificationGasConsumer, pubKeyGetter PubKeyGetter) sdk.AnteHandler

func RegisterCodec added in v0.12.1

func RegisterCodec(cdc *codec.Codec)

func Sign added in v0.12.1

func Sign(cliCtx context.CLIContext, msg auth.StdSignMsg,
	ixoDid exported.IxoDid) ([]byte, error)

func SignAndBroadcastTxFromStdSignMsg

func SignAndBroadcastTxFromStdSignMsg(cliCtx context.CLIContext,
	msg auth.StdSignMsg, ixoDid exported.IxoDid) (sdk.TxResponse, error)

Types

type DeductFeeDecorator added in v0.14.0

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 NewDeductFeeDecorator added in v0.14.0

func NewDeductFeeDecorator(ak keeper.AccountKeeper, sk types.SupplyKeeper, pkg PubKeyGetter) DeductFeeDecorator

func (DeductFeeDecorator) AnteHandle added in v0.14.0

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

type DidKeeper

type DidKeeper interface {
	GetDidDoc(ctx sdk.Context, did exported.Did) (exported.DidDoc, error)
	SetDidDoc(ctx sdk.Context, did exported.DidDoc) (err error)
	AddDidDoc(ctx sdk.Context, did exported.DidDoc)
	AddCredentials(ctx sdk.Context, did exported.Did, credential exported.DidCredential) (err error)
	GetAllDidDocs(ctx sdk.Context) (didDocs []exported.DidDoc)
	GetAddDids(ctx sdk.Context) (dids []exported.Did)
}

DidKeeper defines the did contract that must be fulfilled throughout the ixo module

type IncrementSequenceDecorator added in v0.14.0

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

IncrementSequenceDecorator handles incrementing sequences of all signers. Use the IncrementSequenceDecorator decorator to prevent replay attacks. Note, there is no need to execute IncrementSequenceDecorator on RecheckTX since CheckTx would already bump the sequence number.

NOTE: Since CheckTx and DeliverTx state are managed separately, subsequent and sequential txs orginating from the same account cannot be handled correctly in a reliable way unless sequence numbers are managed and tracked manually by a client. It is recommended to instead use multiple messages in a tx.

func NewIncrementSequenceDecorator added in v0.14.0

func NewIncrementSequenceDecorator(ak keeper.AccountKeeper, pkg PubKeyGetter) IncrementSequenceDecorator

func (IncrementSequenceDecorator) AnteHandle added in v0.14.0

func (isd IncrementSequenceDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (sdk.Context, error)

type IxoMsg

type IxoMsg interface {
	sdk.Msg
	GetSignerDid() exported.Did
}

type PubKeyGetter

type PubKeyGetter func(ctx sdk.Context, msg IxoMsg) (crypto.PubKey, error)

type SetPubKeyDecorator added in v0.14.0

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

func NewSetPubKeyDecorator added in v0.14.0

func NewSetPubKeyDecorator(ak keeper.AccountKeeper, pkg PubKeyGetter) SetPubKeyDecorator

func (SetPubKeyDecorator) AnteHandle added in v0.14.0

func (spkd SetPubKeyDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (sdk.Context, error)

type SigGasConsumeDecorator added in v0.14.0

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

Consume parameter-defined amount of gas for each signature according to the passed-in SignatureVerificationGasConsumer function before calling the next AnteHandler CONTRACT: Pubkeys are set in context for all signers before this decorator runs CONTRACT: Tx must implement SigVerifiableTx interface

func NewSigGasConsumeDecorator added in v0.14.0

func NewSigGasConsumeDecorator(ak keeper.AccountKeeper, sigGasConsumer ante.SignatureVerificationGasConsumer, pkg PubKeyGetter) SigGasConsumeDecorator

func (SigGasConsumeDecorator) AnteHandle added in v0.14.0

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

type SigVerificationDecorator added in v0.14.0

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

Verify all signatures for a tx and return an error if any are invalid. Note, the SigVerificationDecorator decorator will not get executed on ReCheck.

CONTRACT: Pubkeys are set in context for all signers before this decorator runs CONTRACT: Tx must implement SigVerifiableTx interface

func NewSigVerificationDecorator added in v0.14.0

func NewSigVerificationDecorator(ak keeper.AccountKeeper, pkg PubKeyGetter) SigVerificationDecorator

func (SigVerificationDecorator) AnteHandle added in v0.14.0

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL