package
0.0.0-20220620005849-a315113d9162
Repository: https://github.com/mycodeku/transtionhelper.git
Documentation: pkg.go.dev
# Packages
No description provided by the author
No description provided by the author
Package errors provides a shared set of errors for use in the SDK, aliases functionality in the github.com/mycodeku/transtionhelper/errors module that used to be in this package, and provides some helpers for converting errors to ABCI response code.
No description provided by the author
No description provided by the author
Package module contains application module patterns and associated "manager" functionality.
No description provided by the author
No description provided by the author
No description provided by the author
Package tx is a reverse proxy.
# Functions
AccAddressFromBech32 creates an AccAddress from a Bech32 string.
AccAddressFromHex creates an AccAddress from a hex string.
Bech32ifyAddressBytes returns a bech32 representation of address bytes.
BigEndianToUint64 returns an uint64 from big endian encoded bytes.
ChainDecorator chains AnteDecorators together with each AnteDecorator wrapping over the decorators further along chain and returns a single AnteHandler.
ConsAddressFromBech32 creates a ConsAddress from a Bech32 string.
ConsAddressFromHex creates a ConsAddress from a hex string.
ConvertCoin attempts to convert a coin to a given denomination.
ConvertDecCoin attempts to convert a decimal coin to a given denomination.
copy bytes.
No description provided by the author
intended to be used with require/assert: require.True(DecEq(...)).
test if two decimal arrays are equal.
DefaultCoinDenomRegex returns the default regex string.
DiffKVStores compares two KVstores and returns all the key/value pairs that differ from one another.
EmptyEvents returns an empty slice of events.
FormatInvariant returns a standardized invariant message.
Formats a time.Time into a []byte that can be sorted.
GetBaseDenom returns the denom of smallest unit registered.
GetConfig returns the config instance for the SDK.
get ConsAddress from pubkey.
GetDenomUnit returns a unit for a given denomination if it exists.
GetFromBech32 decodes a bytestring from a Bech32 encoded string.
GetSealedConfig returns the config instance for the SDK if/once it is sealed.
InclusiveEndBytes returns the []byte that would end a range query such that the input would be included.
intended to be used with require/assert: require.True(IntEq(...)).
No description provided by the author
Iterator over all the keys with a certain prefix in ascending order.
KVStorePrefixIteratorPaginated returns iterator over items in the selected page.
Iterator over all the keys with a certain prefix in descending order.
KVStoreReversePrefixIteratorPaginated returns iterator over items in the selected page.
MarkEventsToIndex returns the set of ABCI events, where each event's attribute has it's index value marked based on the provided set of events to index.
maximum decimal between two.
MaxInt returns the maximum between two integers.
Return the maximum of the Uints.
minimum decimal between two.
return the minimum of the ints.
Return the minimum of the Uints.
MsgTypeURL returns the TypeURL of a `sdk.Msg`.
MustBech32ifyAddressBytes returns a bech32 representation of address bytes.
Decimal from string, panic on error.
MustSortJSON is like SortJSON but panic if an error occurs, e.g., if the passed JSON isn't valid.
No description provided by the author
NewAttribute returns a new key/value Attribute object.
NewCoin returns a new coin with a denomination and amount.
NewCoins constructs a new coin set.
New returns a new Config with default values.
create a new context.
create a new Dec from integer assuming whole number.
NewDecCoin creates a new DecCoin instance from an Int.
NewDecCoinFromCoin creates a new DecCoin from a Coin.
NewDecCoinFromDec creates a new DecCoin instance from a Dec.
NewDecCoins constructs a new coin set with with decimal values from DecCoins.
NewDecCoinsFromCoins constructs a new coin set with decimal values from regular Coins.
create a new Dec from big integer assuming whole numbers CONTRACT: prec <= Precision.
create a new Dec from big integer assuming whole numbers CONTRACT: prec <= Precision.
create a new Dec from big integer assuming whole numbers CONTRACT: prec <= Precision.
create a new Dec from big integer with decimal place at prec CONTRACT: prec <= Precision.
create a decimal from an input decimal string.
create a new Dec from integer with decimal place at prec CONTRACT: prec <= Precision.
NewEvent creates a new Event object with a given type and slice of one or more attributes.
No description provided by the author
No description provided by the author
No description provided by the author
NewInt constructs Int from int64.
NewInt64Coin returns a new coin with a denomination and amount.
NewInt64DecCoin returns a new DecCoin with a denomination and amount.
NewIntFromBigInt constructs Int from big.Int.
NewIntFromString constructs Int from string.
NewIntFromUint64 constructs an Int from a uint64.
NewIntWithDecimal constructs Int with decimal Result value is n*10^dec.
NewKVStoreKey returns a new pointer to a KVStoreKey.
NewKVStoreKeys returns a map of new pointers to KVStoreKey's.
NewLevelDB instantiate a new LevelDB instance according to DBBackend.
NewMemoryStoreKeys constructs a new map matching store key names to their respective MemoryStoreKey references.
NewResponseFormatBroadcastTx returns a TxResponse given a ResultBroadcastTx from tendermint.
NewResponseFormatBroadcastTxCommit returns a TxResponse given a ResultBroadcastTxCommit from tendermint.
NewResponseResultTx returns a TxResponse given a ResultTx from tendermint.
NewRoute returns an instance of Route.
No description provided by the author
Constructs new TransientStoreKey Must return a pointer according to the ocap principle.
NewTransientStoreKeys constructs a new map of TransientStoreKey's Must return pointers according to the ocap principle The function will panic if there is a potential conflict in names (see `assertNoPrefix` function for more details).
NewUint constructs Uint from int64.
NewUintFromBigUint constructs Uint from big.Uint.
NewUintFromString constructs Uint from string.
NormalizeCoin try to convert a coin to the smallest unit registered, returns original one if failed.
NormalizeCoins normalize and truncate a list of decimal coins.
NormalizeDecCoin try to convert a decimal coin to the smallest unit registered, returns original one if failed.
No description provided by the author
OneInt returns Int value with one.
OneUint returns Uint value with one.
ParseABCILogs attempts to parse a stringified ABCI tx log into a slice of ABCIMessageLog types.
ParseCoinNormalized parses and normalize a cli input for one coin type, returning errors if invalid or on an empty string as well.
ParseCoinsNormalized will parse out a list of coins separated by commas, and normalize them by converting to smallest unit.
ParseDecCoin parses a decimal coin from a string, returning an error if invalid.
ParseDecCoins will parse out a list of decimal coins separated by commas.
Parses a []byte encoded using FormatTimeKey back into a time.Time.
ParseTypedEvent converts abci.Event back to typed event.
ParseUint reads a string-encoded Uint value and return a Uint.
PrefixEndBytes returns the []byte that would end a range query for all []byte with a certain prefix Deals with last byte of prefix being FF without overflowing.
RegisterDenom registers a denomination with a corresponding unit.
RegisterInterfaces registers the sdk message type.
RegisterLegacyAminoCodec registers the sdk message type.
RelativePow raises x to the power of n, where x (and the result, z) are scaled by factor b for example, RelativePow(210, 2, 100) = 441 (2.1^2 = 4.41).
SetCoinDenomRegex allows for coin's custom validation by overriding the regular expression string used for denom validation.
No description provided by the author
SortableDecBytes returns a byte slice representation of a Dec that can be sorted.
SortedJSON takes any JSON and returns it sorted by keys.
StringifyEvent converts an Event object to a StringEvent object.
StringifyEvents converts a slice of Event objects into a slice of StringEvent objects.
TokensFromConsensusPower - convert input power to tokens.
TokensToConsensusPower - convert input tokens to potential consensus-engine power.
TypedEventToEvent takes typed event and converts to Event object.
Uint64ToBigEndian - marshals uint64 to a bigendian byte slice so it can be sorted.
UintOverflow returns true if a given unsigned integer overflows and false otherwise.
UnwrapSDKContext retrieves a Context from a context.Context instance attached with WrapSDKContext.
ValAddressFromBech32 creates a ValAddress from a Bech32 string.
ValAddressFromHex creates a ValAddress from a hex string.
ValidateDenom is the default validation function for Coin.Denom.
ValidSortableDec ensures that a Dec is within the sortable bounds, a Dec can't have a precision of less than 10^-18.
VerifyAddressFormat verifies that the provided bytes form a valid address according to the default address rules or a custom address verifier set by GetConfig().SetAddressVerifier().
WrapSDKContext returns a stdlib context.Context with the provided sdk.Context's internal context as a value.
WrapServiceResult wraps a result from a protobuf RPC service method call in a Result object or error.
No description provided by the author
ZeroInt returns Int value with zero.
ZeroUint returns unsigned zero.
# Constants
Bech32MainPrefix defines the main SDK Bech32 prefix of an account's address.
Bech32PrefixAccAddr defines the Bech32 prefix of an account's address.
Bech32PrefixAccPub defines the Bech32 prefix of an account's public key.
Bech32PrefixConsAddr defines the Bech32 prefix of a consensus node address.
Bech32PrefixConsPub defines the Bech32 prefix of a consensus node public key.
Bech32PrefixValAddr defines the Bech32 prefix of a validator's operator address.
Bech32PrefixValPub defines the Bech32 prefix of a validator's operator public key.
CoinType is the ATOM coin type as defined in SLIP44 (https://github.com/satoshilabs/slips/blob/master/slip-0044.md).
bytes required to represent the above precision Ceiling[Log2[999 999 999 999 999 999]].
default bond denomination.
DefaultKeyringServiceName defines a default service name for the keyring.
FullFundraiserPath is the parts of the BIP44 HD path that are fixed by what we used during the ATOM fundraiser.
MsgInterfaceProtoName defines the protobuf name of the cosmos Msg interface.
number of decimal places.
PrefixAccount is the prefix for account keys.
PrefixAddress is the prefix for addresses.
PrefixConsensus is the prefix for consensus keys.
PrefixOperator is the prefix for operator keys.
PrefixPublic is the prefix for public keys.
PrefixValidator is the prefix for validator keys.
Purpose is the ATOM purpose as defined in SLIP44 (https://github.com/satoshilabs/slips/blob/master/slip-0044.md).
SdkContextKey is the key in the context.Context which holds the sdk.Context.
Slight modification of the RFC3339Nano but it right pads all zeros and drops the time zone info.
Delay, in blocks, between when validator updates are returned to the consensus-engine and when they are applied.
# Variables
Common event types and attribute keys.
Common event types and attribute keys.
Common event types and attribute keys.
Common event types and attribute keys.
Common event types and attribute keys.
Common event types and attribute keys.
Common event types and attribute keys.
Deprecated: Use tendermint config's DBBackend value instead.
DefaultPowerReduction is the default amount of staking tokens required for 1 unit of consensus-engine power.
Decimal errors.
No description provided by the author
No description provided by the author
Decimal errors.
Decimal errors.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Common event types and attribute keys.
Common event types and attribute keys.
IsAlpha defines regular expression to check if the string has alphabetic characters only.
IsAlphaLower defines regular expression to check if the string has lowercase alphabetic characters only.
IsAlphaNumeric defines a regular expression for matching against alpha-numeric values.
IsAlphaUpper defines regular expression to check if the string has uppercase alphabetic characters only.
IsNumeric defines regular expression to check if the string has numeric characters only.
MaxSortableDec is the largest Dec that can be passed into SortableDecBytes() Its negative form is the least Dec that can be passed in.
# Structs
ABCIMessageLog defines a structure containing an indexed tx ABCI message log.
Attribute defines an attribute wrapper where the key and value are strings instead of raw bytes.
Coin defines a token with a denomination and an amount.
Config is the structure that holds the SDK configuration parameters.
Context is an immutable object contains all information needed to
process a request.
NOTE: never use new(Dec) or else we will panic unmarshalling into the nil embedded big.Int.
DecCoin defines a token with a denomination and a decimal amount.
DecProto defines a Protobuf wrapper around a Dec object.
EventManager implements a simple wrapper around a slice of Event objects that can be emitted from.
GasInfo defines tx execution gas context.
Int wraps big.Int with a 257 bit range bound Checks overflow, underflow and division by zero Exists in range from -(2^256 - 1) to 2^256 - 1.
IntProto defines a Protobuf wrapper around an Int object.
MsgData defines the data returned in a Result object during message execution.
Result is the union of ResponseFormat and ResponseCheckTx.
No description provided by the author
SearchTxsResult defines a structure for querying txs pageable.
SimulationResponse defines the response generated when a transaction is successfully simulated.
StringEvent defines en Event object wrapper where all the attributes contain key/value pairs that are strings instead of raw bytes.
Terminator AnteDecorator will get added to the chain to simplify decorator code Don't need to check if next == nil further up the chain ______ <((((((\\\ / .
TxMsgData defines a list of MsgData.
TxResponse defines a structure containing relevant tx data and metadata.
Uint wraps integer with 256 bit range bound Checks overflow, underflow and division by zero Exists in range from 0 to 2^256-1.
# Interfaces
Address is a common interface for different types of addresses used by the SDK.
AnteDecorator wraps the next AnteHandler to perform custom pre- and post-processing.
CustomProtobufType defines the interface custom gogo proto types must implement in order to be used as a "customtype" extension.
No description provided by the author
No description provided by the author
expected interface for registering invariants.
No description provided by the author
QueryRouter provides queryables for each query path.
Router provides handlers for each transaction type.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Type aliases
ABCIMessageLogs represents a slice of ABCIMessageLog.
AccAddress a wrapper around bytes meant to represent an account address.
AnteHandler authenticates transactions, before their internal messages are handled.
BeginBlocker runs code before the transactions in a block
Note: applications which set create_empty_blocks=false will not have regular block timing and should use e.g.
No description provided by the author
Coins is a set of Coin, one per currency.
No description provided by the author
No description provided by the author
No description provided by the author
ConsAddress defines a wrapper around bytes meant to present a consensus node.
ContextKey defines a type alias for a stdlib Context key.
DecCoins defines a slice of coins with decimal values.
EndBlocker runs code after the transactions in a block and return updates to the validator set
Note: applications which set create_empty_blocks=false will not have regular block timing and should use e.g.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Handler defines the core of the state transition function of an application.
InitChainer initializes application state at genesis.
An Invariant is a function which tests a particular invariant.
Invariants defines a group of invariants.
No description provided by the author
key-value result for iterator queries.
No description provided by the author
No description provided by the author
No description provided by the author
PeerFilter responds to p2p filtering queries from Tendermint.
No description provided by the author
Querier defines a function type that a module querier must implement to handle custom client queries.
No description provided by the author
Proposed rename, not done to avoid API breakage.
No description provided by the author
StoreDecoderRegistry defines each of the modules store decoders.
No description provided by the author
TraceContext contains TraceKVStore context data.
TxDecoder unmarshals transaction bytes.
TxEncoder marshals transaction to bytes.
ValAddress defines a wrapper around bytes meant to present a validator's operator.