eth

package
v1.10.0-beta.20201225 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2020 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const ERC20InterfaceABI = "" /* 2052-byte string literal not displayed */

ERC20InterfaceABI is the input ABI used to generate the binding from.

View Source
const SimpleMultiSigABI = "" /* 3132-byte string literal not displayed */

SimpleMultiSigABI is the input ABI used to generate the binding from.

Variables

View Source
var (
	New             = internal.New
	NewFromMetadata = internal.NewFromMetadata
)

先这么解决现有的导出函数问题

View Source
var SimpleMultiSigBin = "" /* 7406-byte string literal not displayed */

SimpleMultiSigBin is the compiled bytecode used for deploying new contracts. const SimpleMultiSigBin = `60806040523480156200001157600080fd5b5060405162000e7638038062000e76833981810160405260808110156200003757600080fd5b815160208301516040808501805191519395929483019291846401000000008211156200006357600080fd5b9083019060208201858111156200007957600080fd5b82518660208202830111640100000000821117156200009757600080fd5b82525081516020918201928201910280838360005b83811015620000c6578181015183820152602001620000ac565b505050509190910160405250602001518351909250600a1080159150620000ee575081518311155b8015620000fb5750600083115b6200013d576040805162461bcd60e51b815260206004820152600d60248201526c18985917dd1a1c995cda1bdb19609a1b604482015290519081900360640190fd5b60008461ffff161180156200015757506101008461ffff16105b62000199576040805162461bcd60e51b815260206004820152600d60248201526c6261645f6e6f6e63655f6e756d60981b604482015290519081900360640190fd5b6000805b83518110156200029757816001600160a01b0316848281518110620001be57fe5b60200260200101516001600160a01b03161162000222576040805162461bcd60e51b815260206004820152601760248201527f72657065617465645f6f776e65722f756e736f72746564000000000000000000604482015290519081900360640190fd5b6001600260008684815181106200023557fe5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055508381815181106200028157fe5b602090810291909101015191506001016200019d565b508251620002ad906003906020860190620003d2565b50836001819055508461ffff16604051908082528060200260200182016040528015620002e4578160200160208202803883390190505b508051620002fb916000916020909101906200043c565b5050604080517fd87cd6ef79d4e2b95e15ce8abf732db51ec771f1ca2edccf22a46c729ac564726020808301919091527fb7a0bfa1b79f2443f4d73ebb9259cddbcd510b18be6fc4da7d1aa7b1786e73e6828401527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6606083015260808201939093523060a08201527f251543af6a222378665a76fe38dbceae4871a070b7fdaf5c6c30cf758dc33cc060c0808301919091528251808303909101815260e0909101909152805191012060045550620004cf915050565b8280548282559060005260206000209081019282156200042a579160200282015b828111156200042a57825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190620003f3565b506200043892915062000488565b5090565b8280548282559060005260206000209081019282156200047a579160200282015b828111156200047a5782518255916020019190600101906200045d565b5062000438929150620004b2565b620004af91905b80821115620004385780546001600160a01b03191681556001016200048f565b90565b620004af91905b80821115620004385760008155600101620004b9565b61099780620004df6000396000f3fe6080604052600436106100705760003560e01c8063aa5df9e21161004e578063aa5df9e2146103c6578063c3142f4a1461040c578063c683a2db14610436578063ca7541ee1461046257610070565b80630d8e6e2c146100a8578063163947e51461013257806342cde4e81461039f575b60408051348152905133917fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c919081900360200190a2005b3480156100b457600080fd5b506100bd610477565b6040805160208082528351818301528351919283929083019185019080838360005b838110156100f75781810151838201526020016100df565b50505050905090810190601f1680156101245780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561013e57600080fd5b5061039d600480360361014081101561015657600080fd5b61ffff82351691602081013591810190606081016040820135600160201b81111561018057600080fd5b82018360208201111561019257600080fd5b803590602001918460208302840111600160201b831117156101b357600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561020257600080fd5b82018360208201111561021457600080fd5b803590602001918460208302840111600160201b8311171561023557600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561028457600080fd5b82018360208201111561029657600080fd5b803590602001918460208302840111600160201b831117156102b757600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092956001600160a01b0385351695602086013595919450925060608101915060400135600160201b81111561031b57600080fd5b82018360208201111561032d57600080fd5b803590602001918460018302840111600160201b8311171561034e57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550506001600160a01b038335169350505060200135610496565b005b3480156103ab57600080fd5b506103b461090a565b60408051918252519081900360200190f35b3480156103d257600080fd5b506103f0600480360360208110156103e957600080fd5b5035610910565b604080516001600160a01b039092168252519081900360200190f35b34801561041857600080fd5b506103b46004803603602081101561042f57600080fd5b5035610937565b34801561044257600080fd5b5061044b610955565b6040805161ffff9092168252519081900360200190f35b34801561046e57600080fd5b5061044b61095b565b604080518082019091526005815264312e302e3160d81b602082015290565b6001548751146104d9576040805162461bcd60e51b81526020600482015260096024820152683130b22fb92fb632b760b91b604482015290519081900360640190fd5b855187511480156104eb575087518751145b61052c576040805162461bcd60e51b815260206004820152600d60248201526c3130b22fb632b72fb917b997bb60991b604482015290519081900360640190fd5b6001600160a01b03821633148061054a57506001600160a01b038216155b61058a576040805162461bcd60e51b815260206004820152600c60248201526b3130b22fb2bc32b1baba37b960a11b604482015290519081900360640190fd5b8842106105cd576040805162461bcd60e51b815260206004820152600c60248201526b1d1a5b5957d95e1c1a5c995960a21b604482015290519081900360640190fd5b60005461ffff8b161061061d576040805162461bcd60e51b81526020600482015260136024820152726275636b65745f6f75745f6f665f72616e676560681b604482015290519081900360640190fd5b6000808b61ffff168154811061062f57fe5b9060005260206000200154905060007f3ee892349ae4bbe61dce18f95115b5dc02daf49204cc602458cd4c1f540d56d760001b8b8888888051906020012086898960405160200180898152602001888152602001876001600160a01b03166001600160a01b03168152602001868152602001858152602001848152602001836001600160a01b03166001600160a01b0316815260200182815260200198505050505050505050604051602081830303815290604052805190602001209050600060045482604051602001808061190160f01b81525060020183815260200182815260200192505050604051602081830303815290604052805190602001209050600080905060008090505b6001548110156108665760006001848f848151811061075557fe5b60200260200101518f858151811061076957fe5b60200260200101518f868151811061077d57fe5b602002602001015160405160008152602001604052604051808581526020018460ff1660ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa1580156107dc573d6000803e3d6000fd5b505050602060405103519050826001600160a01b0316816001600160a01b031611801561082157506001600160a01b03811660009081526002602052604090205460ff165b61085c576040805162461bcd60e51b81526020600482015260076024820152666261645f73696760c81b604482015290519081900360640190fd5b915060010161073a565b5060008e61ffff168154811061087857fe5b906000526020600020015460010160008f61ffff168154811061089757fe5b90600052602060002001819055506000809050600080895160208b018c8e8bf19050806108f9576040805162461bcd60e51b815260206004820152600b60248201526a18d85b1b17d9985a5b195960aa1b604482015290519081900360640190fd5b505050505050505050505050505050565b60015481565b6003818154811061091d57fe5b6000918252602090912001546001600160a01b0316905081565b6000818154811061094457fe5b600091825260209091200154905081565b60005490565b6003549056fea2646970667358221220cf3f6942cdfcb7b7ce088c7e41cb699e70324ba59a7304bf3660dd2b1071813a64736f6c63430006000033`

