tools

package
v0.0.0-...-e558250 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2020 License: GPL-3.0 Imports: 26 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/>.

* 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/>.

* 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

This section is empty.

Variables

This section is empty.

Functions

func EncodeBigInt

func EncodeBigInt(b *big.Int) string

func GetCurveLabel

func GetCurveLabel(name string) (byte, error)

func GetExplorerUrl

func GetExplorerUrl(chainId uint64) string

func GetNoCompresskey

func GetNoCompresskey(key keypair.PublicKey) []byte

func GetNodeHeader

func GetNodeHeader(url string, restClient *RestClient, height uint64) ([]byte, error)

func GetNodeHeight

func GetNodeHeight(url string, restClient *RestClient) (uint64, error)

func GetProof

func GetProof(url string, contractAddress string, key string, blockheight string, restClient *RestClient) ([]byte, error)

func ParseAuditpath

func ParseAuditpath(path []byte) ([]byte, []byte, [][32]byte, error)

Types

type ETHProof

type ETHProof struct {
	Address       string         `json:"address"`
	Balance       string         `json:"balance"`
	CodeHash      string         `json:"codeHash"`
	Nonce         string         `json:"nonce"`
	StorageHash   string         `json:"storageHash"`
	AccountProof  []string       `json:"accountProof"`
	StorageProofs []StorageProof `json:"storageProof"`
}

type NonceManager

type NonceManager struct {
	// contains filtered or unexported fields
}

func NewNonceManager

func NewNonceManager(ethClient *ethclient.Client) *NonceManager

func (*NonceManager) DecreaseAddressNonce

func (this *NonceManager) DecreaseAddressNonce(address common.Address)

func (*NonceManager) GetAddressNonce

func (this *NonceManager) GetAddressNonce(address common.Address) uint64

return account nonce, and than nonce++

func (*NonceManager) ReturnNonce

func (this *NonceManager) ReturnNonce(addr common.Address, nonce uint64)

type RestClient

type RestClient struct {
	Addr string
	// contains filtered or unexported fields
}

func NewRestClient

func NewRestClient() *RestClient

func (*RestClient) SendRestRequest

func (self *RestClient) SendRestRequest(addr string, data []byte) ([]byte, error)

func (*RestClient) SetAddr

func (self *RestClient) SetAddr(addr string) *RestClient

func (*RestClient) SetRestClient

func (self *RestClient) SetRestClient(restClient *http.Client) *RestClient

type SortedNonceArr

type SortedNonceArr []uint64

func (SortedNonceArr) Len

func (arr SortedNonceArr) Len() int

func (SortedNonceArr) Less

func (arr SortedNonceArr) Less(i, j int) bool

func (SortedNonceArr) Swap

func (arr SortedNonceArr) Swap(i, j int)

type StorageProof

type StorageProof struct {
	Key   string   `json:"key"`
	Value string   `json:"value"`
	Proof []string `json:"proof"`
}

Jump to

Keyboard shortcuts

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