util

package
v1.0.0-prerelease-2 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: Apache-2.0 Imports: 44 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	GENESIS_TS   = uint64(1598306430)
	T_GENESIS_TS = uint64(1667326410)
)
View Source
var DIAL_ADDR = ""
View Source
var TOKEN = ""
View Source
var WAD = big.NewInt(1000000000000000000)

Functions

func ConvertSectorType

func ConvertSectorType(sector *miner.SectorOnChainInfo) *miner8.SectorOnChainInfo

the SimpleQAPower bool is missing here on the conversion

func DelegatedFromEthAddr

func DelegatedFromEthAddr(addr common.Address) (address.Address, error)

func DeriveAddrFromPk

func DeriveAddrFromPk(pk *ecdsa.PrivateKey) (common.Address, address.Address, error)

func DeriveAddrFromPkString

func DeriveAddrFromPkString(pk string) (common.Address, address.Address, error)

func DeriveAddressFromPk

func DeriveAddressFromPk(pk *ecdsa.PrivateKey) (common.Address, error)

func DeriveNativeFromSECP256K1KeyString

func DeriveNativeFromSECP256K1KeyString(pk string) (address.Address, error)

derives a native filecoin f1 addr from a private key string

func EpochHeightToTimestamp

func EpochHeightToTimestamp(height *big.Int, chainID *big.Int) time.Time

func HumanReadableRevert

func HumanReadableRevert(errMsg error) error

func IsZeroAddress

func IsZeroAddress(address common.Address) bool

IsZeroAddress validate if it's a 0 address

func MethodStrToBytes

func MethodStrToBytes(methodStr constants.Method) ([4]byte, error)

func MsigProposeFEVMTx

func MsigProposeFEVMTx(
	ctx context.Context,
	senderAddr address.Address,
	msigAddr address.Address,
	contractAddr common.Address,
	nonce uint64,
	abi *abi.ABI,
	methodName string,
	args []interface{},
) (*ltypes.Message, error)

func MsigProposeFEVMTxWithValue

func MsigProposeFEVMTxWithValue(
	ctx context.Context,
	senderAddr address.Address,
	msigAddr address.Address,
	contractAddr common.Address,
	nonce uint64,
	abi *abi.ABI,
	methodName string,
	args []interface{},
	value *big.Int,
) (*ltypes.Message, error)

func Multiread

func Multiread(tasks []TaskFunc) ([]interface{}, error)

@dev executes a list of tasks in parallel and returns the results.

func SetupSuite

func SetupSuite(t *testing.T) (*api.FullNodeStruct, jsonrpc.ClientCloser)

func SimulateFVMMsg

func SimulateFVMMsg(ctx context.Context, msg *filtypes.Message, lClient *lotusapi.FullNodeStruct) error

func StringifyArg

func StringifyArg(arg interface{}) string

func TeardownSuite

func TeardownSuite(close jsonrpc.ClientCloser)

func ToAtto

func ToAtto(bal *big.Float) *big.Int

func ToByte4Selector

func ToByte4Selector(bytes []byte) [4]byte

func ToFIL

func ToFIL(atto *big.Int) *big.Float

func TruncateAddr

func TruncateAddr(addr string) string

func TxPostProcess

func TxPostProcess(tx *types.Transaction, err error) (*types.Transaction, error)

Types

type TaskFunc

type TaskFunc func() (interface{}, error)

Jump to

Keyboard shortcuts

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