View Source
var SimpleMultiSigFuncSigs = map[string]string{
	"163947e5": "execute(uint16,uint256,uint8[],bytes32[],bytes32[],address,uint256,bytes,address,uint256)",
	"c683a2db": "getBucketLength()",
	"ca7541ee": "getOwersLength()",
	"0d8e6e2c": "getVersion()",
	"c3142f4a": "nonceBucket(uint256)",
	"aa5df9e2": "ownersArr(uint256)",
	"42cde4e8": "threshold()",
}

SimpleMultiSigFuncSigs maps the 4-byte function signature to its string representation.

Functions

func Hello

func Hello() string

Hello 返回简单的hello 字符串,可用于验证api调用

func NewBip44Deriver

func NewBip44Deriver(bip44Path string, seed []byte) (bip44.Deriver, error)

NewBip44Deriver eth bip44 实现

func PackedDeploySimpleMultiSig

func PackedDeploySimpleMultiSig(nonceNum_ uint16, threshold_ *BigInt, owners_ *AddressesWrap, chainId *BigInt) ([]byte, error)

PackedDeploySimpleMultiSig deploys a new Ethereum contract, binding an instance of SimpleMultiSig to it.

func SignRawTransaction

func SignRawTransaction(msg, privateKey string) (sig string, err error)

