utils

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2019 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HEADERLEN   int    = 6
	MAGIC       uint32 = 0x6d736101
	MagicBase64 uint32 = 0x7a464741
	ZLIBUTIL    uint16 = 0x01
	GZIPUTIL    uint16 = 0x02
)

Variables

This section is empty.

Functions

func ArrayLengthKey

func ArrayLengthKey(symbol common.Hash) common.Hash

func ArrayLocation

func ArrayLocation(sym string, index int64, length int64)

func BytesToF32

func BytesToF32(bytes []byte) float32

func BytesToF64

func BytesToF64(bytes []byte) float64

func BytesToI64

func BytesToI64(bytes []byte) uint64

func Compress

func Compress(src []byte) []byte

func CompressWasmAndAbi

func CompressWasmAndAbi(abijson, wasm, compiled []byte) []byte

将abi和wasm压缩后进行rlp编码

func CompressZlib

func CompressZlib(src []byte) []byte

func DeCompress

func DeCompress(src []byte) ([]byte, error)

func DecodeContractCode

func DecodeContractCode(input []byte) (contract.WasmCode, []byte, error)

func F32ToBytes

func F32ToBytes(f32 float32) []byte

func F64ToBytes

func F64ToBytes(f64 float64) []byte

func GetIndex

func GetIndex(m *wasm.Module) (writeIndex int, readIndex int, gasIndex int)

func GetU256

func GetU256(mem []byte) *big.Int

func I32ToBytes

func I32ToBytes(i32 uint32) []byte

func I64ToBytes

func I64ToBytes(i64 uint64) []byte

func IsAddress

func IsAddress(data []byte) (bool, []byte)

func IsU256

func IsU256(data []byte) (bool, []byte)

func MapLocation

func MapLocation(sym, key []byte) common.Hash

func ReadMagic

func ReadMagic(src []byte) (uint32, error)

func Split

func Split(data []byte) (int, [][]byte)

Types

This section is empty.

Jump to

Keyboard shortcuts

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