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
- func CreateCrossChainTx(polySdk *sdk.PolySdk, polySigner *sdk.Account, userArgs []string) []byte
- func CreateCrossChainTxTendermint(polySdk *sdk.PolySdk, polySigner *sdk.Account, userArgs []string) []byte
- func EnsureArgsLength(args []string, expected int)
- func NewCodecForRelayer() *codec.LegacyAmino
- func SetUpPoly(conf *config.Config) (*sdk.PolySdk, error)
- func SetupPolySigner(conf *config.Config, polySdk *sdk.PolySdk) (*sdk.Account, error)
- func SignImportOuterTransfer(polySdk sdk.PolySdk, sourceChainId uint64, txData []byte, height uint32, ...) (*polytypes.Transaction, error)
- type CosmosHeader
- type CosmosValidator
Constants ¶
const DefaultArgsLength = 4
const TendermintArgsLength = 4
Variables ¶
This section is empty.
Functions ¶
func CreateCrossChainTx ¶ added in v0.2.0
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 NewCodecForRelayer ¶ added in v0.2.0
func NewCodecForRelayer() *codec.LegacyAmino
func SetupPolySigner ¶
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)