SignRawTransaction .

Types

type AddressesWrap

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

AddressesWrap 地址数组包装

func NewAddressesWrap

func NewAddressesWrap() *AddressesWrap

NewAddressesWrap .

func (*AddressesWrap) AddOne

func (w *AddressesWrap) AddOne(addr *ETHAddress)

AddOne 追加一个地址

type BigInt

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

A BigInt represents a signed multi-precision integer.

func NewBigInt

func NewBigInt(x int64) *BigInt

NewBigInt allocates and returns a new BigInt set to x.

func (*BigInt) GetBytes

func (bi *BigInt) GetBytes() []byte

GetBytes returns the absolute value of x as a big-endian byte slice.

func (*BigInt) GetInt64

func (bi *BigInt) GetInt64() int64

GetInt64 returns the int64 representation of x. If x cannot be represented in an int64, the result is undefined.

func (*BigInt) SetBytes

func (bi *BigInt) SetBytes(buf []byte)

SetBytes interprets buf as the bytes of a big-endian unsigned integer and sets the big int to that value.

func (*BigInt) SetInt64

func (bi *BigInt) SetInt64(x int64)

SetInt64 sets the big int to x.

func (*BigInt) SetString

func (bi *BigInt) SetString(x string, base int)

SetString sets the big int to x.

The string prefix determines the actual conversion base. A prefix of "0x" or "0X" selects base 16; the "0" prefix selects base 8, and a "0b" or "0B" prefix selects base 2. Otherwise the selected base is 10.

func (*BigInt) Sign

func (bi *BigInt) Sign() int

Sign returns:

-1 if x <  0
 0 if x == 0
+1 if x >  0

func (*BigInt) String

func (bi *BigInt) String() string

String returns the value of x as a formatted decimal string.

type Byte32ArrayWrap

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

Byte32ArrayWrap wrap [][32]byte

func NewByte32ArrayWrap

func NewByte32ArrayWrap() *Byte32ArrayWrap

NewByte32ArrayWrap .

func (*Byte32ArrayWrap) AddOne

func (w *Byte32ArrayWrap) AddOne(b []byte) error

AddOne len of bytes shoule be 32

type ERC20InterfaceABIHelper

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

ERC20InterfaceABIHelper tool for contract abi

func NewERC20InterfaceABIHelper

func NewERC20InterfaceABIHelper() *ERC20InterfaceABIHelper

NewERC20InterfaceABIHelper constructor

func (*ERC20InterfaceABIHelper) PackedAllowance

func (_ERC20Interface *ERC20InterfaceABIHelper) PackedAllowance(tokenOwner *ETHAddress, spender *ETHAddress) ([]byte, error)

PackedAllowance is a free data retrieval call binding the contract method 0xdd62ed3e. Solidity: function allowance(address tokenOwner, address spender) constant returns(uint256 remaining)

func (*ERC20InterfaceABIHelper) PackedApprove

func (_ERC20Interface *ERC20InterfaceABIHelper) PackedApprove(spender *ETHAddress, tokens *BigInt) ([]byte, error)

PackedApprove is a paid mutator transaction binding the contract method 0x095ea7b3. Solidity: function approve(address spender, uint256 tokens) returns(bool success)

func (*ERC20InterfaceABIHelper) PackedBalanceOf

