Skip to content

Commit

Permalink
Address comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan-Ethernal committed Dec 15, 2023
1 parent e82f70c commit 3c92d8d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions command/bridge/finalize/finalize.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,12 +215,12 @@ func decodeGenesisAccounts(genesisSetRaw string) (map[types.Address]*contractsap

preminedTokens, ok := rawAccount["preminedTokens"].(*big.Int)
if !ok {
return nil, errors.New("failed to retrieve genesis account non staked tokens")
return nil, errors.New("failed to retrieve genesis account non-staked balance")
}

stakedTokens, ok := rawAccount["stakedTokens"].(*big.Int)
if !ok {
return nil, errors.New("failed to retrieve genesis account staked tokens")
return nil, errors.New("failed to retrieve genesis account staked balance")
}

isValidator, ok := rawAccount["isValidator"].(bool)
Expand Down
4 changes: 2 additions & 2 deletions command/bridge/premine/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ type premineParams struct {
stakedAmount string
premineAmount string

nonStakedValue *big.Int
premineAmountValue *big.Int
stakedValue *big.Int
nativeTokenRootAddr types.Address
bladeManagerAddr types.Address
Expand All @@ -43,7 +43,7 @@ func (p *premineParams) validateFlags() (err error) {
return fmt.Errorf("invalid blade manager address is provided: %w", err)
}

if p.nonStakedValue, err = common.ParseUint256orHex(&p.premineAmount); err != nil {
if p.premineAmountValue, err = common.ParseUint256orHex(&p.premineAmount); err != nil {
return err
}

Expand Down
10 changes: 5 additions & 5 deletions command/bridge/premine/premine.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,14 @@ func setFlags(cmd *cobra.Command) {
&params.premineAmount,
premineAmountFlag,
"",
"amount to premine as non staked balance",
"amount to premine as a non-staked balance",
)

cmd.Flags().StringVar(
&params.stakedAmount,
stakedAmountFlag,
"",
"amount to premine as staked balance",
"amount to premine as a staked balance",
)

cmd.MarkFlagsMutuallyExclusive(polybftsecrets.AccountDirFlag, polybftsecrets.AccountConfigFlag)
Expand Down Expand Up @@ -114,7 +114,7 @@ func runCommand(cmd *cobra.Command, _ []string) error {
}

approveTxn, err := bridgeHelper.CreateApproveERC20Txn(
new(big.Int).Add(params.nonStakedValue, params.stakedValue),
new(big.Int).Add(params.premineAmountValue, params.stakedValue),
params.bladeManagerAddr,
params.nativeTokenRootAddr, true)
if err != nil {
Expand All @@ -131,7 +131,7 @@ func runCommand(cmd *cobra.Command, _ []string) error {
}

premineFn := &contractsapi.AddGenesisBalanceBladeManagerFn{
NonStakeAmount: params.nonStakedValue,
NonStakeAmount: params.premineAmountValue,
StakeAmount: params.stakedValue,
}

Expand All @@ -154,7 +154,7 @@ func runCommand(cmd *cobra.Command, _ []string) error {

outputter.WriteCommandResult(&premineResult{
Address: ownerKey.Address().String(),
NonStakedAmount: params.nonStakedValue,
NonStakedAmount: params.premineAmountValue,
StakedAmount: params.stakedValue,
})

Expand Down

0 comments on commit 3c92d8d

Please sign in to comment.