Documentation ¶
Overview ¶
Package common contains various helper functions.
Copyright (c) 2018 The MATRIX Authors Distributed under the MIT software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php
Copyright (c) 2018 The MATRIX Authors Distributed under the MIT software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php
Copyright (c) 2018 The MATRIX Authors Distributed under the MIT software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php
Index ¶
- Constants
- Variables
- func AbsolutePath(Datadir string, filename string) string
- func Bytes2Hex(d []byte) string
- func CopyBytes(b []byte) (copiedBytes []byte)
- func EmptyHash(h Hash) bool
- func FileExist(filePath string) bool
- func FromHex(s string) []byte
- func GeneratePosition(index uint16, electRole ElectRoleType) uint16
- func Greater(a, b BroadTxkey) bool
- func Hex2Bytes(str string) []byte
- func Hex2BytesFixed(str string, flen int) []byte
- func IsGreaterLink(linkA, linkB LinkInfo) bool
- func IsHexAddress(s string) bool
- func IsNil(i interface{}) bool
- func IsValidityCurrency(s string) bool
- func IsValidityManCurrency(s string) bool
- func LeftPadBytes(slice []byte, l int) []byte
- func Less(a, b BroadTxkey) bool
- func LoadJSON(file string, val interface{}) error
- func MakeName(name, version string) string
- func PrintDepricationWarning(str string)
- func Report(extra ...interface{})
- func RightPadBytes(slice []byte, l int) []byte
- func ToHex(b []byte) string
- type AddrAmont
- type Address
- func (a Address) Big() *big.Int
- func (a Address) Bytes() []byte
- func (a Address) Equal(other Address) bool
- func (a Address) Format(s fmt.State, c rune)
- func (a Address) Hash() Hash
- func (a Address) Hex() string
- func (a Address) MarshalText() ([]byte, error)
- func (a *Address) Set(other Address)
- func (a *Address) SetBytes(b []byte)
- func (a *Address) SetString(s string)
- func (a Address) Str() string
- func (a Address) String() string
- func (a *Address) UnmarshalJSON(input []byte) error
- func (a *Address) UnmarshalText(input []byte) error
- type AuthType
- type BalanceSlice
- type BalanceType
- type BroadTxSlice
- type BroadTxValue
- type BroadTxkey
- type CoinConfig
- type CoinRoot
- type CoinSharding
- type Coinbyte
- type CommitContext
- type Echelon
- type Elect
- type Elect1
- type ElectRoleType
- type EntrustType
- type Hash
- func (h Hash) Big() *big.Int
- func (h Hash) Bytes() []byte
- func (h Hash) Equal(other Hash) bool
- func (h Hash) Format(s fmt.State, c rune)
- func (h Hash) Generate(rand *rand.Rand, size int) reflect.Value
- func (h Hash) Hex() string
- func (h Hash) MarshalText() ([]byte, error)
- func (h *Hash) Set(other Hash)
- func (h *Hash) SetBytes(b []byte)
- func (h *Hash) SetString(s string)
- func (h Hash) Str() string
- func (h Hash) String() string
- func (h Hash) TerminalString() string
- func (h *Hash) UnmarshalJSON(input []byte) error
- func (h *Hash) UnmarshalText(input []byte) error
- type LinkInfo
- type MixedcaseAddress
- func (ma *MixedcaseAddress) Address() Address
- func (ma *MixedcaseAddress) MarshalJSON() ([]byte, error)
- func (ma *MixedcaseAddress) Original() string
- func (ma *MixedcaseAddress) String() string
- func (ma *MixedcaseAddress) UnmarshalJSON(input []byte) error
- func (ma *MixedcaseAddress) ValidChecksum() bool
- type NetTopology
- type NetTopology1
- type NetTopologyData
- type NetTopologyData1
- type PrettyDuration
- type RecorbleTx
- type ResendMsgCtrl
- type RetCallTxN
- type ReuseMsgController
- func (self ReuseMsgController) AddMsg(msgKey Hash, msg interface{}, lastUseTime int64) error
- func (self ReuseMsgController) GetMsgByKey(msgKey Hash) interface{}
- func (self ReuseMsgController) GetMsgList() []interface{}
- func (self ReuseMsgController) IsExistMsg(msgKey Hash) bool
- func (self ReuseMsgController) ReUseMsg(msgKey Hash) (interface{}, error)
- type RewarTx
- type RoleType
- type SMakeCoin
- type Signature
- type StorageSize
- type TxTypeInt
- type UnprefixedAddress
- type UnprefixedHash
- type VIPRoleType
- type VerifiedSign
- type VerifiedSign1
Constants ¶
const ( AlgorithmMsg = 0x11 NetworkMsg = 0x12 BroadcastReqMsg = 0x13 BroadcastRespMsg = 0x14 )
const ( RoleNil RoleType = 0x001 RoleDefault = 0x002 RoleBucket = 0x004 RoleBackupMiner = 0x008 RoleMiner = 0x010 RoleInnerMiner = 0x020 RoleBackupValidator = 0x040 RoleValidator = 0x080 RoleBackupBroadcast = 0x100 RoleBroadcast = 0x200 RoleCandidateValidator = 0x400 RoleAll = 0xFFFF )
const ( HashLength = 32 AddressLength = 20 SignatureLength = 65 )
const ( MainAccount = iota //主账户 FreezeAccount //冻结账户 LockAccount //锁仓账户 WithdrawAccount //可撤销账户 EntrustAccount //委托账户 )
const ( PosOffline uint16 = 0xF000 PosOnline uint16 = 0xF001 )
const ( NetTopoTypeAll uint8 = 0 NetTopoTypeChange uint8 = 1 )
const ( StateDBRevocableBtree string = "RevcBTree" StateDBTimeBtree string = "TimeBtree" )
const ( ExtraNormalTxType byte = 0 //普通交易 ExtraBroadTxType byte = 1 //广播交易(内部交易,钱包无用) ExtraUnGasMinerTxType byte = 2 //矿工奖励类型 ExtraRevocable byte = 3 //可撤销的交易 ExtraRevertTxType byte = 4 //撤销交易 ExtraAuthTx byte = 5 //授权委托 ExtraCancelEntrust byte = 6 //取消委托 ExtraTimeTxType byte = 7 //定时交易 ExtraAItxType byte = 8 //AI 交易 ExtraMakeCoinType byte = 9 //创建币种交易 ExtraUnGasValidatorTxType byte = 10 //验证者奖励类型 ExtraUnGasInterestTxType byte = 11 //利息奖励通过合约交易发放 ExtraUnGasTxsType byte = 12 //交易费奖励类型 ExtraUnGasLotteryTxType byte = 13 //彩票奖励类型 ExtraSetBlackListTxType byte = 14 //设置黑名单交易 ExtraSuperBlockTx byte = 120 //超级区块交易 )
const ( RewardMinerType byte = 0 //矿工奖励类型 RewardValidatorType byte = 1 //验证者奖励类型 RewardInterestType byte = 2 //利息奖励通过合约交易发放 RewardTxsType byte = 3 //交易费奖励类型 RewardLotteryType byte = 4 //彩票费奖励类型 )
const COINPREFIX string = "ms_"
Variables ¶
var ( Big1 = big.NewInt(1) Big2 = big.NewInt(2) Big3 = big.NewInt(3) Big0 = big.NewInt(0) Big32 = big.NewInt(32) Big256 = big.NewInt(256) Big257 = big.NewInt(257) )
Common big integers often used
var ( ErrMsgExist = errors.New("msg already exist") ErrMsgNotExist = errors.New("msg not exist") ErrUseMsgTooOften = errors.New("use msg too often, please try later") )
var ( WhiteAddrlist = [1]Address{InterestRewardAddress} RewardAccounts = [5]Address{BlkMinerRewardAddress, BlkValidatorRewardAddress, TxGasRewardAddress, LotteryRewardAddress, InterestRewardAddress} ConsensusAccounts []Address BlackList []Address BlackListString []string WorkPath string )
var (
ErrParam = errors.New("param err")
)
var LastAccount uint32 = EntrustAccount //必须赋值最后一个账户
var ( PutCommit = []CommitContext{ CommitContext{ Version: "Gman_Alg_0.0.1", Submitter: "孙春风,胡源凯", Commit: []string{ "修改委托交易下的vrf失败问题", "pos参数配置有误", }, }, CommitContext{ Version: "Gman_Alg_0.0.2", Submitter: "孙春风", Commit: []string{ "出块趋向时间由1改为6", }, }, CommitContext{ Version: "Gman_Alg_0.0.3", Submitter: "孙春风", Commit: []string{ "删除开发者模式 删除测试网模式 删除rinkeby模式", "禁用默认创世文件", "委托交易账户外部可见改为man账户", }, }, CommitContext{ Version: "Gman_Alg_0.0.4", Submitter: "孙春风", Commit: []string{ "换届服务漏合并的代码", "顶点在线修改可能panic的问题", }, }, { Version: "Gman_Alg_0.0.5", Submitter: "Ryan", Commit: []string{ "merge nodeId fixed version, modify bucket limit from two to four and modify broadcast block sender", }, }, CommitContext{ Version: "Gman_Alg_0.0.6", Submitter: "孙春风", Commit: []string{ "提供创世文件默认配置,(用户可选择性的填写创世文件,也可不填)", }, }, CommitContext{ Version: "Gman_Alg_0.0.7", Submitter: "yeying", Commit: []string{ "修复发送定时交易或者24小时可撤销交易后重启节点导致区块root不一致的问题", "修复24小时可撤销交易正常执行完毕后在撤销该笔交易出现崩溃的问题", "修复同时发送定时交易和24小时可撤销交易,撤销其中的一笔交易后,转账金额没有减少的问题", "修复dump崩溃问题", "修改log", "deposit bug fixed", }, }, CommitContext{ Version: "Gman_Alg_0.0.8", Submitter: "zhangwen", Commit: []string{ "参与奖励使用股权收放系数", "彩票奖励修改算法", "利息奖励使用初选列表获取vip等级", "超级区块签名不允许修改,使用本地状态树账户", "出块矿工奖励金额在下一块发放", }, }, CommitContext{ Version: "Gman_Alg_0.0.9", Submitter: "huyuankai", Commit: []string{ "特殊账户状态树key值拆分为独立key值", }, }, CommitContext{ Version: "Gman_Alg_0.0.10", Submitter: "sunchunfeng", Commit: []string{ "选举算法修改", }, }, CommitContext{ Version: "Gman_Alg_0.0.11", Submitter: "yeying", Commit: []string{ "uniform gas price (18000000000)", }, }, CommitContext{ Version: "Gman_Alg_0.0.12", Submitter: "张文", Commit: []string{ "矿工出块奖励使用parenthash取前一块的coinbase,解决选取的矿工不一致的问题", "修改二级备份节点会多选一个问题", }, }, CommitContext{ Version: "Gman_Alg_0.0.13", Submitter: "张文", Commit: []string{ "修改默认创世文件配置", }, }, CommitContext{ Version: "Gman_Alg_0.0.14", Submitter: "liubo", Commit: []string{ "区块同步fetch增加log部分打印,便于定位问题", "去掉ipfs 相关printf打印", "ipfs同步频繁启动协程异常判断改为管道方式", "去掉高层使用fetch请求区块", }, }, { Version: "Gman_Alg_0.0.15", Submitter: "Ryan", Commit: []string{ "modify the way to create signature file.", }, }, CommitContext{ Version: "Gman_Alg_0.0.16", Submitter: "sunyang", Commit: []string{ "增加setVoted方法,标识节点已对某共识请求投过票", "在相关投票操作完成之后调用该方法标识该共识请求投票完成", }, }, { Version: "Gman_Alg_0.0.17", Submitter: "Ryan", Commit: []string{ "modify deposit: delete old signature address, reset account after withdraw and refund", }, }, { Version: "Gman_Alg_0.0.18", Submitter: "Ryan", Commit: []string{ "fix peer bug after change identity, fix change nodeId bug", }, }, { Version: "Gman_Alg_0.0.19", Submitter: "liubo", Commit: []string{ "更新linux下终端无法显示log问题", "ipfs下载请求修正及偶然的崩溃问题", }, }, { Version: "Gman_Alg_0.0.20", Submitter: "zhangwen", Commit: []string{ "uptime一直累加", }, }, { Version: "Gman_Alg_0.0.21", Submitter: "huyuankai", Commit: []string{ "增加广播节点热备", "状态树版本兼容调整", "交易码判断错误bug修复", }, }, { Version: "Gman_Alg_0.0.22", Submitter: "zhenghe", Commit: []string{ "修改抵押竞选方式为按角色竞选(勇哥修改)", }, }, { Version: "Gman_Alg_0.0.23", Submitter: "huyuankai", Commit: []string{ "二次秘钥功调整,拓扑图全部使用A0账户", "web3接口 获取区块签名列表,返回A0账户", "增加拓扑图状态web3接口", }, }, { Version: "Gman_Alg_0.0.24", Submitter: "hemao", Commit: []string{ "未出块惩罚代功能添加", }, }, { Version: "Gman_Alg_0.0.25", Submitter: "zhenghe,liubo", Commit: []string{ "快照功能合入", }, }, { Version: "Gman_Alg_0.0.26", Submitter: "mehao,huuyankai,zhangwen", Commit: []string{ "创世文件配置及默认创世文件优化", "matrix state 改为RLP编码", "entrust检查流程代码", "共识流程版本兼容", }, }, { Version: "Gman_Alg_0.0.27", Submitter: "zhenghe", Commit: []string{ "download过程按时间委托交易和区块头时间比较", }, }, { Version: "Gman_Alg_0.0.28", Submitter: "zhangwen", Commit: []string{ "解决通过收据获取不到交易的问题", }, }, { Version: "Gman_Alg_0.0.29", Submitter: "zhenghe", Commit: []string{ "修改sendrawtransaction发送方式", }, }, { Version: "Gman_Alg_0.0.30", Submitter: "zhenghe", Commit: []string{ "修改交易相关的日志打印格式", "用协程生成快照(yeting)", }, }, { Version: "Gman_Alg_0.0.31", Submitter: "zhangwen", Commit: []string{ "公私钥增加打印", "矿工和验证者生成时间点修改支持合约及时生效", }, }, { Version: "Gman_Alg_0.0.32", Submitter: "liubo", Commit: []string{ "1. 区块同步只批量300块,剩余走原来同步方式代码", "2. 增加区块压缩存储ipfs功能", "3. 增加区块大小统计", "4. panic增加时间 ", }, }, { Version: "Gman_Alg_0.0.33", Submitter: "lb", Commit: []string{ "fetch增加loop周期例行检查功能,防止fetch阻塞区块入库", "panic增加换行", }, }, { Version: "Gman_Alg_0.0.34", Submitter: "zhenghe", Commit: []string{ "修改多币种奖励", "增加黑名单机制", "委托交易增加按次数委托", }, }, { Version: "Gman_Alg_0.0.35", Submitter: "zhenghe", Commit: []string{ "创建币种增加to地址限制,销毁金额衰减机制", }, }, } )
var (
SignLog = "SignLog"
)
Functions ¶
func AbsolutePath ¶
func GeneratePosition ¶
func GeneratePosition(index uint16, electRole ElectRoleType) uint16
func Greater ¶ added in v1.1.1
func Greater(a, b BroadTxkey) bool
func Hex2BytesFixed ¶
func IsGreaterLink ¶ added in v1.1.4
func IsHexAddress ¶
IsHexAddress verifies whether a string can represent a valid hex-encoded Matrix Address or not.
func IsValidityCurrency ¶ added in v1.1.1
长度为3-8位,不能有小写字母,不能有特殊字符,不能有数字,不能有连续的"MAN"
func IsValidityManCurrency ¶ added in v1.1.1
长度为3-8位,不能有小写字母,不能有特殊字符,不能有数字
func LeftPadBytes ¶
func Less ¶ added in v1.1.1
func Less(a, b BroadTxkey) bool
func MakeName ¶
MakeName creates a node name that follows the matrix convention for such names. It adds the operation system name and Go runtime version the name.
func PrintDepricationWarning ¶
func PrintDepricationWarning(str string)
PrintDepricationWarning prinst the given string in a box using fmt.Println.
func Report ¶
func Report(extra ...interface{})
Report gives off a warning requesting the user to submit an issue to the github tracker.
func RightPadBytes ¶
Types ¶
type Address ¶
type Address [AddressLength]byte
Address represents the 20 byte Address of an Matrix account.
var ( BlkMinerRewardAddress Address = HexToAddress("0x8000000000000000000000000000000000000000") //区块奖励 BlkValidatorRewardAddress Address = HexToAddress("0x8000000000000000000000000000000000000000") //leader奖励 InterestRewardAddress Address = HexToAddress("0x8000000000000000000000000000000000000000") //利息 TxGasRewardAddress Address = HexToAddress("0x8000000000000000000000000000000000000001") //交易费 LotteryRewardAddress Address = HexToAddress("0x8000000000000000000000000000000000000002") //彩票 ContractAddress Address = HexToAddress("0x000000000000000000000000000000000000000A") //合约账户 DestroyAddress Address = HexToAddress("0xA27d3632A283c138C2F78ba21d1e473a500e4AF3") //创建币种的转账地址(MAN.3GJF5vPbrmbUG7ZTFyFogdiuXY3Lp) )
func BigToAddress ¶
func BytesToAddress ¶
func HashToAddress ¶ added in v1.1.1
func HexToAddress ¶
func (Address) Format ¶
Format implements fmt.Formatter, forcing the byte slice to be formatted as is, without going through the stringer interface used for logging.
func (Address) MarshalText ¶
MarshalText returns the hex representation of a.
func (*Address) SetBytes ¶
Sets the Address to the Value of b. If b is larger than len(a) it will panic
func (*Address) UnmarshalJSON ¶
UnmarshalJSON parses a hash in hex syntax.
func (*Address) UnmarshalText ¶
UnmarshalText parses a hash in hex syntax.
type BalanceSlice ¶ added in v1.1.1
账户属性定义
type BalanceType ¶ added in v1.1.1
type BalanceType []BalanceSlice
type BroadTxSlice ¶ added in v1.1.1
type BroadTxSlice []BroadTxValue
func (*BroadTxSlice) FindKey ¶ added in v1.1.1
func (si *BroadTxSlice) FindKey(key string) map[Address][]byte
type BroadTxValue ¶ added in v1.1.1
type BroadTxValue struct { Key BroadTxkey Value []byte }
type BroadTxkey ¶ added in v1.1.1
type CoinConfig ¶ added in v1.1.2
type CoinConfig struct { CoinRange string `json:"CoinRange"` //coinrange和cointype是一个类型,为了扩展方便保留该字段 CoinType string `json:"CoinType"` //支付币种 PackNum uint64 `json:"PackNum"` //打包数量限制 如果为0则不打包 CoinUnit *hexutil.Big `json:"CoinUnit"` //单位 CoinTotal *hexutil.Big `json:"CoinTotal"` //总发行量 CoinAddress Address `json:"CoinAddress"` //币种交易费账户 }
type CoinSharding ¶ added in v1.1.2
type CommitContext ¶ added in v1.1.1
type Elect ¶
type Elect struct { Account Address Stock uint16 Type ElectRoleType VIP VIPRoleType }
type Elect1 ¶ added in v1.1.1
type Elect1 struct { Account string Stock uint16 Type ElectRoleType VIP VIPRoleType }
type ElectRoleType ¶
type ElectRoleType uint8
const ( ElectRoleMiner ElectRoleType = 0x00 ElectRoleMinerBackUp ElectRoleType = 0x01 ElectRoleValidator ElectRoleType = 0x02 ElectRoleValidatorBackUp ElectRoleType = 0x03 ElectRoleCandidateValidator ElectRoleType = 0x04 ElectRoleNil ElectRoleType = 0xff )
func (ElectRoleType) Transfer2CommonRole ¶
func (ert ElectRoleType) Transfer2CommonRole() RoleType
type EntrustType ¶ added in v1.1.1
type EntrustType struct { //委托地址 EntrustAddres string //被委托人from //委托权限 IsEntrustGas bool //委托gas IsEntrustSign bool //委托签名 EnstrustSetType byte //0-按高度委托,1-按时间委托,2-按次数委托 //委托限制 StartHeight uint64 //委托起始高度 EndHeight uint64 //委托结束高度 StartTime uint64 EndTime uint64 EntrustCount uint32 //委托次数 }
地址为matrix地址
type Hash ¶
type Hash [HashLength]byte
Hash represents the 32 byte Keccak256 hash of arbitrary data.
func BytesToHash ¶
func (Hash) Format ¶
Format implements fmt.Formatter, forcing the byte slice to be formatted as is, without going through the stringer interface used for logging.
func (Hash) MarshalText ¶
MarshalText returns the hex representation of h.
func (*Hash) SetBytes ¶
Sets the hash to the Value of b. If b is larger than len(h), 'b' will be cropped (from the left).
func (*Hash) SetString ¶
Set string `s` to h. If s is larger than len(h) s will be cropped (from left) to fit.
func (Hash) String ¶
String implements the stringer interface and is used also by the logger when doing full logging into a file.
func (Hash) TerminalString ¶
TerminalString implements log.TerminalStringer, formatting a string for console output during logging.
func (*Hash) UnmarshalJSON ¶
UnmarshalJSON parses a hash in hex syntax.
func (*Hash) UnmarshalText ¶
UnmarshalText parses a hash in hex syntax.
type MixedcaseAddress ¶
type MixedcaseAddress struct {
// contains filtered or unexported fields
}
MixedcaseAddress retains the original string, which may or may not be correctly checksummed
func NewMixedcaseAddress ¶
func NewMixedcaseAddress(addr Address) MixedcaseAddress
NewMixedcaseAddress constructor (mainly for testing)
func NewMixedcaseAddressFromString ¶
func NewMixedcaseAddressFromString(hexaddr string) (*MixedcaseAddress, error)
NewMixedcaseAddressFromString is mainly meant for unit-testing
func (*MixedcaseAddress) Address ¶
func (ma *MixedcaseAddress) Address() Address
Address returns the Address
func (*MixedcaseAddress) MarshalJSON ¶
func (ma *MixedcaseAddress) MarshalJSON() ([]byte, error)
MarshalJSON marshals the original Value
func (*MixedcaseAddress) Original ¶
func (ma *MixedcaseAddress) Original() string
Original returns the mixed-case input string
func (*MixedcaseAddress) String ¶
func (ma *MixedcaseAddress) String() string
String implements fmt.Stringer
func (*MixedcaseAddress) UnmarshalJSON ¶
func (ma *MixedcaseAddress) UnmarshalJSON(input []byte) error
UnmarshalJSON parses MixedcaseAddress
func (*MixedcaseAddress) ValidChecksum ¶
func (ma *MixedcaseAddress) ValidChecksum() bool
ValidChecksum returns true if the Address has valid checksum
type NetTopology ¶
type NetTopology struct { Type uint8 NetTopologyData []NetTopologyData }
type NetTopology1 ¶ added in v1.1.1
type NetTopology1 struct { Type uint8 NetTopologyData []NetTopologyData1 }
type NetTopologyData ¶
type NetTopologyData1 ¶ added in v1.1.1
type PrettyDuration ¶
PrettyDuration is a pretty printed version of a time.Duration value that cuts the unnecessary precision off from the formatted textual representation.
func (PrettyDuration) String ¶
func (d PrettyDuration) String() string
String implements the Stringer interface, allowing pretty printing of duration values rounded to three decimals.
type RecorbleTx ¶ added in v1.1.1
type ResendMsgCtrl ¶ added in v1.1.1
type ResendMsgCtrl struct {
// contains filtered or unexported fields
}
func NewResendMsgCtrl ¶ added in v1.1.1
func NewResendMsgCtrl(msg interface{}, sendFunc func(interface{}, uint32), interval int64, times uint32) (*ResendMsgCtrl, error)
func (*ResendMsgCtrl) Close ¶ added in v1.1.1
func (self *ResendMsgCtrl) Close()
type RetCallTxN ¶ added in v1.1.1
type ReuseMsgController ¶
type ReuseMsgController struct {
// contains filtered or unexported fields
}
func NewReuseMsgController ¶
func NewReuseMsgController(useInterval int64) *ReuseMsgController
func (ReuseMsgController) AddMsg ¶
func (self ReuseMsgController) AddMsg(msgKey Hash, msg interface{}, lastUseTime int64) error
func (ReuseMsgController) GetMsgByKey ¶
func (self ReuseMsgController) GetMsgByKey(msgKey Hash) interface{}
func (ReuseMsgController) GetMsgList ¶
func (self ReuseMsgController) GetMsgList() []interface{}
func (ReuseMsgController) IsExistMsg ¶
func (self ReuseMsgController) IsExistMsg(msgKey Hash) bool
func (ReuseMsgController) ReUseMsg ¶
func (self ReuseMsgController) ReUseMsg(msgKey Hash) (interface{}, error)
type RoleType ¶
type RoleType uint32
RoleType
func GetRoleTypeFromPosition ¶
func (RoleType) Transfer2ElectRole ¶ added in v1.1.1
func (rt RoleType) Transfer2ElectRole() ElectRoleType
type Signature ¶
type Signature [SignatureLength]byte
///////// Signature
func BytesToSignature ¶
func (Signature) MarshalText ¶ added in v1.1.1
func (a *Signature) MarshalJSON() ([]byte, error) { return hexutil.Bytes(a[:]).MarshalText() }
func (*Signature) UnmarshalJSON ¶ added in v1.1.1
type StorageSize ¶
type StorageSize float64
StorageSize is a wrapper around a float value that supports user friendly formatting.
func (StorageSize) String ¶
func (s StorageSize) String() string
String implements the stringer interface.
func (StorageSize) TerminalString ¶
func (s StorageSize) TerminalString() string
TerminalString implements log.TerminalStringer, formatting a string for console output during logging.
type UnprefixedAddress ¶
type UnprefixedAddress Address
UnprefixedHash allows marshaling an Address without 0x prefix.
func (UnprefixedAddress) MarshalText ¶
func (a UnprefixedAddress) MarshalText() ([]byte, error)
MarshalText encodes the Address as hex.
func (*UnprefixedAddress) UnmarshalText ¶
func (a *UnprefixedAddress) UnmarshalText(input []byte) error
UnmarshalText decodes the Address from hex. The 0x prefix is optional.
type UnprefixedHash ¶
type UnprefixedHash Hash
UnprefixedHash allows marshaling a Hash without 0x prefix.
func (UnprefixedHash) MarshalText ¶
func (h UnprefixedHash) MarshalText() ([]byte, error)
MarshalText encodes the hash as hex.
func (*UnprefixedHash) UnmarshalText ¶
func (h *UnprefixedHash) UnmarshalText(input []byte) error
UnmarshalText decodes the hash from hex. The 0x prefix is optional.
type VIPRoleType ¶ added in v1.1.1
type VIPRoleType uint16
const ( VIP_Nil VIPRoleType = 0 VIP_1 VIPRoleType = 1 VIP_2 VIPRoleType = 2 VIP_3 VIPRoleType = 3 )
func GetVIPLevel ¶ added in v1.1.1
func GetVIPLevel(index int) VIPRoleType
type VerifiedSign ¶
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package bitutil implements fast bitwise operations.
|
Package bitutil implements fast bitwise operations. |
Package compiler wraps the Solidity compiler executable (solc).
|
Package compiler wraps the Solidity compiler executable (solc). |
Package hexutil implements hex encoding with 0x prefix.
|
Package hexutil implements hex encoding with 0x prefix. |
Package math provides integer math utilities.
|
Package math provides integer math utilities. |
package mclock is a wrapper for a monotonic clock source
|
package mclock is a wrapper for a monotonic clock source |