func (_ERC20Interface *ERC20InterfaceABIHelper) PackedBalanceOf(tokenOwner *ETHAddress) ([]byte, error)

PackedBalanceOf is a free data retrieval call binding the contract method 0x70a08231. Solidity: function balanceOf(address tokenOwner) constant returns(uint256 balance)

func (*ERC20InterfaceABIHelper) PackedTotalSupply

func (_ERC20Interface *ERC20InterfaceABIHelper) PackedTotalSupply() ([]byte, error)

PackedTotalSupply is a free data retrieval call binding the contract method 0x18160ddd. Solidity: function totalSupply() constant returns(uint256)

func (*ERC20InterfaceABIHelper) PackedTransfer

func (_ERC20Interface *ERC20InterfaceABIHelper) PackedTransfer(to *ETHAddress, tokens *BigInt) ([]byte, error)

PackedTransfer is a paid mutator transaction binding the contract method 0xa9059cbb. Solidity: function transfer(address to, uint256 tokens) returns(bool success)

func (*ERC20InterfaceABIHelper) PackedTransferFrom

func (_ERC20Interface *ERC20InterfaceABIHelper) PackedTransferFrom(from *ETHAddress, to *ETHAddress, tokens *BigInt) ([]byte, error)

PackedTransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. Solidity: function transferFrom(address from, address to, uint256 tokens) returns(bool success)

func (*ERC20InterfaceABIHelper) UnpackAllowance

func (_ERC20Interface *ERC20InterfaceABIHelper) UnpackAllowance(output []byte) (*BigInt, error)

UnpackAllowance is a free data retrieval call binding the contract method 0xdd62ed3e. Solidity: function allowance(address tokenOwner, address spender) constant returns(uint256 remaining)

func (*ERC20InterfaceABIHelper) UnpackBalanceOf

func (_ERC20Interface *ERC20InterfaceABIHelper) UnpackBalanceOf(output []byte) (*BigInt, error)

UnpackBalanceOf is a free data retrieval call binding the contract method 0x70a08231. Solidity: function balanceOf(address tokenOwner) constant returns(uint256 balance)

func (*ERC20InterfaceABIHelper) UnpackTotalSupply

func (_ERC20Interface *ERC20InterfaceABIHelper) UnpackTotalSupply(output []byte) (*BigInt, error)

UnpackTotalSupply is a free data retrieval call binding the contract method 0x18160ddd. Solidity: function totalSupply() constant returns(uint256)

type ETHAddress

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

ETHAddress represents the 20 byte address of an Ethereum account.

func NewETHAddress

func NewETHAddress() *ETHAddress

NewETHAddress 0地址

func NewETHAddressFromHex

func NewETHAddressFromHex(hex string) (address *ETHAddress, err error)

NewETHAddressFromHex converts a hex string to a address value.

func (*ETHAddress) GetBytes

func (a *ETHAddress) GetBytes() []byte

GetBytes retrieves the byte representation of the address.

func (*ETHAddress) GetHex

func (a *ETHAddress) GetHex() string

GetHex retrieves the hex string representation of the address.

func (*ETHAddress) SetBytes

func (a *ETHAddress) SetBytes(address []byte) error

SetBytes sets the specified slice of bytes as the address value.

func (*ETHAddress) SetHex

func (a *ETHAddress) SetHex(address string) error

SetHex sets the specified hex string as the address value.

type ETHTransaction

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

ETHTransaction represents a single Ethereum transaction.

func NewETHTransaction

func NewETHTransaction(nonce int64, to *ETHAddress, amount *BigInt, gasLimit int64, gasPrice *BigInt, data []byte) *ETHTransaction

NewETHTransaction creates a new ether transaction with the given properties.

func NewETHTransactionForContractCreation

func NewETHTransactionForContractCreation(nonce int64, gasLimit int64, gasPrice *BigInt, data []byte) *ETHTransaction

NewETHTransactionForContractCreation 创建一个部署合约交易(amount 为 0)

func (*ETHTransaction) EncodeJSON

func (tx *ETHTransaction) EncodeJSON() (string, error)

EncodeJSON encodes a transaction into a JSON data dump.

func (*ETHTransaction) EncodeRLP

