Documentation ¶
Index ¶
- Constants
- Variables
- func GetChainName(chainID string) string
- func GetMainChainID(chainID string) string
- func Nonce(caller BVMAddress, nonce []byte) []byte
- func SequenceNonce(address BVMAddress, sequence uint64) []byte
- func ToAddr(address BVMAddress) crypto.Address
- type BVMAddress
- func AddressFromBytes(bs []byte) (address BVMAddress, err error)
- func AddressFromHexString(str string) (BVMAddress, error)
- func AddressFromWord256(addr binary.Word256) BVMAddress
- func MaybeAddressFromBytes(bs []byte) (*BVMAddress, error)
- func MustAddressFromBytes(addr []byte) BVMAddress
- func MustAddressFromHexString(str string) BVMAddress
- func NewContractAddress(caller BVMAddress, nonce []byte) (newAddr BVMAddress)
- func NewContractAddress2(caller BVMAddress, salt [binary.Word256Length]byte, initcode []byte) (newAddr BVMAddress)
- func ToBVM(address crypto.Address) BVMAddress
- func (address BVMAddress) Bytes() []byte
- func (address *BVMAddress) Equal(b BVMAddress) bool
- func (address *BVMAddress) Marshal() ([]byte, error)
- func (address BVMAddress) MarshalJSON() ([]byte, error)
- func (address BVMAddress) MarshalText() ([]byte, error)
- func (address *BVMAddress) MarshalTo(data []byte) (int, error)
- func (address *BVMAddress) Size() int
- func (address BVMAddress) String() string
- func (address *BVMAddress) Unmarshal(data []byte) error
- func (address *BVMAddress) UnmarshalJSON(data []byte) error
- func (address *BVMAddress) UnmarshalText(text []byte) error
- func (address BVMAddress) Word256() binary.Word256
- type BVMAddresses
- type CurveType
Constants ¶
View Source
const AddressHexLength = 2 * AddressLength
View Source
const AddressLength = binary.Word160Length
Variables ¶
View Source
var ZeroAddress = BVMAddress{}
Functions ¶
func GetChainName ¶
func GetMainChainID ¶
func Nonce ¶
func Nonce(caller BVMAddress, nonce []byte) []byte
func SequenceNonce ¶
func SequenceNonce(address BVMAddress, sequence uint64) []byte
Obtain a nearly unique nonce based on a montonic account sequence number
func ToAddr ¶
func ToAddr(address BVMAddress) crypto.Address
Types ¶
type BVMAddress ¶
func AddressFromBytes ¶
func AddressFromBytes(bs []byte) (address BVMAddress, err error)
Returns an address consisting of the first 20 bytes of bs, return an error if the bs does not have length exactly 20 but will still return either: the bytes in bs padded on the right or the first 20 bytes of bs truncated in any case.
func AddressFromHexString ¶
func AddressFromHexString(str string) (BVMAddress, error)
func AddressFromWord256 ¶
func AddressFromWord256(addr binary.Word256) BVMAddress
func MaybeAddressFromBytes ¶
func MaybeAddressFromBytes(bs []byte) (*BVMAddress, error)
Returns a pointer to an BVMAddress that is nil iff len(bs) == 0 otherwise does the same as AddressFromBytes
func MustAddressFromBytes ¶
func MustAddressFromBytes(addr []byte) BVMAddress
func MustAddressFromHexString ¶
func MustAddressFromHexString(str string) BVMAddress
func NewContractAddress ¶
func NewContractAddress(caller BVMAddress, nonce []byte) (newAddr BVMAddress)
func NewContractAddress2 ¶
func NewContractAddress2(caller BVMAddress, salt [binary.Word256Length]byte, initcode []byte) (newAddr BVMAddress)
func ToBVM ¶
func ToBVM(address crypto.Address) BVMAddress
func (BVMAddress) Bytes ¶
func (address BVMAddress) Bytes() []byte
Copy address and return a slice onto the copy
func (*BVMAddress) Equal ¶
func (address *BVMAddress) Equal(b BVMAddress) bool
func (*BVMAddress) Marshal ¶
func (address *BVMAddress) Marshal() ([]byte, error)
Gogo proto support
func (BVMAddress) MarshalJSON ¶
func (address BVMAddress) MarshalJSON() ([]byte, error)
func (BVMAddress) MarshalText ¶
func (address BVMAddress) MarshalText() ([]byte, error)
func (*BVMAddress) Size ¶
func (address *BVMAddress) Size() int
func (BVMAddress) String ¶
func (address BVMAddress) String() string
func (*BVMAddress) Unmarshal ¶
func (address *BVMAddress) Unmarshal(data []byte) error
func (*BVMAddress) UnmarshalJSON ¶
func (address *BVMAddress) UnmarshalJSON(data []byte) error
func (*BVMAddress) UnmarshalText ¶
func (address *BVMAddress) UnmarshalText(text []byte) error
func (BVMAddress) Word256 ¶
func (address BVMAddress) Word256() binary.Word256
type BVMAddresses ¶
type BVMAddresses []BVMAddress
func (BVMAddresses) Len ¶
func (as BVMAddresses) Len() int
func (BVMAddresses) Less ¶
func (as BVMAddresses) Less(i, j int) bool
func (BVMAddresses) Swap ¶
func (as BVMAddresses) Swap(i, j int)
Click to show internal directories.
Click to hide internal directories.