-
Notifications
You must be signed in to change notification settings - Fork 66
Problem: Ambiguous error message for empty staking address #845
Conversation
Solution: Added a more detailed error message. Fixes #838
@@ -126,7 +126,7 @@ impl fmt::Display for Error { | |||
// FIXME: IoError(ref err) => write!(f, "IO error: {}", err), | |||
IoError => write!(f, "database lookup error"), | |||
EnclaveRejected => write!(f, "enclave error or invalid TX"), | |||
AccountNotFound => write!(f, "account not found"), | |||
AccountNotFound => write!(f, "account does not exist for given staking address on blockchain"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess the main confusion in the issue is, the staking address do exists in the wallet, it just has empty transaction history on the blockchain, so a better solution maybe show a empty value to user. A default StakingState
when query staking state, a empty list when query transaction history.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do not any command to show transaction history for a staking account. Only fetching current state is supported. When an account does not exist, we have 2 options:
- Show a more detailed error message that the account for given staking address does not exist on blockchain.
- Show a default state.
After discussing with @tomtau and @lezzokafka, we reached on conclusion to use option 1. But, we can show a default state if that seems to be more correct option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👌
Codecov Report
@@ Coverage Diff @@
## master #845 +/- ##
==========================================
- Coverage 69.17% 69.17% -0.01%
==========================================
Files 132 132
Lines 17184 17187 +3
==========================================
+ Hits 11887 11889 +2
- Misses 5297 5298 +1
|
bors r+ |
845: Problem: Ambiguous error message for empty staking address r=tomtau a=devashishdxt Solution: Added a more detailed error message. Fixes #838 Co-authored-by: Devashish Dixit <[email protected]>
Solution: Added a more detailed error message. Fixes #838