func (tx *ETHTransaction) EncodeRLP() (string, error)

EncodeRLP encodes a transaction into an hex RLP data dump.

func (*ETHTransaction) GetCost

func (tx *ETHTransaction) GetCost() *BigInt

GetCost .

func (*ETHTransaction) GetData

func (tx *ETHTransaction) GetData() []byte

GetData .

func (*ETHTransaction) GetGas

func (tx *ETHTransaction) GetGas() int64

GetGas .

func (*ETHTransaction) GetGasPrice

func (tx *ETHTransaction) GetGasPrice() *BigInt

GetGasPrice .

func (*ETHTransaction) GetHash

func (tx *ETHTransaction) GetHash() *Hash

GetHash .

func (*ETHTransaction) GetNonce

func (tx *ETHTransaction) GetNonce() int64

GetNonce .

func (*ETHTransaction) GetTo

func (tx *ETHTransaction) GetTo() *ETHAddress

GetTo .

func (*ETHTransaction) GetValue

func (tx *ETHTransaction) GetValue() *BigInt

GetValue .

type Hash

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

Hash represents the 32 byte Keccak256 hash of arbitrary data.

func (*Hash) GetBytes

func (h *Hash) GetBytes() []byte

GetBytes retrieves the byte representation of the hash.

func (*Hash) GetHex

func (h *Hash) GetHex() string

GetHex retrieves the hex string representation of the hash.

func (*Hash) SetBytes

func (h *Hash) SetBytes(hash []byte) error

SetBytes sets the specified slice of bytes as the hash value.

func (*Hash) SetHex

func (h *Hash) SetHex(hash string) error

SetHex sets the specified hex string as the hash value.

type SimpleMultiSigABIHelper

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

SimpleMultiSigABIHelper tool for contract abi

func NewSimpleMultiSigABIHelper

func NewSimpleMultiSigABIHelper() *SimpleMultiSigABIHelper

NewSimpleMultiSigABIHelper constructor

func (*SimpleMultiSigABIHelper) PackedExecute

func (_SimpleMultiSig *SimpleMultiSigABIHelper) PackedExecute(bucketIdx uint16, expireTime *BigInt, sigV *Uint8ArrayWrap, sigR *Byte32ArrayWrap, sigS *Byte32ArrayWrap, destination *ETHAddress, value *BigInt, data []byte, executor *ETHAddress, gasLimit *BigInt) ([]byte, error)

PackedExecute is a paid mutator transaction binding the contract method 0x163947e5.

func (*SimpleMultiSigABIHelper) PackedGetBucketLength

func (_SimpleMultiSig *SimpleMultiSigABIHelper) PackedGetBucketLength() ([]byte, error)

PackedGetBucketLength is a free data retrieval call binding the contract method 0xc683a2db.

func (*SimpleMultiSigABIHelper) PackedGetOwersLength

func (_SimpleMultiSig *SimpleMultiSigABIHelper) PackedGetOwersLength() ([]byte, error)

PackedGetOwersLength is a free data retrieval call binding the contract method 0xca7541ee.

func (*SimpleMultiSigABIHelper) PackedGetVersion

func (_SimpleMultiSig *SimpleMultiSigABIHelper) PackedGetVersion() ([]byte, error)

PackedGetVersion is a free data retrieval call binding the contract method 0x0d8e6e2c.

func (*SimpleMultiSigABIHelper) PackedNonceBucket

func (_SimpleMultiSig *SimpleMultiSigABIHelper) PackedNonceBucket(arg0 *BigInt) ([]byte, error)

PackedNonceBucket is a free data retrieval call binding the contract method 0xc3142f4a.

func (*SimpleMultiSigABIHelper) PackedOwnersArr

func (_SimpleMultiSig *SimpleMultiSigABIHelper) PackedOwnersArr(arg0 *BigInt) ([]byte, error)

PackedOwnersArr is a free data retrieval call binding the contract method 0xaa5df9e2.

func (*SimpleMultiSigABIHelper) PackedThreshold

func (_SimpleMultiSig *SimpleMultiSigABIHelper) PackedThreshold() ([]byte, error)

