-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathinput.go
58 lines (54 loc) · 1.69 KB
/
input.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
package smartpool
import (
"github.com/ethereum/go-ethereum/common"
"math/big"
"time"
)
type Input struct {
rpcEndPoint string
keystorePath string
shareThreshold int
claimThreshold int
shareDifficulty *big.Int
submitInterval time.Duration
contractAddr string
minerAddr string
extraData string
hotStop bool
}
func (i *Input) RPCEndpoint() string { return i.rpcEndPoint }
func (i *Input) KeystorePath() string { return i.keystorePath }
func (i *Input) ShareThreshold() int { return i.shareThreshold }
func (i *Input) ClaimThreshold() int { return i.claimThreshold }
func (i *Input) ShareDifficulty() *big.Int { return i.shareDifficulty }
func (i *Input) SubmitInterval() time.Duration { return i.submitInterval }
func (i *Input) ContractAddress() string { return i.contractAddr }
func (i *Input) MinerAddress() string { return i.minerAddr }
func (i *Input) ExtraData() string { return i.extraData }
func (i *Input) HotStop() bool { return i.hotStop }
func (i *Input) SetMinerAddress(addr common.Address) {
i.minerAddr = addr.Hex()
}
func (i *Input) SetExtraData(extra string) {
i.extraData = extra
}
func (i *Input) SetContractAddress(addr common.Address) {
i.contractAddr = addr.Hex()
}
func NewInput(
rpcEndPoint string,
keystorePath string,
shareThreshold int,
claimThreshold int,
shareDifficulty *big.Int,
submitInterval time.Duration,
contractAddr string,
minerAddr string,
extraData string,
hotStop bool,
) *Input {
return &Input{
rpcEndPoint, keystorePath, shareThreshold, claimThreshold, shareDifficulty,
submitInterval, contractAddr, minerAddr, extraData, hotStop,
}
}