Skip to content

Commit 5cf7e58

Browse files
committedJun 23, 2020
Add SetNetwork method
1 parent 7cbb7c0 commit 5cf7e58

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed
 

‎zboxcore/sdk/sdk.go

+5
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,11 @@ func SetQuerySleepTime(time int) {
102102
blockchain.SetQuerySleepTime(time)
103103
}
104104

105+
func SetNetwork(miners []string, sharders []string) {
106+
blockchain.SetMiners(miners)
107+
blockchain.SetSharders(sharders)
108+
}
109+
105110
//
106111
// read pool
107112
//

‎zcncore/wallet.go

+5
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,11 @@ func GetNetwork() *Network {
363363
}
364364
}
365365

366+
func SetNetwork(miners []string, sharders []string) {
367+
_config.chain.Miners = miners
368+
_config.chain.Sharders = sharders
369+
}
370+
366371
func GetNetworkJSON() string {
367372
network := GetNetwork()
368373
networkBytes, _ := json.Marshal(network)

0 commit comments

Comments
 (0)
Please sign in to comment.