-
Notifications
You must be signed in to change notification settings - Fork 71
/
models.go
49 lines (44 loc) · 1.7 KB
/
models.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
package public
import (
"github.com/ardanlabs/blockchain/foundation/blockchain/database"
)
type act struct {
Account database.AccountID `json:"account"`
Name string `json:"name"`
Balance uint64 `json:"balance"`
Nonce uint64 `json:"nonce"`
}
type actInfo struct {
LastestBlock string `json:"lastest_block"`
Uncommitted int `json:"uncommitted"`
Accounts []act `json:"accounts"`
}
type tx struct {
FromAccount database.AccountID `json:"from"`
FromName string `json:"from_name"`
To database.AccountID `json:"to"`
ToName string `json:"to_name"`
ChainID uint16 `json:"chain_id"`
Nonce uint64 `json:"nonce"`
Value uint64 `json:"value"`
Tip uint64 `json:"tip"`
Data []byte `json:"data"`
TimeStamp uint64 `json:"timestamp"`
GasPrice uint64 `json:"gas_price"`
GasUnits uint64 `json:"gas_units"`
Sig string `json:"sig"`
Proof []string `json:"proof"`
ProofOrder []int64 `json:"proof_order"`
}
type block struct {
Number uint64 `json:"number"`
PrevBlockHash string `json:"prev_block_hash"`
TimeStamp uint64 `json:"timestamp"`
BeneficiaryID database.AccountID `json:"beneficiary"`
Difficulty uint16 `json:"difficulty"`
MiningReward uint64 `json:"mining_reward"`
StateRoot string `json:"state_root"`
TransRoot string `json:"trans_root"`
Nonce uint64 `json:"nonce"`
Transactions []tx `json:"txs"`
}