From 4f8899e47c9b50e1f0db06726c060659aa2e24b5 Mon Sep 17 00:00:00 2001 From: Federico Elgarte Date: Thu, 25 Oct 2018 11:21:18 -0300 Subject: [PATCH 1/2] Add support for createCheckpoint() from dividends modules --- CLI/commands/dividends_manager.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/CLI/commands/dividends_manager.js b/CLI/commands/dividends_manager.js index bde3aa900..0efb86758 100644 --- a/CLI/commands/dividends_manager.js +++ b/CLI/commands/dividends_manager.js @@ -128,8 +128,13 @@ async function start_explorer(){ await transferTokens(_to2,_amount2); break; case 'Create checkpoint': - let createCheckpointAction = securityToken.methods.createCheckpoint(); - await common.sendTransaction(Issuer, createCheckpointAction, defaultGasPrice); + if (await isDividendsModuleAttached()) { + let createCheckpointAction = currentDividendsModule.methods.createCheckpoint(); + await common.sendTransaction(Issuer, createCheckpointAction, defaultGasPrice); + } else { + console.log("You must to attach Dividends module to perform this action."); + process.exit(1); + } break; case 'Set default exclusions for dividends': await setDefaultExclusions(); From 1f3b0f1ec95332d1d6ddd1b3b08675b7766e616b Mon Sep 17 00:00:00 2001 From: Federico Elgarte Date: Thu, 25 Oct 2018 11:37:32 -0300 Subject: [PATCH 2/2] advices from Victor --- CLI/commands/dividends_manager.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/CLI/commands/dividends_manager.js b/CLI/commands/dividends_manager.js index 0efb86758..19280f981 100644 --- a/CLI/commands/dividends_manager.js +++ b/CLI/commands/dividends_manager.js @@ -128,13 +128,9 @@ async function start_explorer(){ await transferTokens(_to2,_amount2); break; case 'Create checkpoint': - if (await isDividendsModuleAttached()) { - let createCheckpointAction = currentDividendsModule.methods.createCheckpoint(); - await common.sendTransaction(Issuer, createCheckpointAction, defaultGasPrice); - } else { - console.log("You must to attach Dividends module to perform this action."); - process.exit(1); - } + await addDividendsModule(); + let createCheckpointAction = currentDividendsModule.methods.createCheckpoint(); + await common.sendTransaction(Issuer, createCheckpointAction, defaultGasPrice); break; case 'Set default exclusions for dividends': await setDefaultExclusions();