From cad3d7a8ebac3fcee2b9b4093330751959283c25 Mon Sep 17 00:00:00 2001 From: AstaFrode Date: Tue, 13 Aug 2024 19:32:37 +0800 Subject: [PATCH] update increaseSpaceCmd_Runfunc (#283) --- cmd/console/increase.go | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/cmd/console/increase.go b/cmd/console/increase.go index 4e41ea9..fb25728 100644 --- a/cmd/console/increase.go +++ b/cmd/console/increase.go @@ -158,20 +158,30 @@ func increaseSpaceCmd_Runfunc(cmd *cobra.Command, args []string) { os.Exit(1) } - accInfo, err := cli.QueryAccountInfo(cli.GetSignatureAcc(), -1) + minerInfo, err := cli.QueryMinerItems(cli.GetSignatureAccPulickey(), -1) if err != nil { if err.Error() != chain.ERR_Empty { out.Err(err.Error()) os.Exit(1) } - out.Err("signature account does not exist, possible: 1.balance is empty 2.rpc address error") + out.Err("You are not a storage miner: " + cli.GetSignatureAcc()) + os.Exit(1) + } + + accInfo, err := cli.QueryAccountInfoByAccountID(minerInfo.StakingAccount[:], -1) + if err != nil { + if err.Error() != chain.ERR_Empty { + out.Err(err.Error()) + os.Exit(1) + } + out.Err("staking account does not exist, possible: 1.balance is empty 2.rpc address error") os.Exit(1) } token := space * chain.StakingStakePerTiB token_cess, _ := new(big.Int).SetString(fmt.Sprintf("%d%s", token, chain.TokenPrecision_CESS), 10) if accInfo.Data.Free.CmpAbs(token_cess) < 0 { - out.Err(fmt.Sprintf("signature account balance less than %d %s", token, cli.GetTokenSymbol())) + out.Err(fmt.Sprintf("staking account balance less than %d %s", token, cli.GetTokenSymbol())) os.Exit(1) }