Skip to content
Snippets Groups Projects

merge autoclave into master

Merged Bartłomiej Górnicki requested to merge autoclave into master
2 files
+ 18
2
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -56,11 +56,27 @@ export default function reducer(state = defaultState, action) {
@@ -56,11 +56,27 @@ export default function reducer(state = defaultState, action) {
let errorStr = error.toString();
let errorStr = error.toString();
let errorKey = 'Transaction broadcast error.';
let errorKey = 'Transaction broadcast error.';
for (const [type /*, operation*/] of operations) {
for (const [type, operation] of operations) {
switch (type) {
switch (type) {
case 'transfer':
case 'transfer':
if (/get_balance/.test(errorStr)) {
if (/get_balance/.test(errorStr)) {
errorKey = 'Insufficient balance.';
errorKey = 'Insufficient balance.';
 
} else {
 
for (
 
let ei = 0;
 
ei < error.data.stack.length;
 
ei += 1
 
) {
 
const errorStackItem = error.data.stack[ei];
 
 
if (
 
errorStackItem.data.name === operation.to &&
 
errorStackItem.data.what === 'unknown key'
 
) {
 
errorKey = 'Unknown recipient';
 
break;
 
}
 
}
}
}
break;
break;
case 'withdraw_vesting':
case 'withdraw_vesting':
Loading