Skip to content

Commit

Permalink
Changing the sharder provider settings population based on new contra…
Browse files Browse the repository at this point in the history
…cts in gosdk.
  • Loading branch information
sunilmhta committed Jul 3, 2023
1 parent e8723ed commit 06885ce
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions cmd/updatenode.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,36 +64,32 @@ var minerscUpdateNodeSettings = &cobra.Command{
SimpleMiner: zcncore.SimpleMiner{
ID: id,
},
MinerSCDelegatePool: zcncore.MinerSCDelegatePool{
Settings: zcncore.StakePoolSettings{
NumDelegates: miner.Settings.NumDelegates,
MinStake: miner.Settings.MinStake,
MaxStake: miner.Settings.MaxStake,
},
},
}

if flags.Changed("num_delegates") {
miner.Settings.NumDelegates, err = flags.GetInt("num_delegates")
numDelegates, err := flags.GetInt("num_delegates")
if err != nil {
log.Fatal(err)
}
miner.Settings.NumDelegates = &numDelegates
}

if flags.Changed("min_stake") {
var min float64
if min, err = flags.GetFloat64("min_stake"); err != nil {
log.Fatal(err)
}
miner.Settings.MinStake = common.Balance(zcncore.ConvertToValue(min))
tokenBalance := common.Balance(zcncore.ConvertToValue(min))
miner.Settings.MinStake = &tokenBalance
}

if flags.Changed("max_stake") {
var max float64
if max, err = flags.GetFloat64("max_stake"); err != nil {
log.Fatal(err)
}
miner.Settings.MaxStake = common.Balance(zcncore.ConvertToValue(max))
tokenBalance := common.Balance(zcncore.ConvertToValue(max))
miner.Settings.MaxStake = &tokenBalance
}

txn, err := zcncore.NewTransaction(statusBar, getTxnFee(), nonce)
Expand Down

0 comments on commit 06885ce

Please sign in to comment.