-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parsed Err msg #1094
Merged
Merged
Parsed Err msg #1094
Changes from 17 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
d27e390
Parsed Err msg and updated config file for 7005
0e61429
Handle different bonding errors
10a1dd4
Merge branch 'develop' into fedekunze/1071-err-msgs
fedekunze b58cdaf
Added test
2d8b312
Merge branch 'fedekunze/1071-err-msgs' of https://github.com/cosmos/v…
47cdc5e
Merge branch 'develop' into fedekunze/1071-err-msgs
fedekunze 9e89aae
Updated tests
d4d5f85
Merge branch 'fedekunze/1071-err-msgs' of https://github.com/cosmos/v…
e909293
Merge branch 'develop' into fedekunze/1071-err-msgs
fedekunze 4579e00
updated snapshots, look ok
okwme 05eb6f7
Merge branch 'develop' into fedekunze/1071-err-msgs
okwme 59a544f
trigger CI
faboweb 89443d6
added revoked error to the lcdMock
okwme c8fe3c4
Merge branch 'develop' into fedekunze/1071-err-msgs
okwme 0decfd9
passing tests again
okwme c04c7ef
merged
okwme e179dc0
Merge branch 'develop' into fedekunze/1071-err-msgs
okwme 0c5ba98
Merge branch 'develop' into fedekunze/1071-err-msgs
okwme File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -176,6 +176,8 @@ let state = { | |
} | ||
|
||
module.exports = { | ||
candidates: state.candidates, | ||
|
||
async lcdConnected() { | ||
return true | ||
}, | ||
|
@@ -256,14 +258,12 @@ module.exports = { | |
// staking | ||
async updateDelegations({ name, sequence, delegations, begin_unbondings }) { | ||
let results = [] | ||
|
||
let fromKey = state.keys.find(a => a.name === name) | ||
let fromAccount = state.accounts[fromKey.address] | ||
if (fromAccount == null) { | ||
results.push(txResult(1, "Nonexistent account")) | ||
return results | ||
} | ||
|
||
// check nonce | ||
if (parseInt(fromAccount.sequence) !== parseInt(sequence)) { | ||
results.push( | ||
|
@@ -274,7 +274,6 @@ module.exports = { | |
) | ||
return results | ||
} | ||
|
||
for (let tx of delegations) { | ||
let { denom } = tx.delegation | ||
let amount = parseInt(tx.delegation.amount) | ||
|
@@ -286,11 +285,9 @@ module.exports = { | |
results.push(txResult(1, "Not enough coins in your account")) | ||
return results | ||
} | ||
|
||
// update sender account | ||
incrementSequence(fromAccount) | ||
fromAccount.coins.find(c => c.denom === denom).amount -= amount | ||
|
||
// update stake | ||
let delegator = state.stake[fromKey.address] | ||
if (!delegator) { | ||
|
@@ -309,13 +306,27 @@ module.exports = { | |
} | ||
let shares = parseInt(delegation.shares) | ||
delegation.shares = (shares + amount).toString() | ||
|
||
let candidate = state.candidates.find(c => c.owner === tx.validator_addr) | ||
if (candidate.revoked) { | ||
throw new Error(`checkTx failed: (262245) Msg 0 failed: === ABCI Log === | ||
Codespace: 4 | ||
Code: 101 | ||
ABCICode: 262245 | ||
Error: --= Error =-- | ||
Data: common.FmtError{format:"validator for this address is currently revoked", args:[]interface {}(nil)} | ||
Msg Traces: | ||
--= /Error =-- | ||
|
||
=== /ABCI Log ===`) | ||
} | ||
|
||
candidate.tokens = (parseInt(candidate.tokens) + amount).toString() | ||
candidate.delegator_shares = ( | ||
parseInt(candidate.delegator_shares) + amount | ||
).toString() | ||
|
||
// storeTx("cosmos-sdk/MsgDelegate", tx) // do we need this anymore? | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, this stores the txs in the txs list to be able to show them in the transaction history |
||
|
||
results.push(txResult(0)) | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This will probably be used more often (like with sending coins). Can we implement this somehow in
send.js
like changing the error message there?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'm trying to figure out which types of errors are encountered while transferring tokens