Skip to content

Commit

Permalink
more human readable translations for smart contracts
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyofbyteball committed Jun 30, 2020
1 parent a60fee8 commit 0c209d4
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/js/services/correspondentListService.js
Original file line number Diff line number Diff line change
Expand Up @@ -633,10 +633,19 @@ angular.module('copayApp.services').factory('correspondentListService', function
str += ' after MCI '+min_mci;
return str;
case 'has':
if (args.what === 'output' && args.asset && args.amount_at_least && args.address)
return 'sends at least ' + getAmountText(args.amount_at_least, args.asset) + ' to ' + getDisplayAddress(args.address);
if (args.what === 'output' && args.asset && args.amount && args.address)
return 'sends ' + getAmountText(args.amount, args.asset) + ' to ' + getDisplayAddress(args.address);
if (args.what === 'output' && args.asset && args.address) {
if (args.amount_at_least)
return 'sends at least ' + getAmountText(args.amount_at_least, args.asset) + ' to ' + getDisplayAddress(args.address);
if (args.amount_at_most)
return 'sends at most ' + getAmountText(args.amount_at_most, args.asset) + ' to ' + getDisplayAddress(args.address);
if (args.amount)
return 'sends ' + getAmountText(args.amount, args.asset) + ' to ' + getDisplayAddress(args.address);
return 'sends ' + escapeHtml(profileService.getUnitName(args.asset)) + ' to ' + getDisplayAddress(args.address);
}
return escapeHtml(JSON.stringify(arrSubdefinition));
case 'has one':
if (args.what === 'output' && Object.keys(args).length === 1)
return 'has only one output';
return escapeHtml(JSON.stringify(arrSubdefinition));
case 'seen':
if (args.what === 'output' && args.asset && args.amount && args.address){
Expand Down

0 comments on commit 0c209d4

Please sign in to comment.