/
types.go
86 lines (73 loc) · 2.02 KB
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
// 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
package mc
import (
"math/big"
"github.com/MatrixAINetwork/go-matrix/common"
)
//by // 2018-08-18由tx_pool.go转移到此
const (
Heartbeat = "Heartbeat" // 心跳交易(广播区块Hash对99取余)
Publickey = "SeedProof" // 公钥交易
Privatekey = "Seed" // 私钥交易
CallTheRoll = "CallTheRoll" //点名交易 (广播节点随机连接1000个点)
)
func ReturnBroadCastType() (bType map[string]bool) {
bType = make(map[string]bool)
bType[Heartbeat] = true
bType[Publickey] = true
bType[Privatekey] = true
bType[CallTheRoll] = true
return bType
}
type BlockToBucket struct {
Ms []common.Address
Height *big.Int
Role common.RoleType
}
type BlockToLinker struct {
Height *big.Int
BroadCastInterval *BCIntervalInfo
Role common.RoleType
}
//Election Module
type MasterMinerReElectionRspMsg struct {
SeqNum uint64
//MasterMinerList []election.ElectionResultInfo
//BackUpMinerList []election.ElectionResultInfo
}
type MasterValidatorReElectionRspMsg struct {
SeqNum uint64
//MasterValidatorList []election.ElectionResultInfo
//BackUpMasterValidatorList []election.ElectionResultInfo
//CandidateMasterValidatorList []election.ElectionResultInfo
}
type LeaderStateMsg struct {
Leader common.Address
Number big.Int
ReelectTurn uint8
}
type SyncIdEvent struct { //lb
Role common.RoleType
}
// type BlockVerifyReqMsg struct {
// Header types.Header
// TxsCode []uint32
// }
// type BlockVerifyResultMsg struct {
// Header *types.Header // 包含签名列表的header
// TxsCode []uint32 // 交易列表
// }
// type VoteMsg struct {
// SignHash common.Hash
// //Sign common.Signature
// FromAccount common.Address
// }
// // ReElection
// type RandomSeedReq struct {
// Height *big.Int
// }
// type ElectionSeedRsp struct {
// Seed common.Hash
// }