Skip to content

Commit

Permalink
fix: wrong asset id in Operation Asset Claim Pool
Browse files Browse the repository at this point in the history
  • Loading branch information
sschiessl-bcp committed Dec 31, 2022
1 parent 6a2e7f1 commit 8b0c6e9
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions app/core/app.utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
}
}
}

// function to reduce the amount of duplicated code within operation asset fetch/amount calculation
const getAsset = (asset_id, amount = 0) => {
return $http.get(appConfig.urls.python_backend() + "/asset?asset_id=" + asset_id).then((asset) => {
Expand All @@ -60,7 +60,7 @@
}
})
}

// function to reduce the amount of duplicated code within operation account fetch
const getAccount = (account_id) => {
return $http.get(appConfig.urls.python_backend() + "/account_name?account_id=" + account_id).then((response) => response.data);
Expand Down Expand Up @@ -115,7 +115,7 @@
var operation_account = 0;
var operation_text;
var fee_paying_account;

const getLink = () => ({
asset: (assetName) => ({
text: assetName,
Expand All @@ -134,7 +134,7 @@
href: `/#/credit-offers/${offerId}`
})
})

const translateCallback = (key, params = {}) => {
callback(
$filter('translateWithLinks')(key, {
Expand Down Expand Up @@ -465,15 +465,15 @@
}
else if (operation_type === 9) { // account transfer
operation_account = operation.account_to_upgrade;

getAccount(operation.account_id).then((account_name) => {
getAccount(operation.new_owner).then((owner_account_name) => {
translateCallback('Operation Account Transfer', {
account: getLink().account(account_name),
newAccount: getLink().account(owner_account_name),
})
});

})
}
else if (operation_type === 10) {
Expand Down Expand Up @@ -504,7 +504,7 @@
asset: getLink().asset(asset.symbol),
})
});

})
}
else if (operation_type === 13) { // asset update feed producers
Expand All @@ -515,7 +515,7 @@
asset: getLink().asset(asset.symbol),
})
});

})
}
else if (operation_type === 14) {
Expand Down Expand Up @@ -603,7 +603,7 @@
amount: asset.amount,
})
});

})
}
else if (operation_type === 18) { // asset global settle
Expand All @@ -615,7 +615,7 @@
price: asset.amount,
})
});

})
}
else if (operation_type === 19) {
Expand Down Expand Up @@ -726,7 +726,7 @@
});
})
}

else if (operation_type === 33) {
operation_account = operation.owner_;

Expand Down Expand Up @@ -837,7 +837,7 @@
})
})
}

else if (operation_type === 45) { // BID COLLATERAL
operation_account = operation.bidder;

Expand Down Expand Up @@ -946,7 +946,7 @@
}
else if (operation_type === 47) { // asset claim pool
getAccount(operation.issuer).then((account) => {
getAsset(operation.asset_id, operation.amount_to_claim).then((asset) => {
getAsset(operation.amount_to_claim.asset_id, operation.amount_to_claim.amount).then((asset) => {
translateCallback('Operation Asset Claim Pool', {
account: getLink().account(account),
amount : asset.amount,
Expand Down Expand Up @@ -1488,10 +1488,10 @@
}
else if (operation_type === 69) { // Credit Offer Create
const operation_account = operation.owner_account;

getAccount(operation_account).then((account_name) => {
getAsset(operation.asset_type, operation.balance).then((asset) => {

operation_text = $filter('translateWithLinks')('Operation Credit Offer Create', {
accountLink: getLink().account(account_name),
fee: String(operation.fee_rate),
Expand Down Expand Up @@ -1519,7 +1519,7 @@
}
else if (operation_type === 71) { // Credit Offer Update
const operation_account = operation.owner_account;

getAccount(operation_account).then((account_name) => {
operation_text = $filter('translateWithLinks')('Operation Credit Offer Update', {
accountLink: getLink().account(account_name),
Expand Down Expand Up @@ -1562,7 +1562,7 @@
})
})
}

else if (operation_type === 74) { // Expired Credit Deal
console.log('debug expired', operation)
const operation_account = operation.borrower;
Expand All @@ -1579,7 +1579,7 @@
});
})
}

else {

operation_text = $filter('translate')('Operation Beautifier Missing Description', {
Expand Down

0 comments on commit 8b0c6e9

Please sign in to comment.