Skip to content
This repository has been archived by the owner on Sep 7, 2023. It is now read-only.

Commit

Permalink
fix(engine) Remove unnecessary async in the engine
Browse files Browse the repository at this point in the history
Signed-off-by: Jerome Simeon <jeromesimeon@me.com>
  • Loading branch information
jeromesimeon committed Jun 25, 2020
1 parent 7e8a925 commit a80644a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions packages/ergo-engine/lib/engine.js
Expand Up @@ -96,9 +96,9 @@ class Engine {
* using the Composer serializer.
* @param {string} currentTime - the definition of 'now'
* @param {object} options to the text generation
* @return {Promise} a promise that resolves to a result for the clause
* @return {object} the result for the clause
*/
async trigger(logic, contractId, contract, request, state, currentTime, options) {
trigger(logic, contractId, contract, request, state, currentTime, options) {
// Set the current time and UTC Offset
const now = Util.setCurrentTime(currentTime);
const utcOffset = now.utcOffset();
Expand Down Expand Up @@ -139,7 +139,7 @@ class Engine {
'state': validNewState,
'emit': validEmit,
};
return Promise.resolve(answer);
return answer;
}

/**
Expand All @@ -153,9 +153,9 @@ class Engine {
* using the Composer serializer.
* @param {string} currentTime - the definition of 'now'
* @param {object} options to the text generation
* @return {Promise} a promise that resolves to a result for the clause
* @return {object} the result for the clause
*/
async invoke(logic, contractId, clauseName, contract, params, state, currentTime, options) {
invoke(logic, contractId, clauseName, contract, params, state, currentTime, options) {
// Set the current time and UTC Offset
const now = Util.setCurrentTime(currentTime);
const utcOffset = now.utcOffset();
Expand Down Expand Up @@ -195,7 +195,7 @@ class Engine {
'state': validNewState,
'emit': validEmit,
};
return Promise.resolve(answer);
return answer;
}

/**
Expand All @@ -206,7 +206,7 @@ class Engine {
* @param {object} params - the clause parameters
* @param {string} currentTime - the definition of 'now'
* @param {object} options to the text generation
* @return {Promise} a promise that resolves to a result for the clause initialization
* @return {object} the result for the clause initialization
*/
async init(logic, contractId, contract, params, currentTime, options) {
const defaultState = {
Expand All @@ -224,7 +224,7 @@ class Engine {
* @param {object} params - the clause parameters
* @param {string} currentTime - the definition of 'now'
* @param {object} options to the text generation
* @return {Promise} a promise that resolves to a result for the clause initialization
* @return {object} the result for draft
*/
async draft(logic, contractId, contract, params, currentTime, options) {
options = options || {};
Expand Down

0 comments on commit a80644a

Please sign in to comment.