Documentation
¶
Index ¶
- Constants
- Variables
- func AppendBytes(data ...[]byte) []byte
- func BroadcastMsgs(cliCtx context.CLIContext, msgs []sdk.Msg) (sdk.TxResponse, error)
- func BroadcastMsgsWithCLI(cliCtx context.CLIContext, msgs []sdk.Msg) error
- func BroadcastTx(cliCtx context.CLIContext, tx authTypes.StdTx, mode string) (res sdk.TxResponse, err error)
- func BroadcastTxBytes(cliCtx context.CLIContext, txBytes []byte, mode string) (sdk.TxResponse, error)
- func BuildAndBroadcastMsgs(cliCtx context.CLIContext, txBldr authTypes.TxBuilder, msgs []sdk.Msg, ...) (sdk.TxResponse, error)
- func BuildAndBroadcastMsgsWithCLI(cliCtx context.CLIContext, txBldr authTypes.TxBuilder, msgs []sdk.Msg) error
- func DecorateWithIrisFlags(cmd *cobra.Command, v *viper.Viper, loggerInstance logger.Logger, ...)
- func DecorateWithTendermintFlags(cmd *cobra.Command, v *viper.Viper, loggerInstance logger.Logger, ...)
- func EventByID(abiObject *abi.ABI, sigdata []byte) *abi.Event
- func ExponentialBackoff(action func() error, maxV uint, wait time.Duration) error
- func FetchFromAPI(cliCtx cliContext.CLIContext, URL string) (result rest.ResponseWithHeight, err error)
- func FetchSideTxSigs(client *httpClient.HTTP, height int64, txHash []byte, sideTxData []byte) ([][3]*big.Int, error)
- func FetchVotes(client *httpClient.HTTP, height int64) (votes []*tmTypes.CommitSig, sigs []byte, chainID string, err error)
- func FilterAttributes(attributes []sdk.Attribute, fn func(sdk.Attribute) bool) *sdk.Attribute
- func FilterEvents(events []sdk.StringEvent, fn func(sdk.StringEvent) bool) *sdk.StringEvent
- func GenerateAuthObj(client *ethclient.Client, address common.Address, data []byte) (auth *bind.TransactOpts, err error)
- func GetAalborgHardForkHeight() int64
- func GetAddress() []byte
- func GetAmountFromPower(power int64) (*big.Int, error)
- func GetBeginBlockEvents(client *httpClient.HTTP, height int64) ([]abci.Event, error)
- func GetBlock(cliCtx cosmosContext.CLIContext, height int64) (*ctypes.ResultBlock, error)
- func GetBlockWithClient(client *httpClient.HTTP, height int64) (*tmTypes.Block, error)
- func GetDanelawHeight() int64
- func GetECDSAPrivKey() *ecdsa.PrivateKey
- func GetFromAddress(cliCtx context.CLIContext) types.IrisAddress
- func GetGenesisDoc() tmTypes.GenesisDoc
- func GetIrisServerEndpoint(endpoint string) string
- func GetJorvikHeight() int64
- func GetLogsWriter(logsWriterFile string) io.Writer
- func GetMainChainRPCClient() *rpc.Client
- func GetMainClient() *ethclient.Client
- func GetMaticClient() *ethclient.Client
- func GetMaticGRPCClient() *zenagrpc.ZenaGRPCClient
- func GetMaticRPCClient() *rpc.Client
- func GetMerkleProofList(proof *merkle.SimpleProof) [][]byte
- func GetMilestoneZenaBlockHeight() uint64
- func GetNewHexToStringAlgoHeight() int64
- func GetNewSelectionAlgoHeight() int64
- func GetNodeStatus(cliCtx cosmosContext.CLIContext) (*ctypes.ResultStatus, error)
- func GetPowerFromAmount(amount *big.Int) (*big.Int, error)
- func GetPrivKey() secp256k1.PrivKeySecp256k1
- func GetPubKey() secp256k1.PubKeySecp256k1
- func GetPubObjects(pubkey crypto.PubKey) secp256k1.PubKeySecp256k1
- func GetSideTxSigs(txHash []byte, sideTxData []byte, unFilteredVotes []*tmTypes.CommitSig) (sigs [][3]*big.Int, err error)
- func GetSignedTxBytes(cliCtx context.CLIContext, txBldr authTypes.TxBuilder, msgs []sdk.Msg, ...) ([]byte, error)
- func GetSignedTxBytesWithCLI(cliCtx context.CLIContext, txBldr authTypes.TxBuilder, msgs []sdk.Msg) ([]byte, error)
- func GetSpanOverrideHeight() int64
- func GetStdTxBytes(cliCtx context.CLIContext, tx authTypes.StdTx) ([]byte, error)
- func GetTxDecoder(cdc *codec.Codec) sdk.TxDecoder
- func GetTxEncoder(cdc *codec.Codec) sdk.TxEncoder
- func GetUpdatedValidators(currentSet *hmTypes.ValidatorSet, validators []*hmTypes.Validator, ...) []*hmTypes.Validator
- func GetValidChains() []string
- func GetVoteBytes(unFilteredVotes []*tmTypes.CommitSig, chainID string) []byte
- func GetVoteSigs(unFilteredVotes []*tmTypes.CommitSig) (sigs []byte)
- func InitIrisConfig(homeDir string)
- func InitIrisConfigWith(homeDir string, irisConfigFileFromFLag string)
- func Paginate(numObjs, page, limit, defLimit int) (start, end int)
- func PrepareTxBuilder(cliCtx context.CLIContext, txBldr authTypes.TxBuilder) (authTypes.TxBuilder, error)
- func PrintUnsignedStdTx(cliCtx context.CLIContext, txBldr authTypes.TxBuilder, msgs []sdk.Msg) error
- func QueryTx(cliCtx cosmosContext.CLIContext, hashHexStr string) (sdk.TxResponse, error)
- func QueryTxWithProof(cliCtx cosmosContext.CLIContext, hash []byte) (*ctypes.ResultTx, error)
- func QueryTxsByEvents(cliCtx cosmosContext.CLIContext, tags []string, page, limit int) (*sdk.SearchTxsResult, error)
- func ReadStdTxFromFile(cdc *amino.Codec, filename string) (stdTx authTypes.StdTx, err error)
- func SetTestConfig(_conf Configuration)
- func SetTestPrivPubKey(privKey secp256k1.PrivKeySecp256k1)
- func SignStdTx(cliCtx context.CLIContext, stdTx authTypes.StdTx, appendSig bool, offline bool) (authTypes.StdTx, error)
- func TendermintTxDecode(txString string) ([]byte, error)
- func ToBytes32(x []byte) [32]byte
- func UnpackLog(abiObject *abi.ABI, out interface{}, event string, log *types.Log) error
- func UnpackSigAndVotes(payload []byte, abi abi.ABI) (votes []byte, sigs []byte, checkpointData []byte, err error)
- func UpdateTendermintConfig(tendermintConfig *cfg.Config, v *viper.Viper)
- func ValidateTxResult(cliCtx cosmosContext.CLIContext, resTx *ctypes.ResultTx) error
- func WriteConfigFile(configFilePath string, config *Configuration)
- func WriteGenesisFile(chain string, filePath string, cdc *codec.Codec) (bool, error)
- type ChainManagerAddressMigration
- type Configuration
- type ContractCaller
- func (c *ContractCaller) ApproveTokens(amount *big.Int, stakeManager common.Address, tokenAddress common.Address, ...) error
- func (c *ContractCaller) CheckIfBlocksExist(end uint64) bool
- func (c *ContractCaller) CurrentAccountStateRoot(stakingInfoInstance *stakinginfo.Stakinginfo) ([32]byte, error)
- func (c *ContractCaller) CurrentHeaderBlock(rootChainInstance *rootchain.Rootchain, childBlockInterval uint64) (uint64, error)
- func (c *ContractCaller) CurrentSpanNumber(validatorSetInstance *validatorset.Validatorset) (Number *big.Int)
- func (c *ContractCaller) CurrentStateCounter(stateSenderInstance *statesender.Statesender) (Number *big.Int)
- func (c *ContractCaller) DecodeNewHeaderBlockEvent(contractAddress common.Address, receipt *ethTypes.Receipt, logIndex uint64) (*rootchain.RootchainNewHeaderBlock, error)
- func (c *ContractCaller) DecodeSignerUpdateEvent(contractAddress common.Address, receipt *ethTypes.Receipt, logIndex uint64) (*stakinginfo.StakinginfoSignerChange, error)
- func (c *ContractCaller) DecodeSlashedEvent(contractAddress common.Address, receipt *ethTypes.Receipt, logIndex uint64) (*stakinginfo.StakinginfoSlashed, error)
- func (c *ContractCaller) DecodeStateSyncedEvent(contractAddress common.Address, receipt *ethTypes.Receipt, logIndex uint64) (*statesender.StatesenderStateSynced, error)
- func (c *ContractCaller) DecodeUnJailedEvent(contractAddress common.Address, receipt *ethTypes.Receipt, logIndex uint64) (*stakinginfo.StakinginfoUnJailed, error)
- func (c *ContractCaller) DecodeValidatorExitEvent(contractAddress common.Address, receipt *ethTypes.Receipt, logIndex uint64) (*stakinginfo.StakinginfoUnstakeInit, error)
- func (c *ContractCaller) DecodeValidatorJoinEvent(contractAddress common.Address, receipt *ethTypes.Receipt, logIndex uint64) (*stakinginfo.StakinginfoStaked, error)
- func (c *ContractCaller) DecodeValidatorStakeUpdateEvent(contractAddress common.Address, receipt *ethTypes.Receipt, logIndex uint64) (*stakinginfo.StakinginfoStakeUpdate, error)
- func (c *ContractCaller) DecodeValidatorTopupFeesEvent(contractAddress common.Address, receipt *ethTypes.Receipt, logIndex uint64) (*stakinginfo.StakinginfoTopUpFee, error)
- func (c *ContractCaller) GetBalance(address common.Address) (*big.Int, error)
- func (c *ContractCaller) GetBlockByNumber(ctx context.Context, blockNumber uint64) *ethTypes.Block
- func (c *ContractCaller) GetBlockNumberFromTxHash(tx common.Hash) (*big.Int, error)
- func (c *ContractCaller) GetCheckpointSign(txHash common.Hash) ([]byte, []byte, []byte, error)
- func (c *ContractCaller) GetConfirmedTxReceipt(tx common.Hash, requiredConfirmations uint64) (*ethTypes.Receipt, error)
- func (c *ContractCaller) GetHeaderInfo(number uint64, rootChainInstance *rootchain.Rootchain, ...) (root common.Hash, start uint64, end uint64, createdAt uint64, ...)
- func (c *ContractCaller) GetLastChildBlock(rootChainInstance *rootchain.Rootchain) (uint64, error)
- func (c *ContractCaller) GetMainChainBlock(blockNum *big.Int) (header *ethTypes.Header, err error)
- func (c *ContractCaller) GetMainChainBlockTime(ctx context.Context, blockNum uint64) (time.Time, error)
- func (c *ContractCaller) GetMainChainFinalizedBlock() (header *ethTypes.Header, err error)
- func (c *ContractCaller) GetMainTxReceipt(txHash common.Hash) (*ethTypes.Receipt, error)
- func (c *ContractCaller) GetMaticChainBlock(blockNum *big.Int) (header *ethTypes.Header, err error)
- func (c *ContractCaller) GetMaticTokenInstance(maticTokenAddress common.Address) (*erc20.Erc20, error)
- func (c *ContractCaller) GetMaticTxReceipt(txHash common.Hash) (*ethTypes.Receipt, error)
- func (c *ContractCaller) GetRootChainInstance(rootChainAddress common.Address) (*rootchain.Rootchain, error)
- func (c *ContractCaller) GetRootHash(start uint64, end uint64, checkpointLength uint64) ([]byte, error)
- func (c *ContractCaller) GetSlashManagerInstance(slashManagerAddress common.Address) (*slashmanager.Slashmanager, error)
- func (c *ContractCaller) GetSpanDetails(id *big.Int, validatorSetInstance *validatorset.Validatorset) (*big.Int, *big.Int, *big.Int, error)
- func (c *ContractCaller) GetStakeManagerInstance(stakingManagerAddress common.Address) (*stakemanager.Stakemanager, error)
- func (c *ContractCaller) GetStakingInfoInstance(stakingInfoAddress common.Address) (*stakinginfo.Stakinginfo, error)
- func (c *ContractCaller) GetStateReceiverInstance(stateReceiverAddress common.Address) (*statereceiver.Statereceiver, error)
- func (c *ContractCaller) GetStateSenderInstance(stateSenderAddress common.Address) (*statesender.Statesender, error)
- func (c *ContractCaller) GetValidatorInfo(valID types.ValidatorID, stakingInfoInstance *stakinginfo.Stakinginfo) (validator types.Validator, err error)
- func (c *ContractCaller) GetValidatorSetInstance(validatorSetAddress common.Address) (*validatorset.Validatorset, error)
- func (c *ContractCaller) GetVoteOnHash(start uint64, end uint64, milestoneLength uint64, hash string, ...) (bool, error)
- func (c *ContractCaller) GetZenaChainBlockAuthor(blockNum *big.Int) (*common.Address, error)
- func (c *ContractCaller) IsTxConfirmed(tx common.Hash, requiredConfirmations uint64) bool
- func (c *ContractCaller) SendCheckpoint(signedData []byte, sigs [][3]*big.Int, rootChainAddress common.Address, ...) (er error)
- func (c *ContractCaller) SendTick(signedData []byte, sigs []byte, slashManagerAddress common.Address, ...) (er error)
- func (c *ContractCaller) StakeFor(val common.Address, stakeAmount *big.Int, feeAmount *big.Int, ...) error
- type HTTPClient
- type IContractCaller
- type TestOpts
Constants ¶
const ( TendermintNodeFlag = "node" WithIrisConfigFlag = "iris-config" HomeFlag = "home" FlagClientHome = "home-client" OverwriteGenesisFlag = "overwrite-genesis" RestServerFlag = "rest-server" BridgeFlag = "bridge" LogLevel = "log_level" LogsWriterFileFlag = "logs_writer_file" SeedsFlag = "seeds" MainChain = "mainnet" MumbaiChain = "mumbai" AmoyChain = "amoy" LocalChain = "local" // iris-config flags MainRPCUrlFlag = "eth_rpc_url" ZenaRPCUrlFlag = "zena_rpc_url" ZenaGRPCUrlFlag = "zena_grpc_url" ZenaGRPCFlag = "zena_grpc_flag" TendermintNodeURLFlag = "tendermint_rpc_url" IrisServerURLFlag = "iris_rest_server" AmqpURLFlag = "amqp_url" CheckpointerPollIntervalFlag = "checkpoint_poll_interval" SyncerPollIntervalFlag = "syncer_poll_interval" NoACKPollIntervalFlag = "noack_poll_interval" ClerkPollIntervalFlag = "clerk_poll_interval" SpanPollIntervalFlag = "span_poll_interval" MilestonePollIntervalFlag = "milestone_poll_interval" MainchainGasLimitFlag = "main_chain_gas_limit" MainchainMaxGasPriceFlag = "main_chain_max_gas_price" NoACKWaitTimeFlag = "no_ack_wait_time" ChainFlag = "chain" // --- // TODO Move these to common client flags // BroadcastBlock defines a tx broadcasting mode where the client waits for // the tx to be committed in a block. BroadcastBlock = "block" // BroadcastSync defines a tx broadcasting mode where the client waits for // a CheckTx execution response only. BroadcastSync = "sync" // BroadcastAsync defines a tx broadcasting mode where the client returns // immediately. BroadcastAsync = "async" // RPC Endpoints DefaultMainRPCUrl = "http://localhost:9545" DefaultZenaRPCUrl = "http://localhost:8545" DefaultZenaGRPCUrl = "localhost:3131" // RPC Timeouts DefaultEthRPCTimeout = 5 * time.Second DefaultZenaRPCTimeout = 5 * time.Second // DefaultAmqpURL represents default AMQP url DefaultAmqpURL = "amqp://guest:guest@localhost:5672/" DefaultIrisServerURL = "http://0.0.0.0:1317" DefaultTendermintNodeURL = "http://0.0.0.0:26657" NoACKWaitTime = 1800 * time.Second // Time ack service waits to clear buffer and elect new proposer (1800 seconds ~ 30 mins) DefaultCheckpointerPollInterval = 5 * time.Minute DefaultSyncerPollInterval = 1 * time.Minute DefaultNoACKPollInterval = 1010 * time.Second DefaultClerkPollInterval = 10 * time.Second DefaultSpanPollInterval = 1 * time.Minute DefaultMilestonePollInterval = 30 * time.Second DefaultEnableSH = false DefaultSHStateSyncedInterval = 15 * time.Minute DefaultSHStakeUpdateInterval = 3 * time.Hour DefaultSHMaxDepthDuration = time.Hour DefaultMainchainGasLimit = uint64(5000000) DefaultMainchainMaxGasPrice = 400000000000 // 400 Gwei DefaultZenaChainID = "15001" DefaultLogsType = "json" DefaultChain = MainChain DefaultTendermintNode = "tcp://localhost:26657" DefaultMainnetSeeds = "" /* 547-byte string literal not displayed */ DefaultAmoyTestnetSeeds = "" /* 483-byte string literal not displayed */ // Deprecated: Mumbai Testnet is deprecated DefaultMumbaiTestnetSeeds = "" /* 180-byte string literal not displayed */ // Legacy value - DO NOT CHANGE // Maximum allowed event record data size LegacyMaxStateSyncSize = 100000 // New max state sync size after hardfork MaxStateSyncSize = 30000 //Milestone Length MilestoneLength = uint64(12) MilestonePruneNumber = uint64(100) MaticChainMilestoneConfirmation = uint64(16) //Milestone buffer Length MilestoneBufferLength = MilestoneLength * 5 MilestoneBufferTime = 256 * time.Second // Default Open Collector Endpoint DefaultOpenCollectorEndpoint = "localhost:4317" )
const APIBodyLimit = 128 * 1024 * 1024 // 128 MB
const ( // CommitTimeout commit timeout CommitTimeout = 2 * time.Minute )
const (
UnstakeInitEvent = "UnstakeInit"
)
smart contracts' events names
Variables ¶
var ( DefaultCLIHome = os.ExpandEnv("$HOME/.iriscli") DefaultNodeHome = os.ExpandEnv("$HOME/.irisd") MinBalance = big.NewInt(100000000000000000) // aka 0.1 Ether )
var ContractsABIsMap = make(map[string]*abi.ABI)
ContractsABIsMap is a cached map holding the ABIs of the contracts
var GenesisDoc tmTypes.GenesisDoc
GenesisDoc contains the genesis file
var Logger logger.Logger
Logger stores global logger object
var ZeroAddress = common.Address{}
ZeroAddress represents empty address
var ZeroHash = common.Hash{}
ZeroHash represents empty hash
var ZeroPubKey = hmTypes.PubKey{}
ZeroPubKey represents empty pub key
Functions ¶
func BroadcastMsgs ¶
func BroadcastMsgs(cliCtx context.CLIContext, msgs []sdk.Msg) (sdk.TxResponse, error)
BroadcastMsgs creates transaction and broadcasts it
func BroadcastMsgsWithCLI ¶
func BroadcastMsgsWithCLI(cliCtx context.CLIContext, msgs []sdk.Msg) error
BroadcastMsgsWithCLI creates message and sends tx Used from cli- waits till transaction is included in block
func BroadcastTx ¶
func BroadcastTx(cliCtx context.CLIContext, tx authTypes.StdTx, mode string) (res sdk.TxResponse, err error)
BroadcastTx broadcasts transaction
func BroadcastTxBytes ¶
func BroadcastTxBytes(cliCtx context.CLIContext, txBytes []byte, mode string) (sdk.TxResponse, error)
BroadcastTxBytes sends request to tendermint using CLI
func BuildAndBroadcastMsgs ¶
func BuildAndBroadcastMsgs(cliCtx context.CLIContext, txBldr authTypes.TxBuilder, msgs []sdk.Msg, testOpts ...*TestOpts, ) (sdk.TxResponse, error)
BuildAndBroadcastMsgs creates transaction and broadcasts it
func BuildAndBroadcastMsgsWithCLI ¶
func BuildAndBroadcastMsgsWithCLI(cliCtx context.CLIContext, txBldr authTypes.TxBuilder, msgs []sdk.Msg) error
BuildAndBroadcastMsgsWithCLI implements a utility function that facilitates sending a series of messages in a signed transaction given a TxBuilder and a QueryContext. It ensures that the account exists, has a proper number and sequence set. In addition, it builds and signs a transaction with the supplied messages. Finally, it broadcasts the signed transaction to a node.
func DecorateWithIrisFlags ¶
func DecorateWithIrisFlags(cmd *cobra.Command, v *viper.Viper, loggerInstance logger.Logger, caller string)
DecorateWithIrisFlags adds persistent flags for iris-config and bind flags with command
func DecorateWithTendermintFlags ¶
func DecorateWithTendermintFlags(cmd *cobra.Command, v *viper.Viper, loggerInstance logger.Logger, message string)
DecorateWithTendermintFlags creates tendermint flags for desired command and bind them to viper
func ExponentialBackoff ¶
ExponentialBackoff performs exponential backoff attempts on a given action
func FetchFromAPI ¶
func FetchFromAPI(cliCtx cliContext.CLIContext, URL string) (result rest.ResponseWithHeight, err error)
FetchFromAPI fetches data from any URL with limited read size
func FetchSideTxSigs ¶
func FetchSideTxSigs( client *httpClient.HTTP, height int64, txHash []byte, sideTxData []byte, ) ([][3]*big.Int, error)
FetchSideTxSigs fetches side tx sigs from it
func FetchVotes ¶
func FetchVotes( client *httpClient.HTTP, height int64, ) (votes []*tmTypes.CommitSig, sigs []byte, chainID string, err error)
FetchVotes fetches votes and extracts sigs from it
func FilterAttributes ¶
FilterAttributes filter attributes by fn
func FilterEvents ¶
func FilterEvents(events []sdk.StringEvent, fn func(sdk.StringEvent) bool) *sdk.StringEvent
FilterEvents filter events by fn
func GenerateAuthObj ¶
func GetAalborgHardForkHeight ¶ added in v0.1.5
func GetAalborgHardForkHeight() int64
GetAalborgHardForkHeight returns AalzenagHardForkHeight
func GetAmountFromPower ¶
GetAmountFromPower returns amount from power
func GetBeginBlockEvents ¶
GetBeginBlockEvents get block through per height
func GetBlock ¶
func GetBlock(cliCtx cosmosContext.CLIContext, height int64) (*ctypes.ResultBlock, error)
GetBlock returns a block
func GetBlockWithClient ¶
GetBlockWithClient get block through per height
func GetECDSAPrivKey ¶
func GetECDSAPrivKey() *ecdsa.PrivateKey
GetECDSAPrivKey return ecdsa private key
func GetFromAddress ¶
func GetFromAddress(cliCtx context.CLIContext) types.IrisAddress
GetFromAddress get from address
func GetGenesisDoc ¶
func GetGenesisDoc() tmTypes.GenesisDoc
func GetIrisServerEndpoint ¶
GetIrisServerEndpoint returns iris server endpoint
func GetLogsWriter ¶
func GetMainChainRPCClient ¶
GetMainChainRPCClient returns main chain RPC client
func GetMainClient ¶
GetMainClient returns main chain's eth client
func GetMaticClient ¶
GetMaticClient returns matic's eth client
func GetMaticGRPCClient ¶
func GetMaticGRPCClient() *zenagrpc.ZenaGRPCClient
GetMaticGRPCClient returns matic's gRPC client
func GetMaticRPCClient ¶
GetMaticRPCClient returns matic's RPC client
func GetMerkleProofList ¶
func GetMerkleProofList(proof *merkle.SimpleProof) [][]byte
GetMerkleProofList return proof array each proof has one byte for direction: 0x0 for left and 0x1 for right
func GetMilestoneZenaBlockHeight ¶
func GetMilestoneZenaBlockHeight() uint64
GetMilestoneZenaBlockHeight returns milestoneZenaBlockHeight
func GetNewHexToStringAlgoHeight ¶
func GetNewHexToStringAlgoHeight() int64
GetNewHexToStringAlgoHeight returns newHexToStringAlgoHeight
func GetNewSelectionAlgoHeight ¶
func GetNewSelectionAlgoHeight() int64
GetNewSelectionAlgoHeight returns newSelectionAlgoHeight
func GetNodeStatus ¶
func GetNodeStatus(cliCtx cosmosContext.CLIContext) (*ctypes.ResultStatus, error)
GetNodeStatus returns node status
func GetPowerFromAmount ¶
GetPowerFromAmount returns power from amount -- note that this will populate amount object
func GetPubObjects ¶
func GetPubObjects(pubkey crypto.PubKey) secp256k1.PubKeySecp256k1
GetPubObjects returns PubKeySecp256k1 public key
func GetSideTxSigs ¶
func GetSideTxSigs(txHash []byte, sideTxData []byte, unFilteredVotes []*tmTypes.CommitSig) (sigs [][3]*big.Int, err error)
GetSideTxSigs returns sigs bytes from vote by tx hash
func GetSignedTxBytes ¶
func GetSignedTxBytes(cliCtx context.CLIContext, txBldr authTypes.TxBuilder, msgs []sdk.Msg, testOpts ...*TestOpts, ) ([]byte, error)
GetSignedTxBytes returns signed tx bytes
func GetSignedTxBytesWithCLI ¶
func GetSignedTxBytesWithCLI(cliCtx context.CLIContext, txBldr authTypes.TxBuilder, msgs []sdk.Msg) ([]byte, error)
GetSignedTxBytesWithCLI returns signed tx bytes
func GetSpanOverrideHeight ¶
func GetSpanOverrideHeight() int64
GetSpanOverrideHeight returns spanOverrideHeight
func GetStdTxBytes ¶
GetStdTxBytes get tx bytes
func GetTxDecoder ¶
GetTxDecoder returns tx decoder
func GetTxEncoder ¶
GetTxEncoder returns tx encoder
func GetUpdatedValidators ¶
func GetUpdatedValidators( currentSet *hmTypes.ValidatorSet, validators []*hmTypes.Validator, ackCount uint64, ) []*hmTypes.Validator
GetUpdatedValidators updates validators in validator set
func GetVoteBytes ¶
GetVoteBytes returns vote bytes
func GetVoteSigs ¶
GetVoteSigs returns sigs bytes from vote
func InitIrisConfig ¶
func InitIrisConfig(homeDir string)
InitIrisConfig initializes with viper config (from iris configuration)
func InitIrisConfigWith ¶
InitIrisConfigWith initializes passed iris/tendermint config files
func Paginate ¶
Paginate returns the correct starting and ending index for a paginated query, given that client provides a desired page and limit of objects and the handler provides the total number of objects. If the start page is invalid, non-positive values are returned signaling the request is invalid.
NOTE: The start page is assumed to be 1-indexed.
func PrepareTxBuilder ¶
func PrepareTxBuilder(cliCtx context.CLIContext, txBldr authTypes.TxBuilder) (authTypes.TxBuilder, error)
PrepareTxBuilder populates a TxBuilder in preparation for the build of a Tx.
func PrintUnsignedStdTx ¶
func PrintUnsignedStdTx(cliCtx context.CLIContext, txBldr authTypes.TxBuilder, msgs []sdk.Msg) error
PrintUnsignedStdTx builds an unsigned StdTx and prints it to os.Stdout.
func QueryTx ¶
func QueryTx(cliCtx cosmosContext.CLIContext, hashHexStr string) (sdk.TxResponse, error)
QueryTx query tx from node
func QueryTxWithProof ¶
func QueryTxWithProof(cliCtx cosmosContext.CLIContext, hash []byte) (*ctypes.ResultTx, error)
QueryTxWithProof query tx with proof from node
func QueryTxsByEvents ¶
func QueryTxsByEvents(cliCtx cosmosContext.CLIContext, tags []string, page, limit int) (*sdk.SearchTxsResult, error)
QueryTxsByEvents performs a search for transactions for a given set of tags via Tendermint RPC. It returns a slice of Info object containing txs and metadata. An error is returned if the query fails.
func ReadStdTxFromFile ¶
ReadStdTxFromFile and decode a StdTx from the given filename. Can pass "-" to read from stdin.
func SetTestConfig ¶
func SetTestConfig(_conf Configuration)
TEST PURPOSE ONLY SetTestConfig sets test configuration
func SetTestPrivPubKey ¶
func SetTestPrivPubKey(privKey secp256k1.PrivKeySecp256k1)
TEST PURPOSE ONLY SetTestPrivPubKey sets test priv and pub key for testing
func SignStdTx ¶
func SignStdTx(cliCtx context.CLIContext, stdTx authTypes.StdTx, appendSig bool, offline bool) (authTypes.StdTx, error)
SignStdTx appends a signature to a StdTx and returns a copy of it. If appendSig is false, it replaces the signatures already attached with the new signature. Don't perform online validation or lookups if offline is true.
func TendermintTxDecode ¶
TendermintTxDecode decodes transaction string and return base tx object
func ToBytes32 ¶
ToBytes32 is a convenience method for converting a byte slice to a fix sized 32 byte array. This method will truncate the input if it is larger than 32 bytes.
func UnpackSigAndVotes ¶
func UnpackSigAndVotes(payload []byte, abi abi.ABI) (votes []byte, sigs []byte, checkpointData []byte, err error)
UnpackSigAndVotes Unpacks Sig and Votes from Tx Payload
func UpdateTendermintConfig ¶
UpdateTendermintConfig updates tenedermint config with flags and default values if needed
func ValidateTxResult ¶
func ValidateTxResult(cliCtx cosmosContext.CLIContext, resTx *ctypes.ResultTx) error
ValidateTxResult performs transaction verification.
func WriteConfigFile ¶
func WriteConfigFile(configFilePath string, config *Configuration)
WriteConfigFile renders config using the template and writes it to configFilePath.
Types ¶
type ChainManagerAddressMigration ¶
type ChainManagerAddressMigration struct {
MaticTokenAddress hmTypes.IrisAddress
RootChainAddress hmTypes.IrisAddress
StakingManagerAddress hmTypes.IrisAddress
SlashManagerAddress hmTypes.IrisAddress
StakingInfoAddress hmTypes.IrisAddress
StateSenderAddress hmTypes.IrisAddress
}
func GetChainManagerAddressMigration ¶
func GetChainManagerAddressMigration(blockNum int64) (ChainManagerAddressMigration, bool)
type Configuration ¶
type Configuration struct {
EthRPCUrl string `mapstructure:"eth_rpc_url"` // RPC endpoint for main chain
ZenaRPCUrl string `mapstructure:"zena_rpc_url"` // RPC endpoint for zena chain
ZenaGRPCUrl string `mapstructure:"zena_grpc_url"` // gRPC endpoint for zena chain
ZenaGRPCFlag bool `mapstructure:"zena_grpc_flag"` // gRPC flag for zena chain
TendermintRPCUrl string `mapstructure:"tendermint_rpc_url"` // tendemint node url
SubGraphUrl string `mapstructure:"sub_graph_url"` // sub graph url
EthRPCTimeout time.Duration `mapstructure:"eth_rpc_timeout"` // timeout for eth rpc
ZenaRPCTimeout time.Duration `mapstructure:"zena_rpc_timeout"` // timeout for zena rpc
AmqpURL string `mapstructure:"amqp_url"` // amqp url
IrisServerURL string `mapstructure:"iris_rest_server"` // iris server url
MainchainGasLimit uint64 `mapstructure:"main_chain_gas_limit"` // gas limit to mainchain transaction. eg....submit checkpoint.
MainchainMaxGasPrice int64 `mapstructure:"main_chain_max_gas_price"` // max gas price to mainchain transaction. eg....submit checkpoint.
// config related to bridge
CheckpointerPollInterval time.Duration `mapstructure:"checkpoint_poll_interval"` // Poll interval for checkpointer service to send new checkpoints or missing ACK
SyncerPollInterval time.Duration `mapstructure:"syncer_poll_interval"` // Poll interval for syncher service to sync for changes on main chain
NoACKPollInterval time.Duration `mapstructure:"noack_poll_interval"` // Poll interval for ack service to send no-ack in case of no checkpoints
ClerkPollInterval time.Duration `mapstructure:"clerk_poll_interval"`
SpanPollInterval time.Duration `mapstructure:"span_poll_interval"`
MilestonePollInterval time.Duration `mapstructure:"milestone_poll_interval"`
EnableSH bool `mapstructure:"enable_self_heal"` // Enable self healing
SHStateSyncedInterval time.Duration `mapstructure:"sh_state_synced_interval"` // Interval to self-heal StateSynced events if missing
SHStakeUpdateInterval time.Duration `mapstructure:"sh_stake_update_interval"` // Interval to self-heal StakeUpdate events if missing
SHMaxDepthDuration time.Duration `mapstructure:"sh_max_depth_duration"` // Max duration that allows to suggest self-healing is not needed
// wait time related options
NoACKWaitTime time.Duration `mapstructure:"no_ack_wait_time"` // Time ack service waits to clear buffer and elect new proposer
// Log related options
LogsType string `mapstructure:"logs_type"` // if true, enable logging in json format
LogsWriterFile string `mapstructure:"logs_writer_file"` // if given, Logs will be written to this file else os.Stdout
// current chain - newSelectionAlgoHeight depends on this
Chain string `mapstructure:"chain"`
}
Configuration represents iris config
func GetDefaultIrisConfig ¶
func GetDefaultIrisConfig() Configuration
GetDefaultIrisConfig returns configuration with default params
func (*Configuration) Merge ¶
func (c *Configuration) Merge(cc *Configuration)
func (*Configuration) UpdateWithFlags ¶
type ContractCaller ¶
type ContractCaller struct {
MainChainClient *ethclient.Client
MainChainRPC *rpc.Client
MainChainTimeout time.Duration
// MaticGrpcFlag is a flag to check if the client is grpc or not
MaticGrpcFlag bool
MaticChainClient *ethclient.Client
MaticChainRPC *rpc.Client
MaticGrpcClient *grpc.ZenaGRPCClient
MaticChainTimeout time.Duration
RootChainABI abi.ABI
StakingInfoABI abi.ABI
ValidatorSetABI abi.ABI
StateReceiverABI abi.ABI
StateSenderABI abi.ABI
StakeManagerABI abi.ABI
SlashManagerABI abi.ABI
MaticTokenABI abi.ABI
ReceiptCache *lru.Cache
ContractInstanceCache map[common.Address]interface{}
}
ContractCaller contract caller
func NewContractCaller ¶
func NewContractCaller() (contractCallerObj ContractCaller, err error)
NewContractCaller contract caller
func (*ContractCaller) ApproveTokens ¶
func (c *ContractCaller) ApproveTokens(amount *big.Int, stakeManager common.Address, tokenAddress common.Address, maticTokenInstance *erc20.Erc20) error
ApproveTokens approves matic token for stake
func (*ContractCaller) CheckIfBlocksExist ¶
func (c *ContractCaller) CheckIfBlocksExist(end uint64) bool
CheckIfBlocksExist - check if the given block exists on local chain
func (*ContractCaller) CurrentAccountStateRoot ¶
func (c *ContractCaller) CurrentAccountStateRoot(stakingInfoInstance *stakinginfo.Stakinginfo) ([32]byte, error)
CurrentAccountStateRoot get current account root from on chain
func (*ContractCaller) CurrentHeaderBlock ¶
func (c *ContractCaller) CurrentHeaderBlock(rootChainInstance *rootchain.Rootchain, childBlockInterval uint64) (uint64, error)
CurrentHeaderBlock fetches current header block
func (*ContractCaller) CurrentSpanNumber ¶
func (c *ContractCaller) CurrentSpanNumber(validatorSetInstance *validatorset.Validatorset) (Number *big.Int)
CurrentSpanNumber get current span
func (*ContractCaller) CurrentStateCounter ¶
func (c *ContractCaller) CurrentStateCounter(stateSenderInstance *statesender.Statesender) (Number *big.Int)
CurrentStateCounter get state counter
func (*ContractCaller) DecodeNewHeaderBlockEvent ¶
func (c *ContractCaller) DecodeNewHeaderBlockEvent(contractAddress common.Address, receipt *ethTypes.Receipt, logIndex uint64) (*rootchain.RootchainNewHeaderBlock, error)
DecodeNewHeaderBlockEvent represents new header block event
func (*ContractCaller) DecodeSignerUpdateEvent ¶
func (c *ContractCaller) DecodeSignerUpdateEvent(contractAddress common.Address, receipt *ethTypes.Receipt, logIndex uint64) (*stakinginfo.StakinginfoSignerChange, error)
DecodeSignerUpdateEvent represents sig update event
func (*ContractCaller) DecodeSlashedEvent ¶
func (c *ContractCaller) DecodeSlashedEvent(contractAddress common.Address, receipt *ethTypes.Receipt, logIndex uint64) (*stakinginfo.StakinginfoSlashed, error)
DecodeSlashedEvent represents tick ack on contract
func (*ContractCaller) DecodeStateSyncedEvent ¶
func (c *ContractCaller) DecodeStateSyncedEvent(contractAddress common.Address, receipt *ethTypes.Receipt, logIndex uint64) (*statesender.StatesenderStateSynced, error)
DecodeStateSyncedEvent decode state sync data
func (*ContractCaller) DecodeUnJailedEvent ¶
func (c *ContractCaller) DecodeUnJailedEvent(contractAddress common.Address, receipt *ethTypes.Receipt, logIndex uint64) (*stakinginfo.StakinginfoUnJailed, error)
DecodeUnJailedEvent represents unJail on contract
func (*ContractCaller) DecodeValidatorExitEvent ¶
func (c *ContractCaller) DecodeValidatorExitEvent(contractAddress common.Address, receipt *ethTypes.Receipt, logIndex uint64) (*stakinginfo.StakinginfoUnstakeInit, error)
DecodeValidatorExitEvent represents validator stake unStake event
func (*ContractCaller) DecodeValidatorJoinEvent ¶
func (c *ContractCaller) DecodeValidatorJoinEvent(contractAddress common.Address, receipt *ethTypes.Receipt, logIndex uint64) (*stakinginfo.StakinginfoStaked, error)
DecodeValidatorJoinEvent represents validator staked event
func (*ContractCaller) DecodeValidatorStakeUpdateEvent ¶
func (c *ContractCaller) DecodeValidatorStakeUpdateEvent(contractAddress common.Address, receipt *ethTypes.Receipt, logIndex uint64) (*stakinginfo.StakinginfoStakeUpdate, error)
DecodeValidatorStakeUpdateEvent represents validator stake update event
func (*ContractCaller) DecodeValidatorTopupFeesEvent ¶
func (c *ContractCaller) DecodeValidatorTopupFeesEvent(contractAddress common.Address, receipt *ethTypes.Receipt, logIndex uint64) (*stakinginfo.StakinginfoTopUpFee, error)
DecodeValidatorTopupFeesEvent represents topUp for fees tokens
func (*ContractCaller) GetBalance ¶
GetBalance get balance of account (returns big.Int balance won't fit in uint64)
func (*ContractCaller) GetBlockByNumber ¶
GetBlockByNumber returns blocks by number from child chain (zena)
func (*ContractCaller) GetBlockNumberFromTxHash ¶
GetBlockNumberFromTxHash gets block number of transaction
func (*ContractCaller) GetCheckpointSign ¶
GetCheckpointSign returns sigs input of committed checkpoint transaction
func (*ContractCaller) GetConfirmedTxReceipt ¶
func (c *ContractCaller) GetConfirmedTxReceipt(tx common.Hash, requiredConfirmations uint64) (*ethTypes.Receipt, error)
GetConfirmedTxReceipt returns confirmed tx receipt
func (*ContractCaller) GetHeaderInfo ¶
func (c *ContractCaller) GetHeaderInfo(number uint64, rootChainInstance *rootchain.Rootchain, childBlockInterval uint64) ( root common.Hash, start uint64, end uint64, createdAt uint64, proposer types.IrisAddress, err error, )
GetHeaderInfo get header info from checkpoint number
func (*ContractCaller) GetLastChildBlock ¶
func (c *ContractCaller) GetLastChildBlock(rootChainInstance *rootchain.Rootchain) (uint64, error)
GetLastChildBlock fetch current child block
func (*ContractCaller) GetMainChainBlock ¶
GetMainChainBlock returns main chain block header
func (*ContractCaller) GetMainChainBlockTime ¶
func (c *ContractCaller) GetMainChainBlockTime(ctx context.Context, blockNum uint64) (time.Time, error)
GetMainChainBlockTime returns main chain block time
func (*ContractCaller) GetMainChainFinalizedBlock ¶
func (c *ContractCaller) GetMainChainFinalizedBlock() (header *ethTypes.Header, err error)
GetMainChainFinalizedBlock returns finalized main chain block header (post-merge)
func (*ContractCaller) GetMainTxReceipt ¶
GetMainTxReceipt returns main tx receipt
func (*ContractCaller) GetMaticChainBlock ¶
GetMaticChainBlock returns child chain block header
func (*ContractCaller) GetMaticTokenInstance ¶
func (c *ContractCaller) GetMaticTokenInstance(maticTokenAddress common.Address) (*erc20.Erc20, error)
GetMaticTokenInstance returns stakingInfo contract instance for selected base chain
func (*ContractCaller) GetMaticTxReceipt ¶
GetMaticTxReceipt returns matic tx receipt
func (*ContractCaller) GetRootChainInstance ¶
func (c *ContractCaller) GetRootChainInstance(rootChainAddress common.Address) (*rootchain.Rootchain, error)
GetRootChainInstance returns RootChain contract instance for selected base chain
func (*ContractCaller) GetRootHash ¶
func (c *ContractCaller) GetRootHash(start uint64, end uint64, checkpointLength uint64) ([]byte, error)
GetRootHash get root hash from zena chain
func (*ContractCaller) GetSlashManagerInstance ¶
func (c *ContractCaller) GetSlashManagerInstance(slashManagerAddress common.Address) (*slashmanager.Slashmanager, error)
GetSlashManagerInstance returns slashManager contract instance for selected base chain
func (*ContractCaller) GetSpanDetails ¶
func (c *ContractCaller) GetSpanDetails(id *big.Int, validatorSetInstance *validatorset.Validatorset) ( *big.Int, *big.Int, *big.Int, error, )
GetSpanDetails get span details
func (*ContractCaller) GetStakeManagerInstance ¶
func (c *ContractCaller) GetStakeManagerInstance(stakingManagerAddress common.Address) (*stakemanager.Stakemanager, error)
GetStakeManagerInstance returns stakingInfo contract instance for selected base chain
func (*ContractCaller) GetStakingInfoInstance ¶
func (c *ContractCaller) GetStakingInfoInstance(stakingInfoAddress common.Address) (*stakinginfo.Stakinginfo, error)
GetStakingInfoInstance returns stakingInfo contract instance for selected base chain
func (*ContractCaller) GetStateReceiverInstance ¶
func (c *ContractCaller) GetStateReceiverInstance(stateReceiverAddress common.Address) (*statereceiver.Statereceiver, error)
GetStateReceiverInstance returns stakingInfo contract instance for selected base chain
func (*ContractCaller) GetStateSenderInstance ¶
func (c *ContractCaller) GetStateSenderInstance(stateSenderAddress common.Address) (*statesender.Statesender, error)
GetStateSenderInstance returns stakingInfo contract instance for selected base chain
func (*ContractCaller) GetValidatorInfo ¶
func (c *ContractCaller) GetValidatorInfo(valID types.ValidatorID, stakingInfoInstance *stakinginfo.Stakinginfo) (validator types.Validator, err error)
GetValidatorInfo get validator info
func (*ContractCaller) GetValidatorSetInstance ¶
func (c *ContractCaller) GetValidatorSetInstance(validatorSetAddress common.Address) (*validatorset.Validatorset, error)
GetValidatorSetInstance returns stakingInfo contract instance for selected base chain
func (*ContractCaller) GetVoteOnHash ¶
func (c *ContractCaller) GetVoteOnHash(start uint64, end uint64, milestoneLength uint64, hash string, milestoneID string) (bool, error)
GetVoteOnHash gets vote on hash from zena chain
func (*ContractCaller) GetZenaChainBlockAuthor ¶
GetZenaChainBlockAuthor returns the producer of the zena block
func (*ContractCaller) IsTxConfirmed ¶
func (c *ContractCaller) IsTxConfirmed(tx common.Hash, requiredConfirmations uint64) bool
IsTxConfirmed is tx confirmed
func (*ContractCaller) SendCheckpoint ¶
func (c *ContractCaller) SendCheckpoint(signedData []byte, sigs [][3]*big.Int, rootChainAddress common.Address, rootChainInstance *rootchain.Rootchain) (er error)
SendCheckpoint sends checkpoint to rootchain contract todo return err
func (*ContractCaller) SendTick ¶
func (c *ContractCaller) SendTick(signedData []byte, sigs []byte, slashManagerAddress common.Address, slashManagerInstance *slashmanager.Slashmanager) (er error)
SendTick sends slash tick to rootchain contract
func (*ContractCaller) StakeFor ¶
func (c *ContractCaller) StakeFor(val common.Address, stakeAmount *big.Int, feeAmount *big.Int, acceptDelegation bool, stakeManagerAddress common.Address, stakeManagerInstance *stakemanager.Stakemanager) error
StakeFor stakes for a validator
type HTTPClient ¶
var (
Client HTTPClient
)
type IContractCaller ¶
type IContractCaller interface {
GetHeaderInfo(headerID uint64, rootChainInstance *rootchain.Rootchain, childBlockInterval uint64) (root common.Hash, start, end, createdAt uint64, proposer types.IrisAddress, err error)
GetRootHash(start uint64, end uint64, checkpointLength uint64) ([]byte, error)
GetVoteOnHash(start uint64, end uint64, milestoneLength uint64, hash string, milestoneID string) (bool, error)
GetValidatorInfo(valID types.ValidatorID, stakingInfoInstance *stakinginfo.Stakinginfo) (validator types.Validator, err error)
GetLastChildBlock(rootChainInstance *rootchain.Rootchain) (uint64, error)
CurrentHeaderBlock(rootChainInstance *rootchain.Rootchain, childBlockInterval uint64) (uint64, error)
GetBalance(address common.Address) (*big.Int, error)
SendCheckpoint(signedData []byte, sigs [][3]*big.Int, rootChainAddress common.Address, rootChainInstance *rootchain.Rootchain) (err error)
SendTick(signedData []byte, sigs []byte, slashManagerAddress common.Address, slashManagerInstance *slashmanager.Slashmanager) (err error)
GetCheckpointSign(txHash common.Hash) ([]byte, []byte, []byte, error)
GetMainChainBlock(*big.Int) (*ethTypes.Header, error)
GetMaticChainBlock(*big.Int) (*ethTypes.Header, error)
GetZenaChainBlockAuthor(*big.Int) (*common.Address, error)
IsTxConfirmed(common.Hash, uint64) bool
GetConfirmedTxReceipt(common.Hash, uint64) (*ethTypes.Receipt, error)
GetBlockNumberFromTxHash(common.Hash) (*big.Int, error)
// decode header event
DecodeNewHeaderBlockEvent(common.Address, *ethTypes.Receipt, uint64) (*rootchain.RootchainNewHeaderBlock, error)
// decode validator events
DecodeValidatorTopupFeesEvent(common.Address, *ethTypes.Receipt, uint64) (*stakinginfo.StakinginfoTopUpFee, error)
DecodeValidatorJoinEvent(common.Address, *ethTypes.Receipt, uint64) (*stakinginfo.StakinginfoStaked, error)
DecodeValidatorStakeUpdateEvent(common.Address, *ethTypes.Receipt, uint64) (*stakinginfo.StakinginfoStakeUpdate, error)
DecodeValidatorExitEvent(common.Address, *ethTypes.Receipt, uint64) (*stakinginfo.StakinginfoUnstakeInit, error)
DecodeSignerUpdateEvent(common.Address, *ethTypes.Receipt, uint64) (*stakinginfo.StakinginfoSignerChange, error)
// decode state events
DecodeStateSyncedEvent(common.Address, *ethTypes.Receipt, uint64) (*statesender.StatesenderStateSynced, error)
// decode slashing events
DecodeSlashedEvent(common.Address, *ethTypes.Receipt, uint64) (*stakinginfo.StakinginfoSlashed, error)
DecodeUnJailedEvent(common.Address, *ethTypes.Receipt, uint64) (*stakinginfo.StakinginfoUnJailed, error)
GetMainTxReceipt(common.Hash) (*ethTypes.Receipt, error)
GetMaticTxReceipt(common.Hash) (*ethTypes.Receipt, error)
ApproveTokens(*big.Int, common.Address, common.Address, *erc20.Erc20) error
StakeFor(common.Address, *big.Int, *big.Int, bool, common.Address, *stakemanager.Stakemanager) error
CurrentAccountStateRoot(stakingInfoInstance *stakinginfo.Stakinginfo) ([32]byte, error)
// zena related contracts
CurrentSpanNumber(validatorSet *validatorset.Validatorset) (Number *big.Int)
GetSpanDetails(id *big.Int, validatorSet *validatorset.Validatorset) (*big.Int, *big.Int, *big.Int, error)
CurrentStateCounter(stateSenderInstance *statesender.Statesender) (Number *big.Int)
CheckIfBlocksExist(end uint64) bool
GetRootChainInstance(rootChainAddress common.Address) (*rootchain.Rootchain, error)
GetStakingInfoInstance(stakingInfoAddress common.Address) (*stakinginfo.Stakinginfo, error)
GetValidatorSetInstance(validatorSetAddress common.Address) (*validatorset.Validatorset, error)
GetStakeManagerInstance(stakingManagerAddress common.Address) (*stakemanager.Stakemanager, error)
GetSlashManagerInstance(slashManagerAddress common.Address) (*slashmanager.Slashmanager, error)
GetStateSenderInstance(stateSenderAddress common.Address) (*statesender.Statesender, error)
GetStateReceiverInstance(stateReceiverAddress common.Address) (*statereceiver.Statereceiver, error)
GetMaticTokenInstance(maticTokenAddress common.Address) (*erc20.Erc20, error)
}
IContractCaller represents contract caller
type TestOpts ¶
type TestOpts struct {
// contains filtered or unexported fields
}
func NewTestOpts ¶
func NewTestOpts(app abci.Application, chainId string) *TestOpts
func (*TestOpts) GetApplication ¶
func (t *TestOpts) GetApplication() abci.Application
func (*TestOpts) GetChainId ¶
func (*TestOpts) SetApplication ¶
func (t *TestOpts) SetApplication(app abci.Application)