app

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2022 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Overview

* Copyright (C) 2020 The poly network Authors * This file is part of The poly network library. * * The poly network is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * The poly network is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * You should have received a copy of the GNU Lesser General Public License * along with The poly network . If not, see <http://www.gnu.org/licenses/>.

* Copyright (C) 2020 The poly network Authors * This file is part of The poly network library. * * The poly network is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * The poly network is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * You should have received a copy of the GNU Lesser General Public License * along with The poly network . If not, see <http://www.gnu.org/licenses/>.

Index

Constants

View Source
const DefaultArgsLength = 4
View Source
const TendermintArgsLength = 4

Variables

This section is empty.

Functions

func CreateCrossChainTx added in v0.2.0

func CreateCrossChainTx(polySdk *sdk.PolySdk, polySigner *sdk.Account, userArgs []string) []byte

CreateCrossChainTx Forms the correct signed tx to be broadcasted by taking in the user args userArgs: <chainID> <txData> <height> <proof>

func CreateCrossChainTxTendermint added in v0.2.0

func CreateCrossChainTxTendermint(polySdk *sdk.PolySdk, polySigner *sdk.Account, userArgs []string) []byte

CreateCrossChainTxTendermint Forms the correct signed tx to be broadcasted by querying provided rpc URL for the details userArgs: <rpcURL> <chainID> <height> <ccmKeyHash>

func EnsureArgsLength added in v0.2.0

func EnsureArgsLength(args []string, expected int)

func NewCodecForRelayer added in v0.2.0

func NewCodecForRelayer() *codec.LegacyAmino

func SetUpPoly

func SetUpPoly(conf *config.Config) (*sdk.PolySdk, error)

func SetupPolySigner

func SetupPolySigner(conf *config.Config, polySdk *sdk.PolySdk) (*sdk.Account, error)

func SignImportOuterTransfer

func SignImportOuterTransfer(polySdk sdk.PolySdk, sourceChainId uint64, txData []byte, height uint32, proof []byte,
	relayerAddress []byte, HeaderOrCrossChainMsg []byte, signer *sdk.Account) (*polytypes.Transaction, error)

sourceChainID = eth chain id txData = rawdata height = any height that is > tx height + confirmation height proof = gotten from the eccd contract using proofKey (where key := crosstx.txIndex; keyBytes, err := eth.MappingKeyAt(key, "01"); proofKey := hexutil.Encode(keyBytes); relayerAddress = ethcommon.Hex2Bytes(this.polySigner.Address.ToHexString()) headerOrCrossChainMsg = not sure what this is yet but commitProof for eth is empty bytes ( []byte{} ), neo has something signer = ethcommon.Hex2Bytes(this.polySigner.Address.ToHexString()),

Types

type CosmosHeader added in v0.2.0

type CosmosHeader struct {
	Header  tmtypes.Header
	Commit  *tmtypes.Commit
	Valsets []*CosmosValidator
}

func GetCosmosHeader added in v0.2.0

func GetCosmosHeader(rpcClient *rpchttp.HTTP, height int64) (*CosmosHeader, error)

type CosmosValidator added in v0.2.0

type CosmosValidator struct {
	Address          tmtypes.Address    `json:"address"`
	PubKey           cryptotypes.PubKey `json:"pub_key"`
	VotingPower      int64              `json:"voting_power"`
	ProposerPriority int64              `json:"proposer_priority"`
}

Jump to

Keyboard shortcuts

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