confighelper

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package confighelper provides helpers for converting between the gethwrappers/OffchainAggregator.SetConfig event and types.ContractConfig

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContractSetConfigArgs

func ContractSetConfigArgs(
	deltaProgress time.Duration,
	deltaResend time.Duration,
	deltaRound time.Duration,
	deltaGrace time.Duration,
	deltaC time.Duration,
	alphaPPB uint64,
	deltaStage time.Duration,
	rMax uint8,
	s []int,
	oracles []OracleIdentityExtra,
	f int,
) (
	signers []common.Address,
	transmitters []common.Address,
	threshold uint8,
	encodedConfigVersion uint64,
	encodedConfig []byte,
	err error,
)

ContractSetConfigArgs generates setConfig args from the relevant parameters. Only use this for testing, *not* for production.

func ContractSetConfigArgsForIntegrationTest

func ContractSetConfigArgsForIntegrationTest(
	oracles []OracleIdentityExtra,
	f int,
	alphaPPB uint64,
) (
	signers []common.Address,
	transmitters []common.Address,
	threshold uint8,
	encodedConfigVersion uint64,
	encodedConfig []byte,
	err error,
)

ContractSetConfigArgsForIntegrationTest generates setConfig args for integration tests in core

Types

type OracleIdentity

type OracleIdentity struct {
	OnChainSigningAddress types.OnChainSigningAddress
	TransmitAddress       common.Address
	OffchainPublicKey     types.OffchainPublicKey
	PeerID                string
}

OracleIdentity is identical to the internal type in package config. We intentionally make a copy to make potential future internal modifications easier.

type OracleIdentityExtra

type OracleIdentityExtra struct {
	OracleIdentity
	SharedSecretEncryptionPublicKey types.SharedSecretEncryptionPublicKey
}

type PublicConfig

type PublicConfig struct {
	DeltaProgress    time.Duration
	DeltaResend      time.Duration
	DeltaRound       time.Duration
	DeltaGrace       time.Duration
	DeltaC           time.Duration
	AlphaPPB         uint64
	DeltaStage       time.Duration
	RMax             uint8
	S                []int
	OracleIdentities []OracleIdentity

	F            int
	ConfigDigest types.ConfigDigest
}

PublicConfig is identical to the internal type in package config. We intentionally make a copy to make potential future internal modifications easier.

func PublicConfigFromContractConfig

func PublicConfigFromContractConfig(chainID *big.Int, skipChainSpecificChecks bool, change types.ContractConfig) (PublicConfig, error)

func (PublicConfig) N

func (pc PublicConfig) N() int

Jump to

Keyboard shortcuts

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