panacea

package
v0.0.0-...-59ccd6a Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2022 License: Apache-2.0 Imports: 46 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CoinType = 371
	HRP      = "panacea"
)

Variables

View Source
var (
	ErrEmptyKey             = fmt.Errorf("empty key")
	ErrEmptyValue           = fmt.Errorf("empty value")
	ErrNegativeOrZeroHeight = fmt.Errorf("negative or zero height")
)

Functions

func GetAccAddressFromBech32

func GetAccAddressFromBech32(address string) (addr sdk.AccAddress, err error)

Types

type GrpcClient

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

func NewGrpcClient

func NewGrpcClient(grpcAddr string) (*GrpcClient, error)

func (*GrpcClient) BroadcastTx

func (c *GrpcClient) BroadcastTx(txBytes []byte) (*tx.BroadcastTxResponse, error)

func (*GrpcClient) Close

func (c *GrpcClient) Close() error

type OracleAccount

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

func NewOracleAccount

func NewOracleAccount(mnemonic string, accNum, index uint32) (*OracleAccount, error)

NewOracleAccount returns an oracle account from mnemonic, account number, and index

func (OracleAccount) AccAddressFromBech32

func (oa OracleAccount) AccAddressFromBech32() sdk.AccAddress

func (OracleAccount) GetAddress

func (oa OracleAccount) GetAddress() string

func (OracleAccount) GetPrivKey

func (oa OracleAccount) GetPrivKey() cryptotypes.PrivKey

func (OracleAccount) GetPubKey

func (oa OracleAccount) GetPubKey() cryptotypes.PubKey

type QueryClient

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

func LoadQueryClient

func LoadQueryClient(ctx context.Context, config *config.Config) (*QueryClient, error)

func NewQueryClient

func NewQueryClient(ctx context.Context, config *config.Config, info TrustedBlockInfo) (*QueryClient, error)

NewQueryClient set QueryClient with rpcClient & and returns, if successful, a QueryClient that can be used to add query function.

func NewQueryClientWithDB

func NewQueryClientWithDB(ctx context.Context, config *config.Config, info *TrustedBlockInfo, db dbm.DB) (*QueryClient, error)

NewQueryClientWithDB creates a QueryClient using a provided DB. If TrustedBlockInfo exists, a new lightClient is created based on this information, and if TrustedBlockInfo is nil, a lightClient is created with information obtained from TrustedStore.

func (QueryClient) Close

func (q QueryClient) Close() error

func (QueryClient) GetAccount

func (q QueryClient) GetAccount(address string) (authtypes.AccountI, error)

GetAccount returns account from address.

func (QueryClient) GetDataSale

func (q QueryClient) GetDataSale(dataHash string, dealID uint64) (*datadealtypes.DataSale, error)

func (QueryClient) GetDeal

func (q QueryClient) GetDeal(dealID uint64) (*datadealtypes.Deal, error)

func (QueryClient) GetLightBlock

func (q QueryClient) GetLightBlock(height int64) (*tmtypes.LightBlock, error)

func (QueryClient) GetOracleParamsPublicKey

func (q QueryClient) GetOracleParamsPublicKey() (*btcec.PublicKey, error)

func (QueryClient) GetOracleRegistration

func (q QueryClient) GetOracleRegistration(oracleAddr, uniqueID string) (*oracletypes.OracleRegistration, error)

func (QueryClient) GetOracleUpgradeInfo

func (q QueryClient) GetOracleUpgradeInfo() (*oracletypes.OracleUpgradeInfo, error)

func (QueryClient) GetStoreData

func (q QueryClient) GetStoreData(ctx context.Context, storeKey string, key []byte) ([]byte, error)

GetStoreData get data from panacea with storeKey and key, then verify queried data with light client and merkle proof. the returned data type is ResponseQuery.value ([]byte), so recommend to convert to expected type

type TrustedBlockInfo

type TrustedBlockInfo struct {
	TrustedBlockHeight int64
	TrustedBlockHash   []byte
}

type TxBuilder

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

func NewTxBuilder

func NewTxBuilder(client QueryClient) *TxBuilder

func (TxBuilder) GenerateSignedTxBytes

func (tb TxBuilder) GenerateSignedTxBytes(
	privateKey cryptotypes.PrivKey,
	gasLimit uint64,
	feeAmount sdk.Coins,
	msg ...sdk.Msg,
) ([]byte, error)

GenerateSignedTxBytes signs msgs using the private key and returns the signed Tx message in form of byte array.

func (TxBuilder) GenerateTxBytes

func (tb TxBuilder) GenerateTxBytes(privKey cryptotypes.PrivKey, conf *config.Config, msg ...sdk.Msg) ([]byte, error)

GenerateTxBytes generates transaction byte array.

Jump to

Keyboard shortcuts

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