rpc

package
v0.24.0-xpla-rc1 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2024 License: LGPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

Copyright 2021 Evmos Foundation This file is part of Evmos' Ethermint library.

The Ethermint library 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 Ethermint library 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 Ethermint library. If not, see https://github.com/xpladev/ethermint/blob/main/LICENSE

Index

Constants

This section is empty.

Variables

View Source
var HOST = os.Getenv("HOST")

Functions

func DeployTestContract

func DeployTestContract(t *testing.T, addr []byte) (hexutil.Bytes, map[string]interface{})

deployTestContract deploys a contract that emits an event in the constructor

func DeployTestContractWithFunction

func DeployTestContractWithFunction(t *testing.T, addr []byte) hexutil.Bytes

func GetAddress

func GetAddress() ([]byte, error)

func GetGasPrice

func GetGasPrice(t *testing.T) string

func GetNonce

func GetNonce(t *testing.T, block string) hexutil.Uint64

func GetTransactionReceipt

func GetTransactionReceipt(t *testing.T, hash hexutil.Bytes) map[string]interface{}

func HexToBigInt

func HexToBigInt(t *testing.T, in string) *big.Int

turns a 0x prefixed hex string to a big.Int

func SendTestTransaction

func SendTestTransaction(t *testing.T, addr []byte) hexutil.Bytes

sendTestTransaction sends a dummy transaction

func UnlockAllAccounts

func UnlockAllAccounts(t *testing.T)

func WaitForReceipt

func WaitForReceipt(t *testing.T, hash hexutil.Bytes) map[string]interface{}

Types

type Error

type Error struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data,omitempty"`
}

type Request

type Request struct {
	Version string      `json:"jsonrpc"`
	Method  string      `json:"method"`
	Params  interface{} `json:"params"`
	ID      int         `json:"id"`
}

func CreateRequest

func CreateRequest(method string, params interface{}) Request

type Response

type Response struct {
	Error  *Error          `json:"error"`
	ID     int             `json:"id"`
	Result json.RawMessage `json:"result,omitempty"`
}

func Call

func Call(t *testing.T, method string, params interface{}) *Response

func CallWithError

func CallWithError(method string, params interface{}) (*Response, error)

func CallWithSleep

func CallWithSleep(t *testing.T, method string, params interface{}, sleep time.Duration) *Response

Jump to

Keyboard shortcuts

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