Documentation ¶
Overview ¶
util package to handle various types and hex string, bytes etc
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ZeroAddr is all 0s ZeroAddr Addr // ZeroAddrHex is string of 20 0s ZeroAddrHex = Addr2Hex(ZeroAddr) // ZeroPayID is all 0s ZeroPayID PayIDType // ZeroPayIDHex is string of 32 0s ZeroPayIDHex = PayID2Hex(ZeroPayID) // ZeroBigInt is big.NewInt(0) ZeroBigInt = big.NewInt(0) // ZeroCid is all 0s ZeroCid CidType )
Functions ¶
Types ¶
type Addr ¶
Addr is alias to geth common.Address
func Bytes2Addr ¶
Bytes2Addr returns Address from b Addr.Bytes() does the reverse
type CidType ¶
CidType is the type for payment channel ID Note we need to change all cid.Hex() to Cid2Hex() because Hash.Hex() has 0x prefix
type PayIDType ¶
PayIDType is the ID type for pays
func Bytes2PayID ¶
Bytes2PayID converts bytes to PayIDType type
func Pay2PayID ¶
func Pay2PayID(pay *entity.ConditionalPay) PayIDType
Pay2PayID converts structured pay data to PayID
func PayBytes2PayID ¶
PayBytes2PayID converts marshaled pay bytes to PayID
Click to show internal directories.
Click to hide internal directories.