@@ -12,6 +12,7 @@ import (
12
12
13
13
"github.com/spf13/cobra"
14
14
15
+ ioAddress "github.com/iotexproject/iotex-address/address"
15
16
"github.com/iotexproject/iotex-core/ioctl/config"
16
17
"github.com/iotexproject/iotex-core/ioctl/output"
17
18
"github.com/iotexproject/iotex-core/ioctl/util"
@@ -52,11 +53,15 @@ type balanceMessage struct {
52
53
53
54
// balance gets balance of an IoTeX blockchain address
54
55
func balance (arg string ) error {
55
- address , err := util .GetAddress (arg )
56
- if err != nil {
57
- return output .NewError (output .AddressError , "" , err )
58
- }
59
- accountMeta , err := GetAccountMeta (address )
56
+ addr := arg
57
+ if arg != ioAddress .StakingBucketPoolAddr && arg != ioAddress .RewardingPoolAddr {
58
+ var err error
59
+ addr , err = util .GetAddress (arg )
60
+ if err != nil {
61
+ return output .NewError (output .AddressError , "" , err )
62
+ }
63
+ }
64
+ accountMeta , err := GetAccountMeta (addr )
60
65
if err != nil {
61
66
return output .NewError (0 , "" , err ) // TODO: undefined error
62
67
}
@@ -65,7 +70,7 @@ func balance(arg string) error {
65
70
return output .NewError (output .ConvertError , "" , err )
66
71
}
67
72
message := balanceMessage {
68
- Address : address ,
73
+ Address : addr ,
69
74
Balance : util .RauToString (balance , util .IotxDecimalNum ),
70
75
}
71
76
fmt .Println ((message .String ()))
0 commit comments