integration

package
v5.3.0-alpha Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2024 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const ContractServerUrl = "http://localhost:3000"

Variables

View Source
var (
	DeployContract     = MakeGetAndDecodeFunc[ContractDeployed]("%s/v1/deployContract")
	DestroyContract    = MakeGetAndDecodeFunc[ContractDestroyed]("%s/v1/destroyContract?addr=%s")
	DeploySLVContract  = MakeGetAndDecodeFunc[ContractDeployed]("%s/v1/deploySLVContract")
	DestroySLVContract = MakeGetAndDecodeFunc[ContractDestroyed]("%s/v1/destroySLVContract?addr=%s")
	SendEth            = MakeGetAndDecodeFunc[Tx]("%s/v1/sendEth?to=%s&value=%s")
	GetStorageSlotKey  = MakeGetAndDecodeFunc[StorageKey]("%s/v1/getStorageKey?contract=%s&label=%s")
	IncrementCount     = MakeGetAndDecodeFunc[CountIncremented]("%s/v1/incrementCount%s?addr=%s")
	Create2Contract    = MakeGetAndDecodeFunc[ContractDeployed]("%s/v1/create2Contract?contract=%s&salt=%s")
)

Functions

func MakeGetAndDecodeFunc

func MakeGetAndDecodeFunc[R any](format string) func(...interface{}) (*R, error)

Factory which creates endpoint functions

Types

type ContractDeployed

type ContractDeployed struct {
	Address         common.Address `json:"address"`
	TransactionHash common.Hash    `json:"txHash"`
	BlockNumber     int64          `json:"blockNumber"`
	BlockHash       common.Hash    `json:"blockHash"`
}

type ContractDestroyed

type ContractDestroyed struct {
	BlockNumber int64 `json:"blockNumber"`
}

type CountIncremented

type CountIncremented struct {
	BlockNumber *big.Int `json:"blockNumber"`
}

type StorageKey

type StorageKey struct {
	Key string `json:"key"`
}

type Tx

type Tx struct {
	From            string   `json:"from"`
	To              string   `json:"to"`
	Value           *big.Int `json:"value"`
	TransactionHash string   `json:"txHash"`
	BlockNumber     int64    `json:"blockNumber"`
	BlockHash       string   `json:"blockHash"`
}

Jump to

Keyboard shortcuts

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