injective

package
v0.0.0-...-cce48a0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2021 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const ConfigDigestPrefixCosmos types.ConfigDigestPrefix = 2

Variables

This section is empty.

Functions

This section is empty.

Types

type CosmosMedianReporter

type CosmosMedianReporter struct {
	FeedId      string
	QueryClient chaintypes.QueryClient
}

func (*CosmosMedianReporter) LatestRoundRequested

func (c *CosmosMedianReporter) LatestRoundRequested(
	ctx context.Context,
	lookback time.Duration,
) (
	configDigest types.ConfigDigest,
	epoch uint32,
	round uint8,
	err error,
)

func (*CosmosMedianReporter) LatestTransmissionDetails

func (c *CosmosMedianReporter) LatestTransmissionDetails(
	ctx context.Context,
) (
	configDigest types.ConfigDigest,
	epoch uint32,
	round uint8,
	latestAnswer *big.Int,
	latestTimestamp time.Time,
	err error,
)

type CosmosModuleConfigTracker

type CosmosModuleConfigTracker struct {
	FeedId           string
	QueryClient      chaintypes.QueryClient
	TendermintClient tmclient.TendermintClient
}

func (*CosmosModuleConfigTracker) LatestBlockHeight

func (c *CosmosModuleConfigTracker) LatestBlockHeight(
	ctx context.Context,
) (
	blockHeight uint64,
	err error,
)

LatestBlockHeight returns the height of the most recent block in the chain.

func (*CosmosModuleConfigTracker) LatestConfig

func (c *CosmosModuleConfigTracker) LatestConfig(
	ctx context.Context,
	changedInBlock uint64,
) (types.ContractConfig, error)

LatestConfig returns the latest configuration.

func (*CosmosModuleConfigTracker) LatestConfigDetails

func (c *CosmosModuleConfigTracker) LatestConfigDetails(
	ctx context.Context,
) (
	changedInBlock uint64,
	configDigest types.ConfigDigest,
	err error,
)

LatestConfigDetails returns information about the latest configuration, but not the configuration itself.

func (*CosmosModuleConfigTracker) Notify

func (c *CosmosModuleConfigTracker) Notify() <-chan struct{}

Notify may optionally emit notification events when the contract's configuration changes. This is purely used as an optimization reducing the delay between a configuration change and its enactment. Implementors who don't care about this may simply return a nil channel.

The returned channel should never be closed.

type CosmosModuleTransmitter

type CosmosModuleTransmitter struct {
	FeedId       string
	QueryClient  chaintypes.QueryClient
	CosmosClient chainclient.CosmosClient
	ReportCodec  median_report.ReportCodec
}

func (*CosmosModuleTransmitter) FromAccount

func (c *CosmosModuleTransmitter) FromAccount() types.Account

func (*CosmosModuleTransmitter) LatestConfigDigestAndEpoch

func (c *CosmosModuleTransmitter) LatestConfigDigestAndEpoch(
	ctx context.Context,
) (
	configDigest types.ConfigDigest,
	epoch uint32,
	err error,
)

func (*CosmosModuleTransmitter) Transmit

func (c *CosmosModuleTransmitter) Transmit(
	ctx context.Context,
	reportCtx types.ReportContext,
	report types.Report,
	signatures []types.AttributedOnchainSignature,
) error

Transmit sends the report to the on-chain OCR2Aggregator smart contract's Transmit method

type CosmosOffchainConfigDigester

type CosmosOffchainConfigDigester struct {
	ChainID string
	FeedID  string
}

func (CosmosOffchainConfigDigester) ConfigDigest

func (CosmosOffchainConfigDigester) ConfigDigestPrefix

func (d CosmosOffchainConfigDigester) ConfigDigestPrefix() types.ConfigDigestPrefix

type InjectiveModuleOnchainKeyring

type InjectiveModuleOnchainKeyring struct {
	Signer  sdk.AccAddress
	Keyring keyring.Keyring
}

func (*InjectiveModuleOnchainKeyring) MaxSignatureLength

func (c *InjectiveModuleOnchainKeyring) MaxSignatureLength() int

Maximum length of a signature

func (*InjectiveModuleOnchainKeyring) PublicKey

PublicKey returns the acc address of the keypair used by Sign.

func (*InjectiveModuleOnchainKeyring) Sign

func (c *InjectiveModuleOnchainKeyring) Sign(
	reportCtx types.ReportContext,
	report types.Report,
) (signature []byte, err error)

Sign returns a signature over ReportContext and Report.

func (*InjectiveModuleOnchainKeyring) Verify

func (c *InjectiveModuleOnchainKeyring) Verify(
	acc types.OnchainPublicKey,
	reportCtx types.ReportContext,
	report types.Report,
	signature []byte,
) bool

Verify verifies a signature over ReportContext and Report allegedly created from OnchainPublicKey (acc address).

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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