-
Notifications
You must be signed in to change notification settings - Fork 10
/
interfaces.go
50 lines (44 loc) · 1.04 KB
/
interfaces.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
package common
import "math/big"
// Output data
type Output interface {
Status(status *Status)
Balance(balance *Balance)
Info(msg string, params ...interface{})
Error(msg string, params ...interface{})
Fatal(msg string, params ...interface{})
Warn(msg string, params ...interface{})
}
// Manager manage the cpchain node
type Manager interface {
GetStatus() (*Status, error)
StartMining() error
StopMining() error
GetBalance() (*Balance, error)
GetBalanceOnReward() (*RewardBalance, error)
Withdraw() error
SubmitDeposit() error
WantRenew() error
QuitRenew() error
}
// Balance of the cpchain node
type Balance struct {
Balance big.Int
Reward RewardBalance
}
// Status is the status of cpchain ndoe
type Status struct {
Mining bool
RNode bool
ENode bool
Proposer bool
Locked bool
NextNumber *big.Int
SupportPrivateTx bool
}
// RewardBalance is balance of contract namded reward
type RewardBalance struct {
TotalBalance *big.Int
FreeBalance *big.Int
LockedBalance *big.Int
}