Skip to content

Commit

Permalink
Merge pull request #81 from nearprotocol/fix-pending
Browse files Browse the repository at this point in the history
Fix pending result for receipts
  • Loading branch information
Evgeny Kuzyakov authored Oct 1, 2019
2 parents 57ba3df + 4153bef commit ac4279c
Show file tree
Hide file tree
Showing 84 changed files with 481 additions and 371 deletions.
21 changes: 20 additions & 1 deletion dist/nearlib.js
Original file line number Diff line number Diff line change
Expand Up @@ -779,6 +779,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
const enums_1 = require("../utils/enums");
var ExecutionStatusBasic;
(function (ExecutionStatusBasic) {
ExecutionStatusBasic["Unknown"] = "Unknown";
ExecutionStatusBasic["Pending"] = "Pending";
ExecutionStatusBasic["Failure"] = "Failure";
})(ExecutionStatusBasic = exports.ExecutionStatusBasic || (exports.ExecutionStatusBasic = {}));
Expand All @@ -801,11 +802,29 @@ var LegacyFinalTransactionStatus;
LegacyFinalTransactionStatus["Failed"] = "Failed";
LegacyFinalTransactionStatus["Completed"] = "Completed";
})(LegacyFinalTransactionStatus || (LegacyFinalTransactionStatus = {}));
var LegacyTransactionStatus;
(function (LegacyTransactionStatus) {
LegacyTransactionStatus["Unknown"] = "Unknown";
LegacyTransactionStatus["Completed"] = "Completed";
LegacyTransactionStatus["Failed"] = "Failed";
})(LegacyTransactionStatus || (LegacyTransactionStatus = {}));
function mapLegacyTransactionLog(tl) {
let status;
if (tl.result.status === LegacyTransactionStatus.Unknown) {
status = ExecutionStatusBasic.Unknown;
}
else if (tl.result.status === LegacyTransactionStatus.Failed) {
status = ExecutionStatusBasic.Failure;
}
else if (tl.result.status === LegacyTransactionStatus.Completed) {
status = {
SuccessValue: tl.result.result || ''
};
}
return {
id: tl.hash,
outcome: {
status: ExecutionStatusBasic.Pending,
status,
logs: tl.result.logs,
receipt_ids: tl.result.receipts,
gas_burnt: 0,
Expand Down
4 changes: 2 additions & 2 deletions dist/nearlib.min.js

Large diffs are not rendered by default.

48 changes: 24 additions & 24 deletions docs/nearlib/classes/_account_.account.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/nearlib/classes/_account_creator_.accountcreator.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions docs/nearlib/classes/_account_creator_.localaccountcreator.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions docs/nearlib/classes/_account_creator_.urlaccountcreator.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions docs/nearlib/classes/_connection_.connection.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit ac4279c

Please sign in to comment.