diff --git a/src/configManager.ts b/src/configManager.ts index f6a80ea..23aea56 100644 --- a/src/configManager.ts +++ b/src/configManager.ts @@ -29,6 +29,7 @@ export interface LamingtonConfig { keepAlive?: boolean; outDir?: string; exclude?: Array; + debugTransactions?: boolean; } /** @@ -181,6 +182,14 @@ export class ConfigManager { return ConfigManager.config.keepAlive || false; } + /** + * Returns the container keep alive setting or false + * @author Kevin Brown + */ + static get debugTransactions() { + return ConfigManager.config.debugTransactions || false; + } + /** * Returns the output build directory or [[CACHE_DIRECTORY]] * @author Mitch Pierias diff --git a/src/eosManager.ts b/src/eosManager.ts index b13d96b..5e49761 100644 --- a/src/eosManager.ts +++ b/src/eosManager.ts @@ -3,6 +3,7 @@ import { TextEncoder, TextDecoder } from 'util'; import { Api, JsonRpc } from 'eosjs'; import { JsSignatureProvider } from 'eosjs/dist/eosjs-jssig'; import { Account } from './accounts'; +import { ConfigManager } from './configManager'; /** * Manages client connection and communication with a local EOSIO node @@ -51,6 +52,14 @@ export class EOSManager { eos = EOSManager.api, options = { blocksBehind: 0, expireSeconds: 30 } ) => { + if (ConfigManager.debugTransactions) { + const calls = transaction.actions.map((action: any) => `${action.account}.${action.name}`); + console.log(`========== Calling ${calls.join(', ')} ==========`); + console.log('Transaction: ', JSON.stringify(transaction, null, 4)); + console.log('Options: ', options); + console.log(); + } + return eos.transact(transaction, options); }; }