PackedThreshold is a free data retrieval call binding the contract method 0x42cde4e8.

func (*SimpleMultiSigABIHelper) UnpackGetBucketLength

func (_SimpleMultiSig *SimpleMultiSigABIHelper) UnpackGetBucketLength(output []byte) (uint16, error)

UnpackGetBucketLength is a free data retrieval call binding the contract method 0xc683a2db.

func (*SimpleMultiSigABIHelper) UnpackGetOwersLength

func (_SimpleMultiSig *SimpleMultiSigABIHelper) UnpackGetOwersLength(output []byte) (uint16, error)

UnpackGetOwersLength is a free data retrieval call binding the contract method 0xca7541ee.

func (*SimpleMultiSigABIHelper) UnpackGetVersion

func (_SimpleMultiSig *SimpleMultiSigABIHelper) UnpackGetVersion(output []byte) (string, error)

UnpackGetVersion is a free data retrieval call binding the contract method 0x0d8e6e2c.

func (*SimpleMultiSigABIHelper) UnpackNonceBucket

func (_SimpleMultiSig *SimpleMultiSigABIHelper) UnpackNonceBucket(output []byte) (*BigInt, error)

UnpackNonceBucket is a free data retrieval call binding the contract method 0xc3142f4a.

func (*SimpleMultiSigABIHelper) UnpackOwnersArr

func (_SimpleMultiSig *SimpleMultiSigABIHelper) UnpackOwnersArr(output []byte) (*ETHAddress, error)

UnpackOwnersArr is a free data retrieval call binding the contract method 0xaa5df9e2.

func (*SimpleMultiSigABIHelper) UnpackThreshold

func (_SimpleMultiSig *SimpleMultiSigABIHelper) UnpackThreshold(output []byte) (*BigInt, error)

UnpackThreshold is a free data retrieval call binding the contract method 0x42cde4e8.

type SimpleMultiSigExecuteSignResult

type SimpleMultiSigExecuteSignResult struct {
	R, S *SizedByteArray
	V    int8
}

SimpleMultiSigExecuteSignResult .

func NewSimpleMultiSigExecuteSignResultFromHex

func NewSimpleMultiSigExecuteSignResultFromHex(h string) (*SimpleMultiSigExecuteSignResult, error)

NewSimpleMultiSigExecuteSignResultFromHex decode from hex string

func UtilSimpleMultiSigExecuteSign

func UtilSimpleMultiSigExecuteSign(expireTime time.Time, chainID int64, signerPrivkHex string, hexedMultisigAddr, hexedDestinationAddr, hexedExecutor string, nonce int64, value, gasLimit *BigInt, data []byte) (*SimpleMultiSigExecuteSignResult, error)

UtilSimpleMultiSigExecuteSign 签名简单多签执行数据

func (*SimpleMultiSigExecuteSignResult) ToHex

ToHex 转为hex string方便传输

type SizedByteArray

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

SizedByteArray 固定长度的字节数组(固定长度意味着修改时长度需要与原来的一致)

func NewSizedByteArray

func NewSizedByteArray(b []byte) *SizedByteArray

NewSizedByteArray 创建一个定长字节数组

func (*SizedByteArray) Get

func (w *SizedByteArray) Get() []byte

Get return byte array

func (*SizedByteArray) Set

func (w *SizedByteArray) Set(b []byte) error

Set 如果长度与原来的不一致则报错

type Uint8ArrayWrap

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

Uint8ArrayWrap wrap []uint8,注意:虽然名字是uint8 array wrap,但实际只能是0-128,因为gomobile不支持unsigned int,操作的时候用int8

func NewUint8ArrayWrap

func NewUint8ArrayWrap() *Uint8ArrayWrap

NewUint8ArrayWrap .

func (*Uint8ArrayWrap) AddOne

func (w *Uint8ArrayWrap) AddOne(n int8) error

AddOne 注意:不支持负数,传入负数时会返回错误(安卓抛出异常,ios没试过。。)

Directories

Path Synopsis
testtool
Package testtool 测试用辅助函数
Package testtool 测试用辅助函数

Jump to

Keyboard shortcuts

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