Documentation ¶
Index ¶
- Constants
- Variables
- func BigIntFromNeoBytes(ba []byte) *big.Int
- func BigIntToNeoBytes(data *big.Int) []byte
- func FileExisted(filename string) bool
- func GetCompactUint(buf []byte) (uint64, uint8)
- func GetNonce() uint64
- func HexToBytes(value string) ([]byte, error)
- func SafeAdd(x, y uint64) (uint64, bool)
- func SafeMul(x, y uint64) (uint64, bool)
- func SafeSub(x, y uint64) (uint64, bool)
- func SetCompactUint(num uint64) []byte
- func ToArrayReverse(arr []byte) []byte
- func ToHexString(data []byte) string
- type Address
- type CompactUint
- type Fixed64
- type Inventory
- type InventoryType
- type LimitedWriter
- type Uint256
Constants ¶
View Source
const ADDR_LEN = 20
View Source
const (
Decimal = 100000000
)
View Source
const (
MAX_UINT64 = math.MaxUint64
)
View Source
const UINT256_SIZE = 32
Variables ¶
View Source
var ADDRESS_EMPTY = Address{}
View Source
var ErrWriteExceedLimitedCount = errors.New("writer exceed limited count")
View Source
var UINT256_EMPTY = Uint256{}
Functions ¶
func BigIntFromNeoBytes ¶
func BigIntToNeoBytes ¶
func FileExisted ¶
FileExisted checks whether filename exists in filesystem
func GetCompactUint ¶
func HexToBytes ¶
HexToBytes convert hex string to []byte
func SetCompactUint ¶
TODO Fix the return value to the correct number
func ToArrayReverse ¶
Types ¶
type Address ¶
func AddressFromBase58 ¶
AddressFromBase58 returns Address from encoded base58 string
func AddressFromHexString ¶
AddressParseFromHexString returns parsed Address
func AddressParseFromBytes ¶
AddressParseFromBytes returns parsed Address
func (*Address) Deserialize ¶
Deserialize deserialize Address from io.Reader
func (*Address) ToHexString ¶
ToHexString returns hex string representation of Address
type CompactUint ¶
type CompactUint struct {
// contains filtered or unexported fields
}
type Inventory ¶
type Inventory interface { //sig.SignableData Hash() Uint256 Verify() error Type() InventoryType }
TODO: temp inventory
type InventoryType ¶
type InventoryType byte
const ( TRANSACTION InventoryType = 0x01 BLOCK InventoryType = 0x02 CONSENSUS InventoryType = 0xe0 )
type LimitedWriter ¶ added in v0.9.3
type LimitedWriter struct {
// contains filtered or unexported fields
}
func NewLimitedWriter ¶ added in v0.9.3
func NewLimitedWriter(w io.Writer, max uint64) *LimitedWriter
func (*LimitedWriter) Count ¶ added in v0.9.3
func (self *LimitedWriter) Count() uint64
Count function return counted bytes
type Uint256 ¶
type Uint256 [UINT256_SIZE]byte
func ComputeMerkleRoot ¶
input a []uint256, create a merkleTree & calc the root hash
func Uint256FromHexString ¶
func Uint256ParseFromBytes ¶
func (*Uint256) ToHexString ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.