From 22392e11d628d43d7af8f7a149eecef08a63db73 Mon Sep 17 00:00:00 2001 From: abhay-pepo Date: Thu, 15 Mar 2018 16:02:21 +0530 Subject: [PATCH 001/115] Added multi cache management --- app/models/user_airdrop_detail.js | 10 +- lib/airdrop_management/batch_allocator.js | 2 +- lib/airdrop_management/user_balance.js | 2 +- lib/cache_multi_management/base.js | 189 ++++++++++++++++++ .../user_airdrop_detail.js | 2 +- lib/transaction_helper.js | 2 +- 6 files changed, 198 insertions(+), 9 deletions(-) create mode 100644 lib/cache_multi_management/base.js rename lib/{cache_management => cache_multi_management}/user_airdrop_detail.js (97%) diff --git a/app/models/user_airdrop_detail.js b/app/models/user_airdrop_detail.js index b01f59f..bdda74b 100644 --- a/app/models/user_airdrop_detail.js +++ b/app/models/user_airdrop_detail.js @@ -39,8 +39,8 @@ const UserAirdropDetailKlassPrototype = { */ getByUserAddresses: async function (airdropId, userAddresses) { var oThis = this; - logger.info("========user_airdrop_detail.getByUserAddresses().userAddresses========="); - logger.info(userAddresses); + logger.debug("========user_airdrop_detail.getByUserAddresses().userAddresses========="); + logger.debug(userAddresses); return new Promise(async function (onResolve, onReject) { var result = {} , userAirdropDetail = {} @@ -58,7 +58,7 @@ const UserAirdropDetailKlassPrototype = { for (var i in userAddresses) { userAddressesMap[userAddresses[i].toLowerCase()] = userAddresses[i]; } - logger.info("userAddressesMap ", userAddressesMap); + logger.debug("userAddressesMap ", userAddressesMap); for (var uadIndex in userAirdropDetailResultArray) { userAirdropDetail = userAirdropDetailResultArray[uadIndex]; @@ -73,8 +73,8 @@ const UserAirdropDetailKlassPrototype = { balanceAirdropAmount: balanceAirdropAmount.toString(10) }; } - logger.info("========user_airdrop_detail.getByUserAddresses().result========="); - logger.info(result); + logger.debug("========user_airdrop_detail.getByUserAddresses().result========="); + logger.debug(result); return onResolve(responseHelper.successWithData(result)); } catch (error) { return onResolve(responseHelper.error('a_m_uad_1', 'error:' + error)); diff --git a/lib/airdrop_management/batch_allocator.js b/lib/airdrop_management/batch_allocator.js index 55c376a..1862470 100644 --- a/lib/airdrop_management/batch_allocator.js +++ b/lib/airdrop_management/batch_allocator.js @@ -15,7 +15,7 @@ const rootPrefix = '../..' , BigNumber = require('bignumber.js') , basicHelper = require(rootPrefix + '/helpers/basic_helper') , logger = require(rootPrefix + '/helpers/custom_console_logger') - , userAirdropDetailCacheKlass = require(rootPrefix + '/lib/cache_management/user_airdrop_detail') + , userAirdropDetailCacheKlass = require(rootPrefix + '/lib/cache_multi_management/user_airdrop_detail') ; /** diff --git a/lib/airdrop_management/user_balance.js b/lib/airdrop_management/user_balance.js index 132e33d..1836de2 100644 --- a/lib/airdrop_management/user_balance.js +++ b/lib/airdrop_management/user_balance.js @@ -11,7 +11,7 @@ const rootPrefix = '../..' , airdropKlass = require(rootPrefix + '/app/models/airdrop') , basicHelper = require(rootPrefix + '/helpers/basic_helper') , logger = require(rootPrefix + '/helpers/custom_console_logger') - , userAirdropDetailCacheKlass = require(rootPrefix + '/lib/cache_management/user_airdrop_detail') + , userAirdropDetailCacheKlass = require(rootPrefix + '/lib/cache_multi_management/user_airdrop_detail') ; /** diff --git a/lib/cache_multi_management/base.js b/lib/cache_multi_management/base.js new file mode 100644 index 0000000..ba63e25 --- /dev/null +++ b/lib/cache_multi_management/base.js @@ -0,0 +1,189 @@ +"use strict"; + +const rootPrefix = '../..' + , coreConstants = require(rootPrefix + '/config/core_constants') + , openStCache = require('@openstfoundation/openst-cache') + , cacheImplementer = new openStCache.cache(coreConstants.CACHING_ENGINE, true) + , responseHelper = require(rootPrefix + '/lib/formatter/response') + , logger = require(rootPrefix+'/helpers/custom_console_logger') + , utils = require(rootPrefix + '/lib/utils') +; + +/** + * constructor + * + * @param {Object} params - cache key generation & expiry related params + * + * @constructor + */ +const baseCacheMultiManagementKlass = function(params) { + + const oThis = this; + + if (!params) { + params = {}; + } + + oThis.params = params; + + oThis.cacheKeys = {}; + + // call sub class method to set cache keys using params provided + oThis.setCacheKeys(); + +}; + +baseCacheMultiManagementKlass.prototype = { + + /** + * Fetch data from cache, in case of cache miss calls sub class method to fetch data from source + * + * @return {Promise} - On success, data.value has value. On failure, error details returned. + */ + fetch: async function () { + + const oThis = this; + + var data = await oThis._fetchFromCache() + , fetchDataRsp = null; + + // if there are any cache misses then fetch that data from source. + if (data['cacheMiss'].length > 0) { + + fetchDataRsp = await oThis.fetchDataFromSource(data['cacheMiss']); + + // if fetch from source failed do not set cache and return error response + if (fetchDataRsp.isFailure()) { + logger.notify('l_cm_b_1', 'Something Went Wrong', fetchDataRsp); + return Promise.resolve(fetchDataRsp); + } else { + // DO NOT WAIT for cache being set + var cacheKeys = Object.keys(fetchDataRsp.data); + for (var i=0; i} + */ + clear: function () { + + const oThis = this; + + for (var i=0; iError while getting from cache: ", JSON.stringify(cacheFetchResponse)); + for (var i = 0; i < cacheKeys.length; i++) { + var cacheKey = cacheKeys[i]; + cacheMiss.push(oThis.cacheKeys[cacheKey]); + } + } + + return {cacheMiss: cacheMiss, cachedData: cachedResponse}; + }, + + /** + * set data in cache. + * + * @param {Object} dataToSet - data to set in cache + * + * @return {Result} + */ + _setCache: function (key, dataToSet) { + + const oThis = this; + + var setCacheFunction = function(k, v) { + var cacheKey = utils.invert(oThis.cacheKeys)[k]; + return cacheImplementer.set(cacheKey, JSON.stringify(v), oThis.cacheExpiry); + }; + + setCacheFunction(key, dataToSet).then(function(cacheSetResponse) { + + if (cacheSetResponse.isFailure()) { + logger.error('cmm_b_2', 'Something Went Wrong', cacheSetResponse); + } + }); + + } + +}; + +module.exports = baseCacheMultiManagementKlass; diff --git a/lib/cache_management/user_airdrop_detail.js b/lib/cache_multi_management/user_airdrop_detail.js similarity index 97% rename from lib/cache_management/user_airdrop_detail.js rename to lib/cache_multi_management/user_airdrop_detail.js index b64fcb8..1041a75 100644 --- a/lib/cache_management/user_airdrop_detail.js +++ b/lib/cache_multi_management/user_airdrop_detail.js @@ -1,7 +1,7 @@ "use strict"; const rootPrefix = '../..' - , baseCache = require(rootPrefix + '/lib/cache_management/base') + , baseCache = require(rootPrefix + '/lib/cache_multi_management/base') , UserAirdropDetailKlass = require(rootPrefix + '/app/models/user_airdrop_detail') , responseHelper = require(rootPrefix + '/lib/formatter/response') , logger = require(rootPrefix + '/helpers/custom_console_logger') diff --git a/lib/transaction_helper.js b/lib/transaction_helper.js index c4e66b0..e918636 100644 --- a/lib/transaction_helper.js +++ b/lib/transaction_helper.js @@ -13,7 +13,7 @@ const BigNumber = require('bignumber.js') const rootPrefix = '..' , responseHelper = require(rootPrefix + '/lib/formatter/response') , Token = require(rootPrefix + '/lib/contract_interact/branded_token') - , UserAirdropDetailCacheKlass = require(rootPrefix + '/lib/cache_management/user_airdrop_detail') + , UserAirdropDetailCacheKlass = require(rootPrefix + '/lib/cache_multi_management/user_airdrop_detail') , AdjustAirdropAmountKlass = require(rootPrefix + '/lib/airdrop_management/adjust_airdrop_amount') , web3EventsDecoder = require(rootPrefix + '/lib/web3/events/decoder') , logger = require(rootPrefix + '/helpers/custom_console_logger') From 80fd60943f0b71cd6ef0fc40ffd81702ad624373 Mon Sep 17 00:00:00 2001 From: abhay-pepo Date: Thu, 15 Mar 2018 17:47:05 +0530 Subject: [PATCH 002/115] Cache airdrops table --- app/models/airdrop.js | 14 ++ .../adjust_airdrop_amount.js | 16 +- lib/airdrop_management/approve.js | 9 +- lib/airdrop_management/batch_allocator.js | 10 +- lib/airdrop_management/register.js | 10 +- lib/airdrop_management/transfer.js | 10 +- lib/airdrop_management/user_balance.js | 9 +- lib/cache_management/airdrop_model.js | 91 +++++++++++ lib/cache_management/base.js | 141 ++++++++++-------- lib/transaction_helper.js | 8 +- mocha_test/services/airdrop/pay_1.js | 9 +- 11 files changed, 227 insertions(+), 100 deletions(-) create mode 100644 lib/cache_management/airdrop_model.js diff --git a/app/models/airdrop.js b/app/models/airdrop.js index 528ff33..e645186 100644 --- a/app/models/airdrop.js +++ b/app/models/airdrop.js @@ -47,6 +47,19 @@ const AirdropKlassPrototype = { */ tableName: 'airdrops', + /** + * Select all airdrop contracts + * + * @return {Promise} + * + */ + getAll: function() { + const oThis = this + ; + + return oThis.select().fire(); + }, + /** * get airdrop AR by contract Address * @@ -62,6 +75,7 @@ const AirdropKlassPrototype = { return oThis.select().where(["contract_address=?", airdropContractAddress]). limit(1).fire(); } + }; Object.assign(AirdropKlass.prototype, AirdropKlassPrototype); diff --git a/lib/airdrop_management/adjust_airdrop_amount.js b/lib/airdrop_management/adjust_airdrop_amount.js index 60abf33..8f95efa 100644 --- a/lib/airdrop_management/adjust_airdrop_amount.js +++ b/lib/airdrop_management/adjust_airdrop_amount.js @@ -8,7 +8,7 @@ const rootPrefix = '../..' , responseHelper = require(rootPrefix + '/lib/formatter/response') - , airdropKlass = require(rootPrefix + '/app/models/airdrop') + , AirdropModelCacheKlass = require(rootPrefix + '/lib/cache_management/airdrop_model') , logger = require(rootPrefix + '/helpers/custom_console_logger') , userAirdropDetailKlass = require(rootPrefix + '/app/models/user_airdrop_detail') , BigNumber = require('bignumber.js') @@ -48,9 +48,10 @@ AdjustAirdropAmountKlass.prototype = { return new Promise(async function (onResolve, onReject) { var amountAdjustedLog = {}; try { - const airdropModel = new airdropKlass(); - const airdropModelResult = await airdropModel.getByContractAddress(oThis.airdropContractAddress); - const airdropRecord = airdropModelResult[0]; + const airdropModelCacheObject = new AirdropModelCacheKlass({useObject: true}) + , airdropModelCacheResponse = await airdropModelCacheObject.fetch() + , airdropRecord = airdropModelCacheResponse.data[oThis.airdropContractAddress] + ; var totalRemainingAmountToAdjust = new BigNumber(oThis.airdropAmountUsed); // Zero airdrop amount is possible if (totalRemainingAmountToAdjust.equals(0)) { @@ -138,9 +139,10 @@ AdjustAirdropAmountKlass.prototype = { return new Promise(async function (onResolve, onReject) { var amountAdjustedLog = {}; try { - const airdropModel = new airdropKlass(); - const airdropModelResult = await airdropModel.getByContractAddress(oThis.airdropContractAddress); - const airdropRecord = airdropModelResult[0]; + const airdropModelCacheObject = new AirdropModelCacheKlass({useObject: true}) + , airdropModelCacheResponse = await airdropModelCacheObject.fetch() + , airdropRecord = airdropModelCacheResponse.data[oThis.airdropContractAddress] + ; var totalRemainingAmountToAdjust = new BigNumber(oThis.airdropAmountUsed); // Zero airdrop amount is possible if (totalRemainingAmountToAdjust.equals(0)) { diff --git a/lib/airdrop_management/approve.js b/lib/airdrop_management/approve.js index 8480d79..8960f2c 100644 --- a/lib/airdrop_management/approve.js +++ b/lib/airdrop_management/approve.js @@ -13,7 +13,7 @@ const rootPrefix = '../..' , BigNumber = require('bignumber.js') , basicHelper = require(rootPrefix + '/helpers/basic_helper') , logger = require(rootPrefix + '/helpers/custom_console_logger') - , airdropKlass = require(rootPrefix + '/app/models/airdrop') + , AirdropModelCacheKlass = require(rootPrefix + '/lib/cache_management/airdrop_model') ; /** @@ -87,9 +87,10 @@ approve.prototype = { } // Check if airdropContractAddress is registered or not - var airdropModel = new airdropKlass(); - var result = await airdropModel.getByContractAddress(oThis.airdropContractAddress); - oThis.airdropRecord = result[0]; + const airdropModelCacheObject = new AirdropModelCacheKlass({useObject: true}) + , airdropModelCacheResponse = await airdropModelCacheObject.fetch() + ; + oThis.airdropRecord = airdropModelCacheResponse.data[oThis.airdropContractAddress]; if (!oThis.airdropRecord){ return onResolve(responseHelper.error('l_am_ub_vp_2', 'Given airdrop contract is not registered')); } diff --git a/lib/airdrop_management/batch_allocator.js b/lib/airdrop_management/batch_allocator.js index 1862470..ac7e073 100644 --- a/lib/airdrop_management/batch_allocator.js +++ b/lib/airdrop_management/batch_allocator.js @@ -8,7 +8,6 @@ const rootPrefix = '../..' , responseHelper = require(rootPrefix + '/lib/formatter/response') - , airdropKlass = require(rootPrefix + '/app/models/airdrop') , userAirdropDetailKlass = require(rootPrefix + '/app/models/user_airdrop_detail') , airdropAllocationProofDetailKlass = require(rootPrefix + '/app/models/airdrop_allocation_proof_detail') , airdropConstants = require(rootPrefix + '/lib/global_constant/airdrop') @@ -16,6 +15,7 @@ const rootPrefix = '../..' , basicHelper = require(rootPrefix + '/helpers/basic_helper') , logger = require(rootPrefix + '/helpers/custom_console_logger') , userAirdropDetailCacheKlass = require(rootPrefix + '/lib/cache_multi_management/user_airdrop_detail') + , AirdropModelCacheKlass = require(rootPrefix + '/lib/cache_management/airdrop_model') ; /** @@ -92,9 +92,11 @@ batchAllocator.prototype = { return onResolve(responseHelper.error('l_am_ba_vp_2', 'transaction hash is invalid')); } - var airdropModel = new airdropKlass(); - var result = await airdropModel.getByContractAddress(oThis.airdropContractAddress); - oThis.airdropRecord = result[0]; + // Check if airdropContractAddress is registered or not + const airdropModelCacheObject = new AirdropModelCacheKlass({useObject: true}) + , airdropModelCacheResponse = await airdropModelCacheObject.fetch() + ; + oThis.airdropRecord = airdropModelCacheResponse.data[oThis.airdropContractAddress]; if (!oThis.airdropRecord) { return onResolve(responseHelper.error('l_am_ba_vp_3', 'given airdrop record is not present in DB')); } diff --git a/lib/airdrop_management/register.js b/lib/airdrop_management/register.js index fd1ac3b..c35e30f 100644 --- a/lib/airdrop_management/register.js +++ b/lib/airdrop_management/register.js @@ -12,6 +12,7 @@ const rootPrefix = '../..' , airdropContractInteract = require(rootPrefix + '/lib/contract_interact/airdrop') , basicHelper = require(rootPrefix + '/helpers/basic_helper') , logger = require(rootPrefix + '/helpers/custom_console_logger') + , AirdropModelCacheKlass = require(rootPrefix + '/lib/cache_management/airdrop_model') ; /** @@ -85,10 +86,11 @@ register.prototype = { return onResolve(responseHelper.error('l_am_r_validateParams_3', 'airdrop contract is invalid')); } - // if address already present - var airdropModel = new airdropKlass(); - result = await airdropModel.getByContractAddress(oThis.airdropContractAddress); - const airdropRecord = result[0]; + // Check if airdropContractAddress is registered or not + const airdropModelCacheObject = new AirdropModelCacheKlass({useObject: true}) + , airdropModelCacheResponse = await airdropModelCacheObject.fetch() + , airdropRecord = airdropModelCacheResponse.data[oThis.airdropContractAddress]; + ; if (airdropRecord) { return onResolve(responseHelper.error('l_am_r_validateParams_4', 'airdrop contract address is already registered')); } diff --git a/lib/airdrop_management/transfer.js b/lib/airdrop_management/transfer.js index 6987d27..a2195d3 100644 --- a/lib/airdrop_management/transfer.js +++ b/lib/airdrop_management/transfer.js @@ -14,7 +14,7 @@ const rootPrefix = '../..' , BigNumber = require('bignumber.js') , basicHelper = require(rootPrefix + '/helpers/basic_helper') , logger = require(rootPrefix + '/helpers/custom_console_logger') - , airdropKlass = require(rootPrefix + '/app/models/airdrop') + , AirdropModelCacheKlass = require(rootPrefix + '/lib/cache_management/airdrop_model') ; /** @@ -95,9 +95,11 @@ transfer.prototype = { } // Check if airdropContractAddress is registered or not - var airdropModel = new airdropKlass(); - var result = await airdropModel.getByContractAddress(oThis.airdropContractAddress); - oThis.airdropRecord = result[0]; + + const airdropModelCacheObject = new AirdropModelCacheKlass({useObject: true}) + , airdropModelCacheResponse = await airdropModelCacheObject.fetch() + ; + oThis.airdropRecord = airdropModelCacheResponse.data[oThis.airdropContractAddress]; if (!oThis.airdropRecord){ return onResolve(responseHelper.error('l_am_ub_vp_3', 'Given airdrop contract is not registered')); } diff --git a/lib/airdrop_management/user_balance.js b/lib/airdrop_management/user_balance.js index 1836de2..9346e7f 100644 --- a/lib/airdrop_management/user_balance.js +++ b/lib/airdrop_management/user_balance.js @@ -8,10 +8,10 @@ const rootPrefix = '../..' , responseHelper = require(rootPrefix + '/lib/formatter/response') - , airdropKlass = require(rootPrefix + '/app/models/airdrop') , basicHelper = require(rootPrefix + '/helpers/basic_helper') , logger = require(rootPrefix + '/helpers/custom_console_logger') , userAirdropDetailCacheKlass = require(rootPrefix + '/lib/cache_multi_management/user_airdrop_detail') + , AirdropModelCacheKlass = require(rootPrefix + '/lib/cache_management/airdrop_model') ; /** @@ -83,9 +83,10 @@ AirdropUserBalanceKlass.prototype = { } // if address already present - var airdropModel = new airdropKlass(); - var result = await airdropModel.getByContractAddress(oThis.airdropContractAddress); - oThis.airdropRecord = result[0]; + const airdropModelCacheObject = new AirdropModelCacheKlass({useObject: true}) + , airdropModelCacheResponse = await airdropModelCacheObject.fetch() + ; + oThis.airdropRecord = airdropModelCacheResponse.data[oThis.airdropContractAddress]; if (!oThis.airdropRecord){ return onResolve(responseHelper.error('l_am_ub_vp_3', 'Given airdrop contract is not registered')); } diff --git a/lib/cache_management/airdrop_model.js b/lib/cache_management/airdrop_model.js new file mode 100644 index 0000000..9ba0719 --- /dev/null +++ b/lib/cache_management/airdrop_model.js @@ -0,0 +1,91 @@ +"use strict"; + +const rootPrefix = '../..' + , baseCache = require(rootPrefix + '/lib/cache_management/base') + , AirdropModelKlass = require(rootPrefix + '/app/models/airdrop') + , responseHelper = require(rootPrefix + '/lib/formatter/response') +; + +/** + * constructor + * + * @param {object} cache get/set related arguments + * @constructor + * + */ +const AirdropModelCacheKlass = function(params) { + + const oThis = this; + + baseCache.call(oThis, params); + + oThis.useObject = true; + +}; + +AirdropModelCacheKlass.prototype = Object.create(baseCache.prototype); + +const AirdropModelCacheKlassPrototype = { + + /** + * set cache key + * + * @return {String} + */ + setCacheKey: function() { + + const oThis = this; + + oThis.cacheKey = oThis._cacheKeyPrefix() + "all_airdrop"; + + return oThis.cacheKey; + + }, + + /** + * set cache expiry in oThis.cacheExpiry and return it + * + * @return {Number} + */ + setCacheExpiry: function() { + + const oThis = this; + + oThis.cacheExpiry = 86400; // 24 hours ; + + return oThis.cacheExpiry; + + }, + + /** + * Fetch data from source + * + * @return {Result} + */ + fetchDataFromSource: function() { + + const oThis = this; + + return new Promise(async function(onResolve, onReject){ + + const airdropModelObject = new AirdropModelKlass() + , allAirdropResponse = await airdropModelObject.getAll() + ; + + var formattedAirdropDetails = {}; + for (var index in allAirdropResponse) { + const airdropRecord = allAirdropResponse[index]; + formattedAirdropDetails[airdropRecord.contract_address] = {id: airdropRecord.id}; + } + + return onResolve(responseHelper.successWithData(formattedAirdropDetails)); + + }); + + } + +}; + +Object.assign(AirdropModelCacheKlass.prototype, AirdropModelCacheKlassPrototype); + +module.exports = AirdropModelCacheKlass; \ No newline at end of file diff --git a/lib/cache_management/base.js b/lib/cache_management/base.js index 7b0e7d8..52d8214 100644 --- a/lib/cache_management/base.js +++ b/lib/cache_management/base.js @@ -1,13 +1,10 @@ "use strict"; const rootPrefix = '../..' - , coreConstants = require(rootPrefix + '/config/core_constants') - , openStCache = require('@openstfoundation/openst-cache') - , openStCacheKeys = openStCache.OpenSTCacheKeys - , cacheImplementer = new openStCache.cache(coreConstants.CACHING_ENGINE, true) - , responseHelper = require(rootPrefix + '/lib/formatter/response') - , logger = require(rootPrefix+'/helpers/custom_console_logger') - , utils = require(rootPrefix + '/lib/utils') + , openStCache = require('@openstfoundation/openst-cache') + , coreConstants = require(rootPrefix + '/config/core_constants') + , responseHelper = require(rootPrefix + '/lib/formatter/response') + , logger = require(rootPrefix+'/helpers/custom_console_logger') ; /** @@ -17,24 +14,33 @@ const rootPrefix = '../..' * * @constructor */ -const baseCacheMultiManagementKlass = function(params) { +const baseCacheManagementKlass = function(params) { const oThis = this; - if (!params) { + if(!params){ params = {}; } oThis.params = params; - oThis.cacheKeys = {}; + oThis.useObject = params['useObject'] === true; - // call sub class method to set cache keys using params provided - oThis.setCacheKeys(); + oThis.cacheKey = null; + + oThis.cacheExpiry = null; + + // Set cacheImplementer to perform caching operations + oThis.cacheImplementer = new openStCache.cache(coreConstants.CACHING_ENGINE, true); + // call sub class method to set cache key using params provided + oThis.setCacheKey(); + + // call sub class method to set cache expiry using params provided + oThis.setCacheExpiry(); }; -baseCacheMultiManagementKlass.prototype = { +baseCacheManagementKlass.prototype = { /** * Fetch data from cache, in case of cache miss calls sub class method to fetch data from source @@ -46,31 +52,26 @@ baseCacheMultiManagementKlass.prototype = { const oThis = this; var data = await oThis._fetchFromCache() - , fetchDataRsp = null; + , fetchDataRsp = null; - // if there are any cache misses then fetch that data from source. - if (data['cacheMiss'].length > 0) { + // if cache miss call sub class method to fetch data from source and set cache + if (!data) { - fetchDataRsp = await oThis.fetchDataFromSource(data['cacheMiss']); + fetchDataRsp = await oThis.fetchDataFromSource(); // if fetch from source failed do not set cache and return error response if (fetchDataRsp.isFailure()) { - logger.notify('l_cm_b_1', 'Something Went Wrong', fetchDataRsp); - return Promise.resolve(fetchDataRsp); + logger.error('cm_b_1', 'Something Went Wrong', fetchDataRsp); + return fetchDataRsp; } else { - // DO NOT WAIT for cache being set - var cacheKeys = Object.keys(fetchDataRsp.data); - for (var i=0; iError while getting from cache: ", JSON.stringify(cacheFetchResponse)); - for (var i = 0; i < cacheKeys.length; i++) { - var cacheKey = cacheKeys[i]; - cacheMiss.push(oThis.cacheKeys[cacheKey]); - } + cacheFetchResponse = await oThis.cacheImplementer.get(oThis.cacheKey); + } + + if (cacheFetchResponse.isSuccess()) { + cacheData = cacheFetchResponse.data.response; } - return {cacheMiss: cacheMiss, cachedData: cachedResponse}; + return cacheData; + }, /** * set data in cache. * - * @param {Object} dataToSet - data to set in cache + * @param {Object} dataToSet - data to se tin cache * * @return {Result} */ - _setCache: function (key, dataToSet) { + _setCache: function (dataToSet) { const oThis = this; - var setCacheFunction = function(k, v) { - var cacheKey = utils.invert(oThis.cacheKeys)[k]; - return cacheImplementer.set(cacheKey, JSON.stringify(v), oThis.cacheExpiry); + var setCacheFunction = function() { + if(oThis.useObject) { + return oThis.cacheImplementer.setObject(oThis.cacheKey, dataToSet, oThis.cacheExpiry); + } else { + return oThis.cacheImplementer.set(oThis.cacheKey, dataToSet, oThis.cacheExpiry); + } + }; - setCacheFunction(key, dataToSet).then(function(cacheSetResponse) { + setCacheFunction().then(function(cacheSetResponse){ if (cacheSetResponse.isFailure()) { - logger.notify('cmm_b_2', 'Something Went Wrong', cacheSetResponse); + logger.notify('cm_b_2', 'Something Went Wrong', cacheSetResponse); } }); + }, + + /** + * cache key prefix + * + * @return {String} + */ + _cacheKeyPrefix: function () { + return 'ost_payment_'; + }, + + /** + * Shared cache key prefix + * This cache is shared between company api and saas + * Cache keys with these prefixes can be flushed via company api or saas. + * + * @return {String} + */ + _sharedCacheKeyPrefix: function () { + return 'ost_payment__shared_'; } -}; +} -module.exports = baseCacheMultiManagementKlass; +module.exports = baseCacheManagementKlass; diff --git a/lib/transaction_helper.js b/lib/transaction_helper.js index e918636..cc5dc5c 100644 --- a/lib/transaction_helper.js +++ b/lib/transaction_helper.js @@ -18,8 +18,8 @@ const rootPrefix = '..' , web3EventsDecoder = require(rootPrefix + '/lib/web3/events/decoder') , logger = require(rootPrefix + '/helpers/custom_console_logger') , eventGlobalConstants = require(rootPrefix+'/lib/global_constant/events') - , airdropKlass = require(rootPrefix + '/app/models/airdrop') , basicHelper = require(rootPrefix + '/helpers/basic_helper') + , AirdropModelCacheKlass = require(rootPrefix + '/lib/cache_management/airdrop_model') ; /** @@ -201,9 +201,9 @@ TransactionHelper.prototype = { */ clearUserDetailCache: async function(airdropContractAddress, owner) { const oThis = this - , airdropModel = new airdropKlass() - , airdropModelResult = await airdropModel.getByContractAddress(airdropContractAddress) - , airdropRecord = airdropModelResult[0] + , airdropModelCacheObject = new AirdropModelCacheKlass({useObject: true}) + , airdropModelCacheResponse = await airdropModelCacheObject.fetch() + , airdropRecord = airdropModelCacheResponse.data[airdropContractAddress] ; const userAirdropDetailCache = new UserAirdropDetailCacheKlass({ diff --git a/mocha_test/services/airdrop/pay_1.js b/mocha_test/services/airdrop/pay_1.js index c487eec..7ec0542 100644 --- a/mocha_test/services/airdrop/pay_1.js +++ b/mocha_test/services/airdrop/pay_1.js @@ -22,7 +22,7 @@ const workersContract = new workers(constants.workersContractAddress, constants. ; -const airdropKlass = require(rootPrefix + '/app/models/airdrop') +const AirdropModelCacheKlass = require(rootPrefix + '/lib/cache_management/airdrop_model') , airdropManager = require(rootPrefix + '/lib/airdrop_management/base') , airdropAllocationProofDetailKlass = require(rootPrefix + '/app/models/airdrop_allocation_proof_detail') , UserAirdropDetailKlass = require(rootPrefix + '/app/models/user_airdrop_detail') @@ -149,9 +149,10 @@ async function setBalance(token, address, amount) { */ async function getAirdropIdFromAirdropAddress(airdropAddress) { - var airdropModel = new airdropKlass(); - var result = await airdropModel.getByContractAddress(airdropAddress); - const airdropRecord = result[0]; + const airdropModelCacheObject = new AirdropModelCacheKlass({useObject: true}) + , airdropModelCacheResponse = await airdropModelCacheObject.fetch() + , airdropRecord = airdropModelCacheResponse.data[airdropAddress] + ; if (airdropRecord) { return responseHelper.successWithData({airdropId: airdropRecord.id}); } From cd36f6a240aceed922d6fe3f92afece22d2f2f8b Mon Sep 17 00:00:00 2001 From: abhay-pepo Date: Thu, 15 Mar 2018 17:50:02 +0530 Subject: [PATCH 003/115] clear airdrop model cache during registration --- lib/airdrop_management/register.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/airdrop_management/register.js b/lib/airdrop_management/register.js index c35e30f..02b4be6 100644 --- a/lib/airdrop_management/register.js +++ b/lib/airdrop_management/register.js @@ -120,6 +120,8 @@ register.prototype = { const insertedRecord = await airdropModel.create(airdropModelObject); logger.debug("========register.runRegister.insertedRecord======="); logger.debug(insertedRecord); + const airdropModelCacheObject = new AirdropModelCacheKlass({useObject: true}); + await airdropModelCacheObject.clear(); return onResolve(responseHelper.successWithData({insertId: insertedRecord.insertId})); } catch (err) { return onResolve(responseHelper.error('l_am_s_rs_1', 'Error creating airdrop record. ' + err)); From a2df0216374b79d98dd43889745f9ff2de04021a Mon Sep 17 00:00:00 2001 From: abhay-pepo Date: Thu, 15 Mar 2018 18:56:23 +0530 Subject: [PATCH 004/115] cache key per contract address --- lib/airdrop_management/adjust_airdrop_amount.js | 4 ++-- lib/airdrop_management/approve.js | 4 ++-- lib/airdrop_management/batch_allocator.js | 4 ++-- lib/airdrop_management/register.js | 6 +++--- lib/airdrop_management/transfer.js | 4 ++-- lib/airdrop_management/user_balance.js | 4 ++-- lib/cache_management/airdrop_model.js | 16 ++++++++++------ lib/transaction_helper.js | 4 ++-- mocha_test/services/airdrop/pay_1.js | 4 ++-- 9 files changed, 27 insertions(+), 23 deletions(-) diff --git a/lib/airdrop_management/adjust_airdrop_amount.js b/lib/airdrop_management/adjust_airdrop_amount.js index 8f95efa..67af6b2 100644 --- a/lib/airdrop_management/adjust_airdrop_amount.js +++ b/lib/airdrop_management/adjust_airdrop_amount.js @@ -48,9 +48,9 @@ AdjustAirdropAmountKlass.prototype = { return new Promise(async function (onResolve, onReject) { var amountAdjustedLog = {}; try { - const airdropModelCacheObject = new AirdropModelCacheKlass({useObject: true}) + const airdropModelCacheObject = new AirdropModelCacheKlass({useObject: true, contractAddress: oThis.airdropContractAddress}) , airdropModelCacheResponse = await airdropModelCacheObject.fetch() - , airdropRecord = airdropModelCacheResponse.data[oThis.airdropContractAddress] + , airdropRecord = airdropModelCacheResponse.data[oThis.airdropContractAddress.toLowerCase()] ; var totalRemainingAmountToAdjust = new BigNumber(oThis.airdropAmountUsed); // Zero airdrop amount is possible diff --git a/lib/airdrop_management/approve.js b/lib/airdrop_management/approve.js index 8960f2c..051af08 100644 --- a/lib/airdrop_management/approve.js +++ b/lib/airdrop_management/approve.js @@ -87,10 +87,10 @@ approve.prototype = { } // Check if airdropContractAddress is registered or not - const airdropModelCacheObject = new AirdropModelCacheKlass({useObject: true}) + const airdropModelCacheObject = new AirdropModelCacheKlass({useObject: true, contractAddress: oThis.airdropContractAddress}) , airdropModelCacheResponse = await airdropModelCacheObject.fetch() ; - oThis.airdropRecord = airdropModelCacheResponse.data[oThis.airdropContractAddress]; + oThis.airdropRecord = airdropModelCacheResponse.data[oThis.airdropContractAddress.toLowerCase()]; if (!oThis.airdropRecord){ return onResolve(responseHelper.error('l_am_ub_vp_2', 'Given airdrop contract is not registered')); } diff --git a/lib/airdrop_management/batch_allocator.js b/lib/airdrop_management/batch_allocator.js index ac7e073..eec57ed 100644 --- a/lib/airdrop_management/batch_allocator.js +++ b/lib/airdrop_management/batch_allocator.js @@ -93,10 +93,10 @@ batchAllocator.prototype = { } // Check if airdropContractAddress is registered or not - const airdropModelCacheObject = new AirdropModelCacheKlass({useObject: true}) + const airdropModelCacheObject = new AirdropModelCacheKlass({useObject: true, contractAddress: oThis.airdropContractAddress}) , airdropModelCacheResponse = await airdropModelCacheObject.fetch() ; - oThis.airdropRecord = airdropModelCacheResponse.data[oThis.airdropContractAddress]; + oThis.airdropRecord = airdropModelCacheResponse.data[oThis.airdropContractAddress.toLowerCase()]; if (!oThis.airdropRecord) { return onResolve(responseHelper.error('l_am_ba_vp_3', 'given airdrop record is not present in DB')); } diff --git a/lib/airdrop_management/register.js b/lib/airdrop_management/register.js index 02b4be6..ef8d3bd 100644 --- a/lib/airdrop_management/register.js +++ b/lib/airdrop_management/register.js @@ -87,9 +87,9 @@ register.prototype = { } // Check if airdropContractAddress is registered or not - const airdropModelCacheObject = new AirdropModelCacheKlass({useObject: true}) + const airdropModelCacheObject = new AirdropModelCacheKlass({useObject: true, contractAddress: oThis.airdropContractAddress}) , airdropModelCacheResponse = await airdropModelCacheObject.fetch() - , airdropRecord = airdropModelCacheResponse.data[oThis.airdropContractAddress]; + , airdropRecord = airdropModelCacheResponse.data[oThis.airdropContractAddress.toLowerCase()]; ; if (airdropRecord) { return onResolve(responseHelper.error('l_am_r_validateParams_4', 'airdrop contract address is already registered')); @@ -120,7 +120,7 @@ register.prototype = { const insertedRecord = await airdropModel.create(airdropModelObject); logger.debug("========register.runRegister.insertedRecord======="); logger.debug(insertedRecord); - const airdropModelCacheObject = new AirdropModelCacheKlass({useObject: true}); + const airdropModelCacheObject = new AirdropModelCacheKlass({useObject: true, contractAddress: oThis.airdropContractAddress}); await airdropModelCacheObject.clear(); return onResolve(responseHelper.successWithData({insertId: insertedRecord.insertId})); } catch (err) { diff --git a/lib/airdrop_management/transfer.js b/lib/airdrop_management/transfer.js index a2195d3..4963026 100644 --- a/lib/airdrop_management/transfer.js +++ b/lib/airdrop_management/transfer.js @@ -96,10 +96,10 @@ transfer.prototype = { // Check if airdropContractAddress is registered or not - const airdropModelCacheObject = new AirdropModelCacheKlass({useObject: true}) + const airdropModelCacheObject = new AirdropModelCacheKlass({useObject: true, contractAddress: oThis.airdropContractAddress}) , airdropModelCacheResponse = await airdropModelCacheObject.fetch() ; - oThis.airdropRecord = airdropModelCacheResponse.data[oThis.airdropContractAddress]; + oThis.airdropRecord = airdropModelCacheResponse.data[oThis.airdropContractAddress.toLowerCase()]; if (!oThis.airdropRecord){ return onResolve(responseHelper.error('l_am_ub_vp_3', 'Given airdrop contract is not registered')); } diff --git a/lib/airdrop_management/user_balance.js b/lib/airdrop_management/user_balance.js index 9346e7f..e2cf138 100644 --- a/lib/airdrop_management/user_balance.js +++ b/lib/airdrop_management/user_balance.js @@ -83,10 +83,10 @@ AirdropUserBalanceKlass.prototype = { } // if address already present - const airdropModelCacheObject = new AirdropModelCacheKlass({useObject: true}) + const airdropModelCacheObject = new AirdropModelCacheKlass({useObject: true, contractAddress: oThis.airdropContractAddress}) , airdropModelCacheResponse = await airdropModelCacheObject.fetch() ; - oThis.airdropRecord = airdropModelCacheResponse.data[oThis.airdropContractAddress]; + oThis.airdropRecord = airdropModelCacheResponse.data[oThis.airdropContractAddress.toLowerCase()]; if (!oThis.airdropRecord){ return onResolve(responseHelper.error('l_am_ub_vp_3', 'Given airdrop contract is not registered')); } diff --git a/lib/cache_management/airdrop_model.js b/lib/cache_management/airdrop_model.js index 9ba0719..f43d4a4 100644 --- a/lib/cache_management/airdrop_model.js +++ b/lib/cache_management/airdrop_model.js @@ -17,6 +17,7 @@ const AirdropModelCacheKlass = function(params) { const oThis = this; + oThis.contractAddress = params.contractAddress; baseCache.call(oThis, params); oThis.useObject = true; @@ -36,7 +37,7 @@ const AirdropModelCacheKlassPrototype = { const oThis = this; - oThis.cacheKey = oThis._cacheKeyPrefix() + "all_airdrop"; + oThis.cacheKey = oThis._cacheKeyPrefix() + "airdrop_"+oThis.contractAddress; return oThis.cacheKey; @@ -69,15 +70,18 @@ const AirdropModelCacheKlassPrototype = { return new Promise(async function(onResolve, onReject){ const airdropModelObject = new AirdropModelKlass() - , allAirdropResponse = await airdropModelObject.getAll() + , airdropResponse = await airdropModelObject.getByContractAddress(oThis.contractAddress) + , airdropRecord = airdropResponse[0] ; - var formattedAirdropDetails = {}; - for (var index in allAirdropResponse) { - const airdropRecord = allAirdropResponse[index]; - formattedAirdropDetails[airdropRecord.contract_address] = {id: airdropRecord.id}; + // return null if airdrop record not found + if (!airdropRecord){ + return onResolve(responseHelper.successWithData(null)); } + var formattedAirdropDetails = {}; + formattedAirdropDetails[airdropRecord.contract_address.toLowerCase()] = {id: airdropRecord.id}; + return onResolve(responseHelper.successWithData(formattedAirdropDetails)); }); diff --git a/lib/transaction_helper.js b/lib/transaction_helper.js index cc5dc5c..aca935e 100644 --- a/lib/transaction_helper.js +++ b/lib/transaction_helper.js @@ -201,9 +201,9 @@ TransactionHelper.prototype = { */ clearUserDetailCache: async function(airdropContractAddress, owner) { const oThis = this - , airdropModelCacheObject = new AirdropModelCacheKlass({useObject: true}) + , airdropModelCacheObject = new AirdropModelCacheKlass({useObject: true, contractAddress: airdropContractAddress}) , airdropModelCacheResponse = await airdropModelCacheObject.fetch() - , airdropRecord = airdropModelCacheResponse.data[airdropContractAddress] + , airdropRecord = airdropModelCacheResponse.data[airdropContractAddress.toLowerCase()] ; const userAirdropDetailCache = new UserAirdropDetailCacheKlass({ diff --git a/mocha_test/services/airdrop/pay_1.js b/mocha_test/services/airdrop/pay_1.js index 7ec0542..12309a9 100644 --- a/mocha_test/services/airdrop/pay_1.js +++ b/mocha_test/services/airdrop/pay_1.js @@ -149,9 +149,9 @@ async function setBalance(token, address, amount) { */ async function getAirdropIdFromAirdropAddress(airdropAddress) { - const airdropModelCacheObject = new AirdropModelCacheKlass({useObject: true}) + const airdropModelCacheObject = new AirdropModelCacheKlass({useObject: true, contractAddress: airdropAddress}) , airdropModelCacheResponse = await airdropModelCacheObject.fetch() - , airdropRecord = airdropModelCacheResponse.data[airdropAddress] + , airdropRecord = airdropModelCacheResponse.data[airdropAddress.toLowerCase()] ; if (airdropRecord) { return responseHelper.successWithData({airdropId: airdropRecord.id}); From 2a623e1addb4cbe5b1a26e27330e7f8a93fcc867 Mon Sep 17 00:00:00 2001 From: abhay-pepo Date: Thu, 15 Mar 2018 19:41:56 +0530 Subject: [PATCH 005/115] Caching of airdrop table per airdrop contract address --- .../adjust_airdrop_amount.js | 4 +- lib/airdrop_management/approve.js | 2 +- lib/airdrop_management/batch_allocator.js | 2 +- lib/airdrop_management/register.js | 2 +- lib/airdrop_management/transfer.js | 2 +- lib/airdrop_management/user_balance.js | 2 +- lib/cache_management/airdrop_model.js | 4 +- lib/cache_management/base.js | 4 +- lib/transaction_helper.js | 2 +- mocha_test/services/airdrop/pay.js | 1198 +++++++++++++---- mocha_test/services/airdrop/pay_1.js | 1126 ---------------- 11 files changed, 951 insertions(+), 1397 deletions(-) delete mode 100644 mocha_test/services/airdrop/pay_1.js diff --git a/lib/airdrop_management/adjust_airdrop_amount.js b/lib/airdrop_management/adjust_airdrop_amount.js index 67af6b2..2f20a0f 100644 --- a/lib/airdrop_management/adjust_airdrop_amount.js +++ b/lib/airdrop_management/adjust_airdrop_amount.js @@ -50,7 +50,7 @@ AdjustAirdropAmountKlass.prototype = { try { const airdropModelCacheObject = new AirdropModelCacheKlass({useObject: true, contractAddress: oThis.airdropContractAddress}) , airdropModelCacheResponse = await airdropModelCacheObject.fetch() - , airdropRecord = airdropModelCacheResponse.data[oThis.airdropContractAddress.toLowerCase()] + , airdropRecord = airdropModelCacheResponse.data[oThis.airdropContractAddress] ; var totalRemainingAmountToAdjust = new BigNumber(oThis.airdropAmountUsed); // Zero airdrop amount is possible @@ -139,7 +139,7 @@ AdjustAirdropAmountKlass.prototype = { return new Promise(async function (onResolve, onReject) { var amountAdjustedLog = {}; try { - const airdropModelCacheObject = new AirdropModelCacheKlass({useObject: true}) + const airdropModelCacheObject = new AirdropModelCacheKlass({useObject: true, contractAddress: oThis.airdropContractAddress}) , airdropModelCacheResponse = await airdropModelCacheObject.fetch() , airdropRecord = airdropModelCacheResponse.data[oThis.airdropContractAddress] ; diff --git a/lib/airdrop_management/approve.js b/lib/airdrop_management/approve.js index 051af08..e2de9c0 100644 --- a/lib/airdrop_management/approve.js +++ b/lib/airdrop_management/approve.js @@ -90,7 +90,7 @@ approve.prototype = { const airdropModelCacheObject = new AirdropModelCacheKlass({useObject: true, contractAddress: oThis.airdropContractAddress}) , airdropModelCacheResponse = await airdropModelCacheObject.fetch() ; - oThis.airdropRecord = airdropModelCacheResponse.data[oThis.airdropContractAddress.toLowerCase()]; + oThis.airdropRecord = airdropModelCacheResponse.data[oThis.airdropContractAddress]; if (!oThis.airdropRecord){ return onResolve(responseHelper.error('l_am_ub_vp_2', 'Given airdrop contract is not registered')); } diff --git a/lib/airdrop_management/batch_allocator.js b/lib/airdrop_management/batch_allocator.js index eec57ed..cda0165 100644 --- a/lib/airdrop_management/batch_allocator.js +++ b/lib/airdrop_management/batch_allocator.js @@ -96,7 +96,7 @@ batchAllocator.prototype = { const airdropModelCacheObject = new AirdropModelCacheKlass({useObject: true, contractAddress: oThis.airdropContractAddress}) , airdropModelCacheResponse = await airdropModelCacheObject.fetch() ; - oThis.airdropRecord = airdropModelCacheResponse.data[oThis.airdropContractAddress.toLowerCase()]; + oThis.airdropRecord = airdropModelCacheResponse.data[oThis.airdropContractAddress]; if (!oThis.airdropRecord) { return onResolve(responseHelper.error('l_am_ba_vp_3', 'given airdrop record is not present in DB')); } diff --git a/lib/airdrop_management/register.js b/lib/airdrop_management/register.js index ef8d3bd..e2414f8 100644 --- a/lib/airdrop_management/register.js +++ b/lib/airdrop_management/register.js @@ -89,7 +89,7 @@ register.prototype = { // Check if airdropContractAddress is registered or not const airdropModelCacheObject = new AirdropModelCacheKlass({useObject: true, contractAddress: oThis.airdropContractAddress}) , airdropModelCacheResponse = await airdropModelCacheObject.fetch() - , airdropRecord = airdropModelCacheResponse.data[oThis.airdropContractAddress.toLowerCase()]; + , airdropRecord = airdropModelCacheResponse.data[oThis.airdropContractAddress]; ; if (airdropRecord) { return onResolve(responseHelper.error('l_am_r_validateParams_4', 'airdrop contract address is already registered')); diff --git a/lib/airdrop_management/transfer.js b/lib/airdrop_management/transfer.js index 4963026..aea672e 100644 --- a/lib/airdrop_management/transfer.js +++ b/lib/airdrop_management/transfer.js @@ -99,7 +99,7 @@ transfer.prototype = { const airdropModelCacheObject = new AirdropModelCacheKlass({useObject: true, contractAddress: oThis.airdropContractAddress}) , airdropModelCacheResponse = await airdropModelCacheObject.fetch() ; - oThis.airdropRecord = airdropModelCacheResponse.data[oThis.airdropContractAddress.toLowerCase()]; + oThis.airdropRecord = airdropModelCacheResponse.data[oThis.airdropContractAddress]; if (!oThis.airdropRecord){ return onResolve(responseHelper.error('l_am_ub_vp_3', 'Given airdrop contract is not registered')); } diff --git a/lib/airdrop_management/user_balance.js b/lib/airdrop_management/user_balance.js index e2cf138..0320a5a 100644 --- a/lib/airdrop_management/user_balance.js +++ b/lib/airdrop_management/user_balance.js @@ -86,7 +86,7 @@ AirdropUserBalanceKlass.prototype = { const airdropModelCacheObject = new AirdropModelCacheKlass({useObject: true, contractAddress: oThis.airdropContractAddress}) , airdropModelCacheResponse = await airdropModelCacheObject.fetch() ; - oThis.airdropRecord = airdropModelCacheResponse.data[oThis.airdropContractAddress.toLowerCase()]; + oThis.airdropRecord = airdropModelCacheResponse.data[oThis.airdropContractAddress]; if (!oThis.airdropRecord){ return onResolve(responseHelper.error('l_am_ub_vp_3', 'Given airdrop contract is not registered')); } diff --git a/lib/cache_management/airdrop_model.js b/lib/cache_management/airdrop_model.js index f43d4a4..9a48a6f 100644 --- a/lib/cache_management/airdrop_model.js +++ b/lib/cache_management/airdrop_model.js @@ -37,7 +37,7 @@ const AirdropModelCacheKlassPrototype = { const oThis = this; - oThis.cacheKey = oThis._cacheKeyPrefix() + "airdrop_"+oThis.contractAddress; + oThis.cacheKey = oThis._cacheKeyPrefix() + "airdrop_"+oThis.contractAddress.toLowerCase(); return oThis.cacheKey; @@ -80,7 +80,7 @@ const AirdropModelCacheKlassPrototype = { } var formattedAirdropDetails = {}; - formattedAirdropDetails[airdropRecord.contract_address.toLowerCase()] = {id: airdropRecord.id}; + formattedAirdropDetails[airdropRecord.contract_address] = {id: airdropRecord.id}; return onResolve(responseHelper.successWithData(formattedAirdropDetails)); diff --git a/lib/cache_management/base.js b/lib/cache_management/base.js index 52d8214..e86b905 100644 --- a/lib/cache_management/base.js +++ b/lib/cache_management/base.js @@ -61,7 +61,7 @@ baseCacheManagementKlass.prototype = { // if fetch from source failed do not set cache and return error response if (fetchDataRsp.isFailure()) { - logger.error('cm_b_1', 'Something Went Wrong', fetchDataRsp); + logger.error('l_cm_b_fetch_1', 'Something Went Wrong', fetchDataRsp); return fetchDataRsp; } else { data = fetchDataRsp.data; @@ -170,7 +170,7 @@ baseCacheManagementKlass.prototype = { setCacheFunction().then(function(cacheSetResponse){ if (cacheSetResponse.isFailure()) { - logger.notify('cm_b_2', 'Something Went Wrong', cacheSetResponse); + logger.notify('l_cm_b_setCache_1', 'Something Went Wrong', cacheSetResponse); } }); diff --git a/lib/transaction_helper.js b/lib/transaction_helper.js index aca935e..b5d1e9e 100644 --- a/lib/transaction_helper.js +++ b/lib/transaction_helper.js @@ -203,7 +203,7 @@ TransactionHelper.prototype = { const oThis = this , airdropModelCacheObject = new AirdropModelCacheKlass({useObject: true, contractAddress: airdropContractAddress}) , airdropModelCacheResponse = await airdropModelCacheObject.fetch() - , airdropRecord = airdropModelCacheResponse.data[airdropContractAddress.toLowerCase()] + , airdropRecord = airdropModelCacheResponse.data[airdropContractAddress] ; const userAirdropDetailCache = new UserAirdropDetailCacheKlass({ diff --git a/mocha_test/services/airdrop/pay.js b/mocha_test/services/airdrop/pay.js index 63163e4..82c8119 100644 --- a/mocha_test/services/airdrop/pay.js +++ b/mocha_test/services/airdrop/pay.js @@ -1,5 +1,5 @@ /* global describe, it */ -/* + const chai = require('chai') , assert = chai.assert; @@ -9,292 +9,900 @@ const rootPrefix = "../../.." , utils = require(rootPrefix+'/mocha_test/lib/utils') , airdrop = require(rootPrefix + '/lib/contract_interact/airdrop') , workers = require(rootPrefix + '/lib/contract_interact/workers') - , workersContract = new workers(constants.workersContractAddress, constants.chainId) - , airdropOstUsd = new airdrop(constants.airdropOstUsdAddress, constants.chainId) , mockToken = require(rootPrefix + '/lib/contract_interact/EIP20TokenMock') - , TC5 = new mockToken(constants.TC5Address) , BrandedTokenKlass = require(rootPrefix + '/lib/contract_interact/branded_token') - , brandedTokenObject = new BrandedTokenKlass(constants.TC5Address, constants.chainId) , web3RpcProvider = require(rootPrefix + '/lib/web3/providers/rpc') , logger = require(rootPrefix + '/helpers/custom_console_logger') ; +const workersContract = new workers(constants.workersContractAddress, constants.chainId) + , airdropOstUsd = new airdrop(constants.airdropOstUsdAddress, constants.chainId) + , TC5 = new mockToken(constants.TC5Address) + , brandedTokenObject = new BrandedTokenKlass(constants.TC5Address, constants.chainId) +; + -const airdropKlass = require(rootPrefix + '/app/models/airdrop') +const AirdropModelCacheKlass = require(rootPrefix + '/lib/cache_management/airdrop_model') , airdropManager = require(rootPrefix + '/lib/airdrop_management/base') - , BalanceCacheKlass = require(rootPrefix + '/lib/cache_management/balance') - , balanceCache = new BalanceCacheKlass(constants.chainId, constants.TC5Address) , airdropAllocationProofDetailKlass = require(rootPrefix + '/app/models/airdrop_allocation_proof_detail') + , UserAirdropDetailKlass = require(rootPrefix + '/app/models/user_airdrop_detail') + , responseHelper = require(rootPrefix + '/lib/formatter/response') ; var transferToAirdropBudgetHolderTransactionHash = '' ; -async function getAmountFromCache(address) { - console.log("========getAmountFromCache===== for address: "+address); - const response = await balanceCache.getBalance(address); - console.log(response); - return new BigNumber(response.data.response); -}; +/** + * Utitlity function to test set accepted margin + * + * @param {Object} airdropObject - airdrop object + * @param {string} currency - currency + * @param {string} margin - accepted margin + * + */ + +async function setAcceptedMargin(airdropObject, currency, margin) { + // set accepted margin + const amResponse = await airdropObject.setAcceptedMargin( + constants.ops, + constants.opsPassphrase, + currency, + margin, + constants.gasUsed, + constants.optionsReceipt); + assert.equal(amResponse.isSuccess(), true); + // verify if the transaction receipt is valid + utils.verifyTransactionReceipt(amResponse); + // verify if the transaction has was actually mined + await utils.verifyIfMined(airdropObject, amResponse.data.transaction_hash); + // verify if its set + const amResult = await airdropObject.acceptedMargins(currency); + assert.equal(amResult.isSuccess(), true); + assert.equal(margin, amResult.data.acceptedMargins); +} + + +/** + * Utitlity function to test set price oracle + * + * @param {Object} airdropObject - airdrop object + * @param {string} currency - currency + * @param {string} address - price oracle address + * + */ +async function setPriceOracle(airdropObject, currency, address) { + // Set Price Oracle + const spoResponse = await airdropObject.setPriceOracle( + constants.ops, + constants.opsPassphrase, + currency, + address, + constants.gasUsed, + constants.optionsReceipt); + assert.equal(spoResponse.isSuccess(), true); + // verify if the transaction receipt is valid + utils.verifyTransactionReceipt(spoResponse); + // verify if the transaction has was actually mined + await utils.verifyIfMined(airdropObject, spoResponse.data.transaction_hash); + // verify if its set + const poResult = await airdropObject.priceOracles(currency); + assert.equal(poResult.isSuccess(), true); + assert.equal(address, poResult.data.priceOracles); +} + + +/** + * Utitlity function to test set worker + * + * @param {string} workerAddress - worker address + * @param {Bignumber} deactivationHeight - deactivation height of the worker + * + */ +async function setWorker(workerAddress, deactivationHeight) { + const setWorkerResponse = await workersContract.setWorker( + constants.ops, + constants.opsPassphrase, + workerAddress, + deactivationHeight.toString(10), + constants.gasUsed, + constants.optionsReceipt); + + assert.equal(setWorkerResponse.isSuccess(), true); + // verify if the transaction receipt is valid + utils.verifyTransactionReceipt(setWorkerResponse); + + // confirm that worker is a set + const isWorkerResponse = await workersContract.isWorker(workerAddress); + assert.equal(isWorkerResponse.isSuccess(), true); + assert.equal(isWorkerResponse.data.isValid, true); +} + + +/** + * Utitlity function to test setBalance + * + * @param {Object} token - branded token object + * @param {string} address - account address + * @param {string} amount - amount that need to be set + * @param {BigNumber} gasPrice - gas price + * + */ +async function setBalance(token, address, amount) { + const amountInWei = airdropOstUsd.toWei(amount); + await token.setBalance( + constants.ops, + constants.opsPassphrase, + address, + amountInWei, + constants.gasUsed); + // check if the balance was set + const accountBalance = await token.balanceOf(address); + assert.equal(accountBalance, amountInWei); +} + +/** + * Utitlity function to get airdrop id from airdrop address + * + * @param {string} airdropAddress - airdrop address + * + * @return {Object} - formatted response + */ + +async function getAirdropIdFromAirdropAddress(airdropAddress) { + const airdropModelCacheObject = new AirdropModelCacheKlass({useObject: true, contractAddress: airdropAddress}) + , airdropModelCacheResponse = await airdropModelCacheObject.fetch() + , airdropRecord = airdropModelCacheResponse.data[airdropAddress] + ; + if (airdropRecord) { + return responseHelper.successWithData({airdropId: airdropRecord.id}); + } + return responseHelper.error("gaidfad", "No data found"); +} + +/** + * Utitlity function to register airdrop if not already registered + * + * @param {string} airdropAddress - airdrop address + * + */ +async function registerAirdrop(airdropAddress) { + // Do Airdrop Setup if setup was not done + const airDropIdResponse = await getAirdropIdFromAirdropAddress(airdropAddress); + if (airDropIdResponse.isFailure()) { + const registerAirdropResponse = await airdropManager.registerAirdrop( + airdropAddress, + constants.chainId + ); + assert.equal(registerAirdropResponse.isSuccess(), true); + + // check again if the database awas set; + const airDropIdAfterRegisterResponse = await getAirdropIdFromAirdropAddress(airdropAddress); + assert.equal(airDropIdAfterRegisterResponse.isSuccess(), true); + } +} + +/** + * Utitlity function to transfer token to airdrop budget holder + * + * @param {Object} token - Branded token object + * @param {string} airdropAddress - airdrop address + * @param {string} fromAddress - reserve address + * @param {string} fromPassphrase - passphrase + * @param {string} budgetHolderAddress - budget holder address + * @param {string} amount - amount to transfer to budget holder + * + * @return {transaction hash} + */ +async function transferTokenToAirdropBugetHolder (token, airdropAddress, fromAddress, fromPassphrase, budgetHolderAddress, amount) { + + const airdropBudgetAmountInWei = new BigNumber(airdropOstUsd.toWei(amount)); + const initialBalance = new BigNumber(await token.balanceOf(fromAddress)); + const beforeTransferAirdropBudgetHolderBalance = new BigNumber(await token.balanceOf(budgetHolderAddress)); + + logger.info("initialBalance:", initialBalance.toString(10), + "\nairdropBudgetAmount:", airdropBudgetAmountInWei.toString(10), + "\nairdropAddress:", airdropAddress); + + assert.equal(initialBalance.gte(airdropBudgetAmountInWei), true, "insufficent balance to transfer amount to budgetHolderAddress"); + + var transferToAirdropBudgetHolderResult = await airdropManager.transfer( + fromAddress, + fromPassphrase, + airdropAddress, + airdropBudgetAmountInWei, + constants.gasUsed, + constants.chainId, + constants.optionsReceipt + ); + logger.info("=======transferToAirdropBudgetHolderResult======="); + logger.info(transferToAirdropBudgetHolderResult); + assert.equal(transferToAirdropBudgetHolderResult.isSuccess(), true); + // verify if the transaction receipt is valid + await utils.verifyTransactionReceipt(transferToAirdropBudgetHolderResult); + // verify if the transaction was actually mined + await utils.verifyIfMined(airdropOstUsd, transferToAirdropBudgetHolderResult.data.transaction_hash); + + const afterTransferAirdropBudgetHolderBalance = new BigNumber(await token.balanceOf(budgetHolderAddress)); + assert.equal((beforeTransferAirdropBudgetHolderBalance.plus(airdropBudgetAmountInWei)).equals( afterTransferAirdropBudgetHolderBalance), true); + + // set transaction hash + transferToAirdropBudgetHolderTransactionHash = transferToAirdropBudgetHolderResult.data.transaction_hash; + return transferToAirdropBudgetHolderTransactionHash; +} + +/** + * Utitlity function get user airdrop balance + * + * @param {string} airdropAddress - airdrop address + * @param {Array} userAddressArray - user address array + * + * @return {Object} - formatted response + */ +async function getUserAirdropBalanceFromCache(airdropAddress, userAddressArray) { + // Get cache value + var airdropBalanceResult = await airdropManager.getAirdropBalance( + constants.chainId, + airdropAddress, + userAddressArray + ); + const zeroAmount = { + totalAirdropAmount: '0', + totalAirdropUsedAmount: '0', + balanceAirdropAmount: '0' + }; + var responseData = {}; + if (airdropBalanceResult.isSuccess()) { + responseData = airdropBalanceResult.data; + } + var data = {}; + for (var i = userAddressArray.length - 1; i >= 0; i--) { + if(responseData[userAddressArray[i]]) { + data[userAddressArray[i]] = responseData[userAddressArray[i]]; + } else { + data[userAddressArray[i]] = zeroAmount; + } + } + return responseHelper.successWithData(data); +} + +/** + * Utitlity function get user airdrop balance form DB, bypass cache layer + * + * @param {string} airdropAddress - airdrop address + * @param {Array} userAddressArray - user address array + * + * @return {Object} - formatted response + */ +async function getUserAirdropBalanceFromDB(airdropAddress, userAddressArray) { + + const airDropIdResponse = await getAirdropIdFromAirdropAddress(airdropAddress); + if (airDropIdResponse.isSuccess()) { + const airdropId = airDropIdResponse.data.airdropId; + const userAirdropDetailModel = new UserAirdropDetailKlass(); + + const queryResponse = await userAirdropDetailModel.getByUserAddresses(airdropId, userAddressArray); + + var responseData = {}; + if (queryResponse.isSuccess()) { + responseData = queryResponse.data; + } + var data = {}; + for (var i = userAddressArray.length - 1; i >= 0; i--) { + if(responseData[userAddressArray[i]]) { + data[userAddressArray[i]] = responseData[userAddressArray[i]]; + } else { + data[userAddressArray[i]] = { + totalAirdropAmount: '0', + totalAirdropUsedAmount: '0', + balanceAirdropAmount: '0' + }; + } + } + return responseHelper.successWithData(data); + } + return airDropIdResponse; +} + +/** + * Utitlity function to compare the airdrop balances from DB and cache + * + * @param {Object} dbBalance - airdrop balance from DB + * @param {Object} cacheBalance - airdrop balance from cache + * + */ +function validateDBandCacheAirdropBalances(dbBalance, cacheBalance) { + + const compare = function(obj1, obj2) { + assert.equal(obj1.totalAirdropAmount, obj2.totalAirdropAmount); + assert.equal(obj1.totalAirdropUsedAmount, obj2.totalAirdropUsedAmount); + assert.equal(obj1.balanceAirdropAmount, obj2.balanceAirdropAmount); + }; + const dbUserKeys = Object.keys(dbBalance); + const cacheUserKeys = Object.keys(cacheBalance); + assert.equal(dbUserKeys.length, cacheUserKeys.length); + for (var i = dbUserKeys.length - 1; i >= 0; i--) { + const dbObject = dbBalance[dbUserKeys[i]]; + const cacheObject = cacheBalance[cacheUserKeys[i]]; + assert.isDefined(dbObject); + assert.isDefined(cacheObject); + compare(dbObject, cacheObject); + } +} + +/** + * Utitlity function to get balance of address from contract + * + * @param {Object} token - token + * @param {string} address - address whose balances need to be found + * + */ +async function getBalanceFromContract(token, address) { + var balances = {}; + for (var i = address.length - 1; i >= 0; i--) { + const addressKey = address[i]; + balances[addressKey] = new BigNumber(await token.balanceOf(addressKey)); + } + return balances; +} + +/** + * Utitlity function to get balance of address from cache + * + * @param {Object} token - token + * @param {string} address - address whose balances need to be found + * + */ +async function getBalanceFromCache(tokenObj, address) { + var balances = {}; + for (var i = address.length - 1; i >= 0; i--) { + const addressKey = address[i]; + const balance = await tokenObj.getBalanceOf(addressKey); + assert.equal(balance.isSuccess(), true); + balances[addressKey] = new BigNumber(balance.data.balance); + } + return balances; +} + +/** + * Utitlity function to compare balances from cache and contract + * + * @param {Object} contractBalances - balances from contract + * @param {Object} cacheBalance - balances from cache + * + */ + +function validateContractAndCacheBalance(cacheBalance, contractBalances) { + const contractKeys = Object.keys(cacheBalance); + const cacheKeys = Object.keys(contractBalances); + assert.equal(contractKeys.length, cacheKeys.length); + for (var i = contractKeys.length - 1; i >= 0; i--) { + const balanceFromContract = contractBalances[contractKeys[i]]; + const balanceFromCache = cacheBalance[contractKeys[i]]; + assert.isDefined(balanceFromContract); + assert.isDefined(balanceFromCache); + assert.equal(balanceFromCache.equals(balanceFromContract), true); + } +} + +/** + * Utitlity function to validate if airdrop was transfered successfully + * + * @param {string} accountAddress - user address + * @param {Object} initialAirdropBalance - Initial airdrop balance + * @param {Object} currentAirdropBalance - Current airdrop balance + * @param {BigNumber} airdropAmountTransfered - estimated airdrop amount that was transfered + */ +function validateAirdropTransferSuccess(accountAddress, initialAirdropBalance, currentAirdropBalance, airdropAmountTransfered) { + + const initialAirdropBalanceData = initialAirdropBalance.data[accountAddress]; + const currentAirdropBalanceData = currentAirdropBalance.data[accountAddress]; + + assert.isDefined(initialAirdropBalanceData); + assert.isDefined(currentAirdropBalanceData); + + const intialTotalAirdropAmount = new BigNumber(initialAirdropBalanceData.totalAirdropAmount); + const initialTotalAirdropUsedAmount = new BigNumber(initialAirdropBalanceData.totalAirdropUsedAmount); + const initialBalanceAirdropAmount = new BigNumber(initialAirdropBalanceData.balanceAirdropAmount); + + const totalAirdropAmount = new BigNumber(currentAirdropBalanceData.totalAirdropAmount); + const totalAirdropUsedAmount = new BigNumber(currentAirdropBalanceData.totalAirdropUsedAmount); + const balanceAirdropAmount = new BigNumber(currentAirdropBalanceData.balanceAirdropAmount); + + assert.equal(intialTotalAirdropAmount.equals(totalAirdropAmount), true); + assert.equal((initialTotalAirdropUsedAmount.plus(airdropAmountTransfered)).equals(totalAirdropUsedAmount), true); + assert.equal((initialBalanceAirdropAmount.minus(airdropAmountTransfered)).equals(balanceAirdropAmount), true); +} + +function validateTransferSuccess( + estimatedTokenAmount, + estimatedCommissionTokenAmount, + estimatedAirdropUsed, + spenderAddress, + beneficiary, + commissionBeneficiary, + airdropBudgetHolder, + initialBalances, + currentBalances) { + + assert.isDefined(estimatedTokenAmount); + assert.isDefined(estimatedCommissionTokenAmount); + assert.isDefined(estimatedAirdropUsed); + assert.isDefined(spenderAddress); + assert.isDefined(beneficiary); + assert.isDefined(commissionBeneficiary); + assert.isDefined(airdropBudgetHolder); + assert.isDefined(initialBalances); + assert.isDefined(currentBalances); + + const estimatedTotalAmount = estimatedTokenAmount.plus(estimatedCommissionTokenAmount); + const actualTransferAmount = estimatedTotalAmount.minus(estimatedAirdropUsed); + const calculatedBenficiaryAmount = initialBalances[beneficiary].plus(estimatedTokenAmount); + const calculatedCommisionAmount = initialBalances[commissionBeneficiary].plus(estimatedCommissionTokenAmount); + const calculatedSpenderAmount = initialBalances[spenderAddress].minus(actualTransferAmount); + const calculatesBugdetHolderAmount = initialBalances[airdropBudgetHolder].minus(estimatedAirdropUsed); + + assert.equal(calculatedBenficiaryAmount.equals(currentBalances[beneficiary]), true); + assert.equal(calculatedCommisionAmount.equals(currentBalances[commissionBeneficiary]), true); + assert.equal(calculatedSpenderAmount.equals(currentBalances[spenderAddress]), true); + assert.equal(calculatesBugdetHolderAmount.equals(currentBalances[airdropBudgetHolder]), true); +} + +/** + * Utitlity function to populate the cache of all test accounts + * + */ +async function populateCache() { + // Populate Cache + await brandedTokenObject.getBalanceOf(constants.account1); + await brandedTokenObject.getBalanceOf(constants.account2); + await brandedTokenObject.getBalanceOf(constants.account3); + await brandedTokenObject.getBalanceOf(constants.account4); + await brandedTokenObject.getBalanceOf(constants.account5); + await brandedTokenObject.getBalanceOf(constants.airdropBudgetHolder); +} +// Tests starts here describe('Airdrop Pay', function() { it('should pass the initial checks', async function() { // eslint-disable-next-line no-invalid-this this.timeout(500000); + // check if the address required for the testing are defined. assert.isDefined(constants.deployer); assert.isDefined(constants.ops); assert.isDefined(constants.account1); + assert.isDefined(constants.workerAccount1); + assert.isDefined(constants.airdropBudgetHolder); + assert.notEqual(constants.deployer, constants.ops); assert.notEqual(constants.deployer, constants.account1); assert.notEqual(constants.ops, constants.account1); - const currentBlockNumber = await web3RpcProvider.eth.getBlockNumber() - , deactivationHeight = new BigNumber(currentBlockNumber).plus(10000) - ; // set worker - const setWorkerResponse = await workersContract.setWorker( - constants.ops, - constants.opsPassphrase, - constants.workerAccount1, - deactivationHeight.toNumber(), - constants.gasUsed, - constants.optionsReceipt); - - const isWorkerResponse = await workersContract.isWorker(constants.workerAccount1); - assert.equal(isWorkerResponse.isSuccess(), true); - assert.equal(isWorkerResponse.data.isValid, true); - // verify if the transaction receipt is valid - utils.verifyTransactionReceipt(setWorkerResponse); - // TODO Check for get Worker + logger.info("============= Set worker ============="); + const currentBlockNumber = await web3RpcProvider.eth.getBlockNumber(); + await setWorker(constants.workerAccount1, new BigNumber(currentBlockNumber).plus(100000000000)); // Set Price Oracle - const spoResponse = await airdropOstUsd.setPriceOracle( - constants.ops, - constants.opsPassphrase, - constants.currencyUSD, - constants.priceOracles.OST.USD, - constants.gasUsed, - constants.optionsReceipt); - - // verify if the transaction receipt is valid - utils.verifyTransactionReceipt(spoResponse); - - // verify if the transaction has was actually mined - await utils.verifyIfMined(airdropOstUsd, spoResponse.data.transaction_hash); + logger.info("============= Set Price Oracle ============="); + await setPriceOracle(airdropOstUsd, constants.currencyUSD, constants.priceOracles.OST.USD); // set accepted margin - const amResponse = await airdropOstUsd.setAcceptedMargin( - constants.ops, - constants.opsPassphrase, - constants.currencyUSD, - 50, - constants.gasUsed, - constants.optionsReceipt); + logger.info("============= Set accepted margin ============="); + await setAcceptedMargin(airdropOstUsd, constants.currencyUSD, 50); - // verify if the transaction receipt is valid - utils.verifyTransactionReceipt(amResponse); + // set balance for account 1 (Spender) + logger.info("============= Set account 1 balance ============="); + await setBalance(TC5, constants.account1, constants.account1InitialBrandedTokenBalance); - // verify if the transaction has was actually mined - await utils.verifyIfMined(airdropOstUsd, amResponse.data.transaction_hash); + // reset balance for account 2 to 100 + logger.info("============= Set account 2 balance ============="); + await setBalance(TC5, constants.account2, '100'); - // verify if its set - const amResult = await airdropOstUsd.acceptedMargins(constants.currencyUSD); - assert.equal(amResult.isSuccess(), true); - assert.equal(50, amResult.data.acceptedMargins); + // reset balance for account 3 to 0 + logger.info("============= Set account 3 balance ============="); + await setBalance(TC5, constants.account3, '0'); - // verify if its set - const poResult = await airdropOstUsd.priceOracles(constants.currencyUSD); - assert.equal(poResult.isSuccess(), true); - assert.equal(constants.priceOracles.OST.USD, poResult.data.priceOracles); + // reset balance for account 4 to 0 + logger.info("============= Set account 4 balance ============="); + await setBalance(TC5, constants.account4, '0'); - // Do Airdrop Setup if setup was not done - var airdropModel = new airdropKlass(); - var result = await airdropModel.getByContractAddress(constants.airdropOstUsdAddress); - const airdropRecord = result[0]; - if (!airdropRecord) { - const registerAirdropResponse = await airdropManager.registerAirdrop( - constants.airdropOstUsdAddress, - constants.chainId - ); - assert.equal(registerAirdropResponse.isSuccess(), true); - } + // reset balance of account airdropBudgetHolder to 0 + logger.info("============= Set airdropBudgetHolder balance ============="); + await setBalance(TC5, constants.airdropBudgetHolder, '0'); - await TC5.setBalance( - constants.ops, - constants.opsPassphrase, - constants.account1, - airdropOstUsd.toWei(constants.account1InitialBrandedTokenBalance), - constants.gasUsed); - - - const account1Balance = await TC5.balanceOf(constants.account1); - assert.equal(account1Balance, airdropOstUsd.toWei(constants.account1InitialBrandedTokenBalance)); - - await TC5.setBalance( - constants.ops, - constants.opsPassphrase, - constants.account2, - airdropOstUsd.toWei('0'), - constants.gasUsed); - - const account2Balance = await TC5.balanceOf(constants.account2); - assert.equal(account2Balance, airdropOstUsd.toWei('0')); - - await TC5.setBalance( - constants.ops, - constants.opsPassphrase, - constants.account3, - airdropOstUsd.toWei('0'), - constants.gasUsed); - - const account3Balance = await TC5.balanceOf(constants.account3); - assert.equal(account3Balance, airdropOstUsd.toWei('0')); + // Do Airdrop Setup if setup was not done + logger.info("============= Do Airdrop Setup if setup was not done ============="); + await registerAirdrop(constants.airdropOstUsdAddress); - await TC5.setBalance( - constants.ops, - constants.opsPassphrase, - constants.account4, - airdropOstUsd.toWei('0'), - constants.gasUsed); + }); - const account4Balance = await TC5.balanceOf(constants.account4); - assert.equal(account4Balance, airdropOstUsd.toWei('0')); + it('AirdropManager: transfer branded token from reserve to airdropBudgetHolder and approve airdrop contract', async function() { + // eslint-disable-next-line no-invalid-this + this.timeout(100000); - // Populate Cache - brandedTokenObject.getBalanceOf(constants.account1); - brandedTokenObject.getBalanceOf(constants.account2); - brandedTokenObject.getBalanceOf(constants.account3); - brandedTokenObject.getBalanceOf(constants.account4); + const address = [ + constants.account1, + constants.airdropBudgetHolder + ]; + const initalBalancesFromContract = await getBalanceFromContract(TC5, address); + const initalBalancesCache = await getBalanceFromCache(brandedTokenObject, address); + validateContractAndCacheBalance(initalBalancesFromContract, initalBalancesCache); - }); - it('AirdropManager: transfer branded token from reserve to airdropBudgetHolder', async function() { - this.timeout(100000); - const airdropBudgetAmountInWei = new BigNumber(constants.airdropBudgetBrandedTokenBalance) - , initialAccount1Balance = new BigNumber(await TC5.balanceOf(constants.account1)); - ; - assert.isAbove( - initialAccount1Balance.toNumber(), - airdropBudgetAmountInWei.toNumber(), - "account1 balance should be greater than airdropBudgetAmount") - ; - logger.info("=======initialAccount1Balance:", initialAccount1Balance.toString(), - "\nairdropBudgetAmount:",airdropBudgetAmountInWei.toString(), - "\nairdropOstUsdAddress:",constants.airdropOstUsdAddress); - var transferToAirdropBudgetHolderResult = await airdropManager.transfer( + // transfer amount + await transferTokenToAirdropBugetHolder(TC5, + constants.airdropOstUsdAddress, constants.account1, constants.accountPassphrase1, - constants.airdropOstUsdAddress, - airdropBudgetAmountInWei.toString(), - constants.gasUsed, - constants.chainId, - {returnType: constants.returnTypeReceipt} - ); - logger.info("=======transferToAirdropBudgetHolderResult======="); - logger.info(transferToAirdropBudgetHolderResult); - const afterTransferAirdropBudgetHolderBalance = new BigNumber(await TC5.balanceOf(constants.airdropBudgetHolder)); - assert.equal(afterTransferAirdropBudgetHolderBalance.toString(), airdropBudgetAmountInWei.toString()); - // verify if the transaction receipt is valid - await utils.verifyTransactionReceipt(transferToAirdropBudgetHolderResult); + constants.airdropBudgetHolder, + constants.airdropBudgetBrandedTokenBalance); - // verify if the transaction was actually mined - await utils.verifyIfMined(airdropOstUsd, transferToAirdropBudgetHolderResult.data.transaction_hash); - transferToAirdropBudgetHolderTransactionHash = transferToAirdropBudgetHolderResult.data.transaction_hash; - }); + const balanceFromContract = await getBalanceFromContract(TC5, address); + const balancesFromCache = await getBalanceFromCache(brandedTokenObject, address); + validateContractAndCacheBalance(balanceFromContract, balancesFromCache); - it('AirdropManager: aidropBudgetHolder is approving airdrop contract', async function() { - this.timeout(100000); + // approve var approveToAirdropBudgetHolderResult = await airdropManager.approve( constants.airdropOstUsdAddress, constants.airdropBudgetHolderPassphrase, constants.gasUsed, constants.chainId, - {returnType: constants.returnTypeReceipt} + constants.optionsReceipt ); - assert.equal(approveToAirdropBudgetHolderResult.isSuccess(), true); logger.info("=======approveToAirdropBudgetHolderResult======="); logger.info(approveToAirdropBudgetHolderResult); + + assert.equal(approveToAirdropBudgetHolderResult.isSuccess(), true); // verify if the transaction receipt is valid await utils.verifyTransactionReceipt(approveToAirdropBudgetHolderResult); - // verify if the transaction was actually mined await utils.verifyIfMined(airdropOstUsd, approveToAirdropBudgetHolderResult.data.transaction_hash); - }); - it('AirdropManager: batch allocate to airdrop users', async function() { + + it('AirdropManager: batch allocate to airdrop users and check user balance', async function() { + // eslint-disable-next-line no-invalid-this this.timeout(10000); + + var airdropUsers = constants.airdropUsers; + airdropUsers[constants.account2] = {airdropAmount: '100000000000000000000', expiryTimestamp: 0}; + + // checks for cache and DB consistency + const beforeAllocationBalanceFromDB = await getUserAirdropBalanceFromDB(constants.airdropOstUsdAddress, Object.keys(airdropUsers)); + const beforeAllocationBalanceFromCache = await getUserAirdropBalanceFromCache(constants.airdropOstUsdAddress, Object.keys(airdropUsers)); + validateDBandCacheAirdropBalances(beforeAllocationBalanceFromDB.data, beforeAllocationBalanceFromCache.data); + var batchAllocateAirdropAmountResult = await airdropManager.batchAllocate( constants.airdropOstUsdAddress, transferToAirdropBudgetHolderTransactionHash, - constants.airdropUsers, + airdropUsers, constants.chainId ); + assert.equal(batchAllocateAirdropAmountResult.isSuccess(), true); var airdropAllocationProofDetailModel = new airdropAllocationProofDetailKlass(); var result = await airdropAllocationProofDetailModel.getByTransactionHash(transferToAirdropBudgetHolderTransactionHash); var airdropAllocationProofDetailRecord = result[0]; // airdrop_allocated_amount is less than or equal to airdrop_amount - assert.isAtMost(new BigNumber(airdropAllocationProofDetailRecord.airdrop_allocated_amount).toNumber(), - new BigNumber(airdropAllocationProofDetailRecord.airdrop_amount).toNumber()); - }); + assert.equal(new BigNumber(airdropAllocationProofDetailRecord.airdrop_allocated_amount).lte(new BigNumber(airdropAllocationProofDetailRecord.airdrop_amount)), true); + - it('AirdropManager: Get User Balance and validate balance', async function() { - this.timeout(5000); - var userAddressArray = []; - for (var ua in constants.airdropUsers){ - userAddressArray.push(ua); + // checks for cache and DB consistency + const afterAllocationBalanceFromDB = await getUserAirdropBalanceFromDB(constants.airdropOstUsdAddress, Object.keys(airdropUsers)); + const afterAllocationBalanceFromCache = await getUserAirdropBalanceFromCache(constants.airdropOstUsdAddress, Object.keys(airdropUsers)); + validateDBandCacheAirdropBalances(afterAllocationBalanceFromDB.data, afterAllocationBalanceFromCache.data); + + // check if the airdrop balance reflects the proper value. + const allUserKeys = Object.keys(airdropUsers); + for (var i = allUserKeys.length - 1; i >= 0; i--) { + const userKey = allUserKeys[i]; + const initialTotalAirdropAmount = new BigNumber(beforeAllocationBalanceFromDB.data[userKey].totalAirdropAmount); + const initialTotalAirdropUsedAmount = new BigNumber(beforeAllocationBalanceFromDB.data[userKey].totalAirdropUsedAmount); + const initialBalanceAirdropAmount = new BigNumber(beforeAllocationBalanceFromDB.data[userKey].balanceAirdropAmount); + + const totalAirdropAmount = new BigNumber(afterAllocationBalanceFromDB.data[userKey].totalAirdropAmount); + const totalAirdropUsedAmount = new BigNumber(afterAllocationBalanceFromDB.data[userKey].totalAirdropUsedAmount); + const balanceAirdropAmount = new BigNumber(afterAllocationBalanceFromDB.data[userKey].balanceAirdropAmount); + + assert.equal((initialTotalAirdropAmount.plus(new BigNumber(airdropUsers[userKey].airdropAmount))).equals(totalAirdropAmount), true); + + assert.equal(initialTotalAirdropUsedAmount.equals(totalAirdropUsedAmount), true); + assert.equal(initialTotalAirdropUsedAmount.equals(0), true); + + assert.equal((initialBalanceAirdropAmount.plus(new BigNumber(airdropUsers[userKey].airdropAmount))).equals(balanceAirdropAmount), true); } - // Without Cache + }); + + + it('should fail when worker is not whitelisted', async function() { + // eslint-disable-next-line no-invalid-this + this.timeout(100000); + + // Populate Cache + populateCache(); + + const beneficiary = constants.account3 + , commissionAmount = new BigNumber(airdropOstUsd.toWei('0.9')) + , commissionBeneficiary = constants.account4 + , currency = constants.currencyUSD + , transferAmount = new BigNumber(airdropOstUsd.toWei('1.18')) + , spenderAddress = constants.account2 + , spenderPassphrase = constants.accountPassphrase2 + , airdropBudgetHolder = constants.airdropBudgetHolder + ; + + // checks for account balance cache and DB consistency + logger.info("============ Validating consistency for account balance form cache and contract ============="); + const address = [ + spenderAddress, + beneficiary, + commissionBeneficiary, + airdropBudgetHolder + ]; + const initalBalancesFromContract = await getBalanceFromContract(TC5, address); + const initalBalancesCache = await getBalanceFromCache(brandedTokenObject, address); + validateContractAndCacheBalance(initalBalancesFromContract, initalBalancesCache); + + + // checks for airdrop balance cache and DB consistency + logger.info("============ Validating consistency for airdrop balance form cache and DB ============="); + const airdropUserAddress = [spenderAddress]; + const initialAirdropBalanceFromDB = await getUserAirdropBalanceFromDB(constants.airdropOstUsdAddress, airdropUserAddress); + const initialAirdropBalanceFromCache = await getUserAirdropBalanceFromCache(constants.airdropOstUsdAddress, airdropUserAddress); + validateDBandCacheAirdropBalances(initialAirdropBalanceFromDB.data, initialAirdropBalanceFromCache.data); + var airdropBalanceResult = await airdropManager.getAirdropBalance( constants.chainId, constants.airdropOstUsdAddress, - userAddressArray + [spenderAddress] ); assert.equal(airdropBalanceResult.isSuccess(), true); - // With Cache + const availableAirdropBalance = new BigNumber(airdropBalanceResult.data[spenderAddress].balanceAirdropAmount); + + const estimatedValues = await airdropOstUsd.getPricePointAndCalculatedAmounts( + transferAmount, + commissionAmount, + currency); + assert.equal(estimatedValues.isSuccess(), true); + + const estimatedTokenAmount = new BigNumber(estimatedValues.data.tokenAmount); + const estimatedCommissionTokenAmount = new BigNumber(estimatedValues.data.commissionTokenAmount); + const intendedPricePoint = estimatedValues.data.pricePoint; + + const estimatedTotalAmount = new BigNumber(0).plus(estimatedTokenAmount).plus(estimatedCommissionTokenAmount); + + const estimatedAirdropUsed = BigNumber.min(estimatedTotalAmount, availableAirdropBalance); + logger.info("============ estimatedAirdropUsed ============"); + logger.info(estimatedAirdropUsed); + + // Approve account1 for transfer + const accountApproveResponse = await TC5.approve( + spenderAddress, + spenderPassphrase, + constants.airdropOstUsdAddress, + estimatedTotalAmount.plus(100), + constants.gasUsed); + + logger.info("============spender approving to contract============="); + logger.info(accountApproveResponse); + var worker1Balance = await web3RpcProvider.eth.getBalance(constants.workerAccount1); + logger.info("\nconstants.workerAccount1.balance: ", worker1Balance); + + const payResponse = await airdropOstUsd.pay( + constants.ops, + constants.opsPassphrase, + beneficiary, + transferAmount.toString(10), + commissionBeneficiary, + commissionAmount.toString(10), + currency, + intendedPricePoint, + spenderAddress, + constants.gasUsed, + constants.optionsReceipt); + + assert.equal(payResponse.isFailure(), true); + logger.info("============airdrop.pay response============="); + logger.info(payResponse); + + + // checks for account balance cache and DB consistency + logger.info("============ Validating consistency for account balance form cache and contract after pay ============="); + const balanceFromContract = await getBalanceFromContract(TC5, address); + const balancesFromCache = await getBalanceFromCache(brandedTokenObject, address); + validateContractAndCacheBalance(balanceFromContract, balancesFromCache); + //check if the initial and current balances are reverted properly + validateContractAndCacheBalance(initalBalancesFromContract, balanceFromContract); + + // checks for airdrop balance cache and DB consistency + logger.info("============ Validating consistency for airdrop balance form cache and DB after pay ============="); + const airdropBalanceFromDB = await getUserAirdropBalanceFromDB(constants.airdropOstUsdAddress, airdropUserAddress); + const airdropBalanceFromCache = await getUserAirdropBalanceFromCache(constants.airdropOstUsdAddress, airdropUserAddress); + validateDBandCacheAirdropBalances(airdropBalanceFromDB.data, airdropBalanceFromCache.data); + // validate if the airdrop transfer was reverted properly + validateDBandCacheAirdropBalances(initialAirdropBalanceFromDB.data, airdropBalanceFromDB.data); + + }); + + it('should pass when transfer amount is less than available airdrop amount', async function() { + // eslint-disable-next-line no-invalid-this + this.timeout(100000); + + // Populate Cache + populateCache(); + + const beneficiary = constants.account3 + , commissionAmount = new BigNumber(airdropOstUsd.toWei('0.7')) + , commissionBeneficiary = constants.account4 + , currency = constants.currencyUSD + , transferAmount = new BigNumber(airdropOstUsd.toWei('1.91')) + , spenderAddress = constants.account2 + , spenderPassphrase = constants.accountPassphrase2 + , airdropBudgetHolder = constants.airdropBudgetHolder + ; + + // checks for account balance cache and DB consistency + logger.info("============ Validating consistency for account balance form cache and contract ============="); + const address = [ + spenderAddress, + beneficiary, + commissionBeneficiary, + airdropBudgetHolder + ]; + const initalBalancesFromContract = await getBalanceFromContract(TC5, address); + const initalBalancesCache = await getBalanceFromCache(brandedTokenObject, address); + validateContractAndCacheBalance(initalBalancesFromContract, initalBalancesCache); + + + // checks for airdrop balance cache and DB consistency + logger.info("============ Validating consistency for airdrop balance form cache and DB ============="); + const airdropUserAddress = [spenderAddress]; + const initialAirdropBalanceFromDB = await getUserAirdropBalanceFromDB(constants.airdropOstUsdAddress, airdropUserAddress); + const initialAirdropBalanceFromCache = await getUserAirdropBalanceFromCache(constants.airdropOstUsdAddress, airdropUserAddress); + validateDBandCacheAirdropBalances(initialAirdropBalanceFromDB.data, initialAirdropBalanceFromCache.data); + var airdropBalanceResult = await airdropManager.getAirdropBalance( constants.chainId, constants.airdropOstUsdAddress, - userAddressArray + [spenderAddress] ); assert.equal(airdropBalanceResult.isSuccess(), true); - for (var userAddress in constants.airdropUsers){ - // Match airdrop allocated Balance - assert.equal(airdropBalanceResult.data[userAddress].total_airdrop_amount, constants.airdropUsers[userAddress].airdrop_amount); - } + const availableAirdropBalance = new BigNumber(airdropBalanceResult.data[spenderAddress].balanceAirdropAmount); + + const estimatedValues = await airdropOstUsd.getPricePointAndCalculatedAmounts( + transferAmount, + commissionAmount, + currency); + assert.equal(estimatedValues.isSuccess(), true); + + const estimatedTokenAmount = new BigNumber(estimatedValues.data.tokenAmount); + const estimatedCommissionTokenAmount = new BigNumber(estimatedValues.data.commissionTokenAmount); + const intendedPricePoint = estimatedValues.data.pricePoint; + + const estimatedTotalAmount = new BigNumber(0).plus(estimatedTokenAmount).plus(estimatedCommissionTokenAmount); + + const estimatedAirdropUsed = BigNumber.min(estimatedTotalAmount, availableAirdropBalance); + logger.info("============ estimatedAirdropUsed ============"); + logger.info(estimatedAirdropUsed); + // here we make sure that airdrop amount used will be greater than 0 + assert.equal(estimatedAirdropUsed.gt(0), true); + // Approve account1 for transfer + const accountApproveResponse = await TC5.approve( + spenderAddress, + spenderPassphrase, + constants.airdropOstUsdAddress, + estimatedTotalAmount.plus(100), + constants.gasUsed); + + logger.info("============spender approving to contract============="); + logger.info(accountApproveResponse); + var worker1Balance = await web3RpcProvider.eth.getBalance(constants.workerAccount1); + logger.info("\nconstants.workerAccount1.balance: ", worker1Balance); + + const payResponse = await airdropOstUsd.pay( + constants.workerAccount1, + constants.workerAccountPassphrase1, + beneficiary, + transferAmount.toString(10), + commissionBeneficiary, + commissionAmount.toString(10), + currency, + intendedPricePoint, + spenderAddress, + constants.gasUsed, + constants.optionsReceipt); + + assert.equal(payResponse.isSuccess(), true); + logger.info("============airdrop.pay response============="); + logger.info(payResponse); + + // verify if the transaction receipt is valid + utils.verifyTransactionReceipt(payResponse); + // verify if the transaction is actually mined + await utils.verifyIfMined(airdropOstUsd, payResponse.data.transaction_hash); + + + // checks for account balance cache and DB consistency + logger.info("============ Validating consistency for account balance form cache and contract after pay ============="); + const balanceFromContract = await getBalanceFromContract(TC5, address); + const balancesFromCache = await getBalanceFromCache(brandedTokenObject, address); + validateContractAndCacheBalance(balanceFromContract, balancesFromCache); + //check if the transfer was propre + validateTransferSuccess( + estimatedTokenAmount, + estimatedCommissionTokenAmount, + estimatedAirdropUsed, + spenderAddress, + beneficiary, + commissionBeneficiary, + airdropBudgetHolder, + initalBalancesFromContract, + balanceFromContract); + + // checks for airdrop balance cache and DB consistency + logger.info("============ Validating consistency for airdrop balance form cache and DB after pay ============="); + const airdropBalanceFromDB = await getUserAirdropBalanceFromDB(constants.airdropOstUsdAddress, airdropUserAddress); + const airdropBalanceFromCache = await getUserAirdropBalanceFromCache(constants.airdropOstUsdAddress, airdropUserAddress); + validateDBandCacheAirdropBalances(airdropBalanceFromDB.data, airdropBalanceFromCache.data); + // validate if the airdrop transfer was proper + validateAirdropTransferSuccess( + spenderAddress, + initialAirdropBalanceFromDB, + airdropBalanceFromDB, + estimatedAirdropUsed); + }); - it('should pass when all parameters are valid with currency USD and account1 allocated airdrop amount is 0', async function() { + // This is with an assumption that pervious test was passed and due to that constants.account3 has some balance + it('should pass when airdrop amount is 0', async function() { // eslint-disable-next-line no-invalid-this this.timeout(100000); - logger.info("========Get Amount from Contract========="); - const initialAccount1Balance = new BigNumber(await TC5.balanceOf(constants.account1)) - , initialAccount3Balance = new BigNumber(await TC5.balanceOf(constants.account3)) - , initialAccount4Balance = new BigNumber(await TC5.balanceOf(constants.account4)) - ; - - // Cache check - logger.info("========Get Amount from Cache========="); - // const initialAccount1BalanceCache = await brandedTokenObject.getBalanceOf(constants.account1) - // , initialAccount3BalanceCache = await brandedTokenObject.getBalanceOf(constants.account3) - // , initialAccount4BalanceCache = await brandedTokenObject.getBalanceOf(constants.account4) - // ; - logger.info("========Asserting amount of cache and DB========="); - // assert.equal(initialAccount1Balance.toString(), new BigNumber(initialAccount1BalanceCache.data.balance).toString(), "account1: Actual and cacheValue mismatch"); - // assert.equal(initialAccount3Balance.toString(), new BigNumber(initialAccount3BalanceCache.data.balance).toString(), "account3: Actual and cacheValue mismatch"); - // assert.equal(initialAccount4Balance.toString(), new BigNumber(initialAccount4BalanceCache.data.balance).toString(), "account4: Actual and cacheValue mismatch"); + // Populate Cache + populateCache(); - const beneficiary = constants.account3 - , commissionAmount = new BigNumber(airdropOstUsd.toWei('1')) + const beneficiary = constants.account1 + , commissionAmount = new BigNumber(airdropOstUsd.toWei('0.0000000001')) , commissionBeneficiary = constants.account4 , currency = constants.currencyUSD - , transferAmount = new BigNumber(airdropOstUsd.toWei('9')) + , transferAmount = new BigNumber(airdropOstUsd.toWei('0.000000033')) + , spenderAddress = constants.account3 + , spenderPassphrase = constants.accountPassphrase3 + , airdropBudgetHolder = constants.airdropBudgetHolder ; + // checks for account balance cache and DB consistency + logger.info("============ Validating consistency for account balance form cache and contract ============="); + const address = [ + spenderAddress, + beneficiary, + commissionBeneficiary, + airdropBudgetHolder + ]; + const initalBalancesFromContract = await getBalanceFromContract(TC5, address); + const initalBalancesCache = await getBalanceFromCache(brandedTokenObject, address); + validateContractAndCacheBalance(initalBalancesFromContract, initalBalancesCache); + + + // checks for airdrop balance cache and DB consistency + logger.info("============ Validating consistency for airdrop balance form cache and DB ============="); + const airdropUserAddress = [spenderAddress]; + const initialAirdropBalanceFromDB = await getUserAirdropBalanceFromDB(constants.airdropOstUsdAddress, airdropUserAddress); + const initialAirdropBalanceFromCache = await getUserAirdropBalanceFromCache(constants.airdropOstUsdAddress, airdropUserAddress); + validateDBandCacheAirdropBalances(initialAirdropBalanceFromDB.data, initialAirdropBalanceFromCache.data); + + var airdropBalanceResult = await airdropManager.getAirdropBalance( + constants.chainId, + constants.airdropOstUsdAddress, + [spenderAddress] + ); + assert.equal(airdropBalanceResult.isSuccess(), true); + // this line is to make sure that the airdropBalance is not availalbe for the user. This is because this user was never allocated airdrop. + assert.isUndefined(airdropBalanceResult.data[spenderAddress]); + const availableAirdropBalance = new BigNumber(0); + const estimatedValues = await airdropOstUsd.getPricePointAndCalculatedAmounts( transferAmount, commissionAmount, @@ -307,74 +915,124 @@ describe('Airdrop Pay', function() { const estimatedTotalAmount = new BigNumber(0).plus(estimatedTokenAmount).plus(estimatedCommissionTokenAmount); + const estimatedAirdropUsed = BigNumber.min(estimatedTotalAmount, availableAirdropBalance); + logger.info("============ estimatedAirdropUsed ============"); + logger.info(estimatedAirdropUsed); + // Here we make sure that the airdrop amount is 0; + assert.equal(estimatedAirdropUsed.equals(0), true); // Approve account1 for transfer - const account1ApproveResponse = await TC5.approve( - constants.account1, - constants.accountPassphrase1, + const accountApproveResponse = await TC5.approve( + spenderAddress, + spenderPassphrase, constants.airdropOstUsdAddress, - estimatedTotalAmount.plus(100).toString(), + estimatedTotalAmount.plus(100), constants.gasUsed); logger.info("============spender approving to contract============="); - logger.info(account1ApproveResponse); + logger.info(accountApproveResponse); var worker1Balance = await web3RpcProvider.eth.getBalance(constants.workerAccount1); logger.info("\nconstants.workerAccount1.balance: ", worker1Balance); + const payResponse = await airdropOstUsd.pay( constants.workerAccount1, constants.workerAccountPassphrase1, beneficiary, - transferAmount.toString(), + transferAmount.toString(10), commissionBeneficiary, - commissionAmount.toString(), + commissionAmount.toString(10), currency, intendedPricePoint, - constants.account1, + spenderAddress, constants.gasUsed, - {returnType: constants.returnTypeReceipt, tag: 'airdrop.pay'}); + constants.optionsReceipt); + + assert.equal(payResponse.isSuccess(), true); logger.info("============airdrop.pay response============="); logger.info(payResponse); - // verify if the transaction receipt is valid utils.verifyTransactionReceipt(payResponse); - // verify if the transaction is actually mined await utils.verifyIfMined(airdropOstUsd, payResponse.data.transaction_hash); - // const account1Balance = new BigNumber(await TC5.balanceOf(constants.account1)) - // , account3Balance = new BigNumber(await TC5.balanceOf(constants.account3)) - // , account4Balance = new BigNumber(await TC5.balanceOf(constants.account4)) - // ; - // - // assert.equal( - // new BigNumber(0).plus(initialAccount1Balance) - // .minus(estimatedTokenAmount) - // .minus(estimatedCommissionTokenAmount) - // .toNumber(), account1Balance.toNumber()); - // - // assert.equal( - // new BigNumber(0).plus(initialAccount3Balance) - // .plus(estimatedTokenAmount) - // .toNumber(), account3Balance.toNumber()); - // - // assert.equal( - // new BigNumber(0).plus(initialAccount4Balance) - // .plus(estimatedCommissionTokenAmount) - // .toNumber(), account4Balance.toNumber()); - // + // checks for account balance cache and DB consistency + logger.info("============ Validating consistency for account balance form cache and contract after pay ============="); + const balanceFromContract = await getBalanceFromContract(TC5, address); + const balancesFromCache = await getBalanceFromCache(brandedTokenObject, address); + validateContractAndCacheBalance(balanceFromContract, balancesFromCache); + //check if the transfer was propre + validateTransferSuccess( + estimatedTokenAmount, + estimatedCommissionTokenAmount, + estimatedAirdropUsed, + spenderAddress, + beneficiary, + commissionBeneficiary, + airdropBudgetHolder, + initalBalancesFromContract, + balanceFromContract); + + // checks for airdrop balance cache and DB consistency + logger.info("============ Validating consistency for airdrop balance form cache and DB after pay ============="); + const airdropBalanceFromDB = await getUserAirdropBalanceFromDB(constants.airdropOstUsdAddress, airdropUserAddress); + const airdropBalanceFromCache = await getUserAirdropBalanceFromCache(constants.airdropOstUsdAddress, airdropUserAddress); + validateDBandCacheAirdropBalances(airdropBalanceFromDB.data, airdropBalanceFromCache.data); + // validate if the airdrop transfer was proper + validateAirdropTransferSuccess( + spenderAddress, + initialAirdropBalanceFromDB, + airdropBalanceFromDB, + estimatedAirdropUsed); }); - it('should pass when all parameters are valid with currency USD and allocated airdrop amount is greater than 0', async function() { + it('should pass when all airdrop amount is used and partial user balance is used', async function() { // eslint-disable-next-line no-invalid-this this.timeout(100000); + + // Populate Cache + populateCache(); + const spenderAddress = constants.account2 + , spenderPassphrase = constants.accountPassphrase2 + ; + + var airdropBalanceResult = await airdropManager.getAirdropBalance( + constants.chainId, + constants.airdropOstUsdAddress, + [spenderAddress] + ); + assert.equal(airdropBalanceResult.isSuccess(), true); + + const availableAirdropBalance = new BigNumber(airdropBalanceResult.data[spenderAddress].balanceAirdropAmount); + const partialAmount = new BigNumber(10); + const beneficiary = constants.account3 - , commissionAmount = new BigNumber(airdropOstUsd.toWei('1')) + , commissionAmount = partialAmount , commissionBeneficiary = constants.account4 , currency = constants.currencyUSD - , transferAmount = new BigNumber(airdropOstUsd.toWei('9')) + , transferAmount = availableAirdropBalance.div(6).floor() + , airdropBudgetHolder = constants.airdropBudgetHolder ; + // checks for account balance cache and DB consistency + logger.info("============ Validating consistency for account balance form cache and contract ============="); + const address = [ + spenderAddress, + beneficiary, + commissionBeneficiary, + airdropBudgetHolder + ]; + const initalBalancesFromContract = await getBalanceFromContract(TC5, address); + const initalBalancesCache = await getBalanceFromCache(brandedTokenObject, address); + validateContractAndCacheBalance(initalBalancesFromContract, initalBalancesCache); + + // checks for airdrop balance cache and DB consistency + logger.info("============ Validating consistency for airdrop balance form cache and DB ============="); + const airdropUserAddress = [spenderAddress]; + const initialAirdropBalanceFromDB = await getUserAirdropBalanceFromDB(constants.airdropOstUsdAddress, airdropUserAddress); + const initialAirdropBalanceFromCache = await getUserAirdropBalanceFromCache(constants.airdropOstUsdAddress, airdropUserAddress); + validateDBandCacheAirdropBalances(initialAirdropBalanceFromDB.data, initialAirdropBalanceFromCache.data); + const estimatedValues = await airdropOstUsd.getPricePointAndCalculatedAmounts( transferAmount, commissionAmount, @@ -386,61 +1044,83 @@ describe('Airdrop Pay', function() { const intendedPricePoint = estimatedValues.data.pricePoint; const estimatedTotalAmount = new BigNumber(0).plus(estimatedTokenAmount).plus(estimatedCommissionTokenAmount); - // Batch allocate airdrop amount to account1 - var airdropUsers = {}; - airdropUsers[constants.account1] = {airdropAmount: '50000000000000000000', expiryTimestamp: 0}; - var batchAllocateAirdropAmountResult = await airdropManager.batchAllocate( - constants.airdropOstUsdAddress, - transferToAirdropBudgetHolderTransactionHash, - airdropUsers, - constants.chainId - ); - assert.equal(batchAllocateAirdropAmountResult.isSuccess(), true); - var airdropAllocationProofDetailModel = new airdropAllocationProofDetailKlass(); - var result = await airdropAllocationProofDetailModel.getByTransactionHash(transferToAirdropBudgetHolderTransactionHash); - var airdropAllocationProofDetailRecord = result[0]; - assert.isAtMost(new BigNumber(airdropAllocationProofDetailRecord.airdrop_allocated_amount).toNumber(), - new BigNumber(airdropAllocationProofDetailRecord.airdrop_amount).toNumber()); + const estimatedAirdropUsed = BigNumber.min(estimatedTotalAmount, availableAirdropBalance); + logger.info("============ estimatedAirdropUsed ============"); + logger.info(estimatedAirdropUsed); + // here we make sure that airdrop amount used will be greater than 0 + assert.equal(estimatedAirdropUsed.gt(0), true); // Approve account1 for transfer - const account1ApproveResponse = await TC5.approve( - constants.account1, - constants.accountPassphrase1, + const accountApproveResponse = await TC5.approve( + spenderAddress, + spenderPassphrase, constants.airdropOstUsdAddress, - estimatedTotalAmount.plus(100).toString(), + estimatedTotalAmount.plus(100), constants.gasUsed); logger.info("============spender approving to contract============="); - logger.info(account1ApproveResponse); + logger.info(accountApproveResponse); var worker1Balance = await web3RpcProvider.eth.getBalance(constants.workerAccount1); logger.info("\nconstants.workerAccount1.balance: ", worker1Balance); + const payResponse = await airdropOstUsd.pay( constants.workerAccount1, constants.workerAccountPassphrase1, beneficiary, - transferAmount.toString(), + transferAmount.toString(10), commissionBeneficiary, - commissionAmount.toString(), + commissionAmount.toString(10), currency, intendedPricePoint, - constants.account1, + spenderAddress, constants.gasUsed, - {returnType: constants.returnTypeReceipt, tag: 'airdrop.pay'}); - logger.info("============mocha_test.airdrop.pay response============="); - logger.info(payResponse); + constants.optionsReceipt); + assert.equal(payResponse.isSuccess(), true); + logger.info("============airdrop.pay response============="); + logger.info(payResponse); // verify if the transaction receipt is valid utils.verifyTransactionReceipt(payResponse); - // verify if the transaction is actually mined await utils.verifyIfMined(airdropOstUsd, payResponse.data.transaction_hash); - }); - it('Airdrop.Pay: It exits', async function() { - process.exit(0); + // checks for account balance cache and DB consistency + logger.info("============ Validating consistency for account balance form cache and contract after pay ============="); + const balanceFromContract = await getBalanceFromContract(TC5, address); + const balancesFromCache = await getBalanceFromCache(brandedTokenObject, address); + validateContractAndCacheBalance(balanceFromContract, balancesFromCache); + //check if the transfer was propre + validateTransferSuccess( + estimatedTokenAmount, + estimatedCommissionTokenAmount, + estimatedAirdropUsed, + spenderAddress, + beneficiary, + commissionBeneficiary, + airdropBudgetHolder, + initalBalancesFromContract, + balanceFromContract); + + // checks for airdrop balance cache and DB consistency + logger.info("============ Validating consistency for airdrop balance form cache and DB after pay ============="); + const airdropBalanceFromDB = await getUserAirdropBalanceFromDB(constants.airdropOstUsdAddress, airdropUserAddress); + const airdropBalanceFromCache = await getUserAirdropBalanceFromCache(constants.airdropOstUsdAddress, airdropUserAddress); + validateDBandCacheAirdropBalances(airdropBalanceFromDB.data, airdropBalanceFromCache.data); + // validate if the airdrop transfer was proper + validateAirdropTransferSuccess( + spenderAddress, + initialAirdropBalanceFromDB, + airdropBalanceFromDB, + estimatedAirdropUsed); + }); -}); -*/ \ No newline at end of file + + // it('Airdrop.Pay: It exits', async function() { + // process.exit(0); + // }); + + +}); \ No newline at end of file diff --git a/mocha_test/services/airdrop/pay_1.js b/mocha_test/services/airdrop/pay_1.js deleted file mode 100644 index 12309a9..0000000 --- a/mocha_test/services/airdrop/pay_1.js +++ /dev/null @@ -1,1126 +0,0 @@ -/* global describe, it */ - -const chai = require('chai') - , assert = chai.assert; - -const rootPrefix = "../../.." - , constants = require(rootPrefix + '/mocha_test/lib/constants') - , BigNumber = require('bignumber.js') - , utils = require(rootPrefix+'/mocha_test/lib/utils') - , airdrop = require(rootPrefix + '/lib/contract_interact/airdrop') - , workers = require(rootPrefix + '/lib/contract_interact/workers') - , mockToken = require(rootPrefix + '/lib/contract_interact/EIP20TokenMock') - , BrandedTokenKlass = require(rootPrefix + '/lib/contract_interact/branded_token') - , web3RpcProvider = require(rootPrefix + '/lib/web3/providers/rpc') - , logger = require(rootPrefix + '/helpers/custom_console_logger') -; - -const workersContract = new workers(constants.workersContractAddress, constants.chainId) - , airdropOstUsd = new airdrop(constants.airdropOstUsdAddress, constants.chainId) - , TC5 = new mockToken(constants.TC5Address) - , brandedTokenObject = new BrandedTokenKlass(constants.TC5Address, constants.chainId) -; - - -const AirdropModelCacheKlass = require(rootPrefix + '/lib/cache_management/airdrop_model') - , airdropManager = require(rootPrefix + '/lib/airdrop_management/base') - , airdropAllocationProofDetailKlass = require(rootPrefix + '/app/models/airdrop_allocation_proof_detail') - , UserAirdropDetailKlass = require(rootPrefix + '/app/models/user_airdrop_detail') - , responseHelper = require(rootPrefix + '/lib/formatter/response') -; - -var transferToAirdropBudgetHolderTransactionHash = '' -; - -/** - * Utitlity function to test set accepted margin - * - * @param {Object} airdropObject - airdrop object - * @param {string} currency - currency - * @param {string} margin - accepted margin - * - */ - -async function setAcceptedMargin(airdropObject, currency, margin) { - // set accepted margin - const amResponse = await airdropObject.setAcceptedMargin( - constants.ops, - constants.opsPassphrase, - currency, - margin, - constants.gasUsed, - constants.optionsReceipt); - assert.equal(amResponse.isSuccess(), true); - // verify if the transaction receipt is valid - utils.verifyTransactionReceipt(amResponse); - // verify if the transaction has was actually mined - await utils.verifyIfMined(airdropObject, amResponse.data.transaction_hash); - // verify if its set - const amResult = await airdropObject.acceptedMargins(currency); - assert.equal(amResult.isSuccess(), true); - assert.equal(margin, amResult.data.acceptedMargins); -} - - -/** - * Utitlity function to test set price oracle - * - * @param {Object} airdropObject - airdrop object - * @param {string} currency - currency - * @param {string} address - price oracle address - * - */ -async function setPriceOracle(airdropObject, currency, address) { - // Set Price Oracle - const spoResponse = await airdropObject.setPriceOracle( - constants.ops, - constants.opsPassphrase, - currency, - address, - constants.gasUsed, - constants.optionsReceipt); - assert.equal(spoResponse.isSuccess(), true); - // verify if the transaction receipt is valid - utils.verifyTransactionReceipt(spoResponse); - // verify if the transaction has was actually mined - await utils.verifyIfMined(airdropObject, spoResponse.data.transaction_hash); - // verify if its set - const poResult = await airdropObject.priceOracles(currency); - assert.equal(poResult.isSuccess(), true); - assert.equal(address, poResult.data.priceOracles); -} - - -/** - * Utitlity function to test set worker - * - * @param {string} workerAddress - worker address - * @param {Bignumber} deactivationHeight - deactivation height of the worker - * - */ -async function setWorker(workerAddress, deactivationHeight) { - const setWorkerResponse = await workersContract.setWorker( - constants.ops, - constants.opsPassphrase, - workerAddress, - deactivationHeight.toString(10), - constants.gasUsed, - constants.optionsReceipt); - - assert.equal(setWorkerResponse.isSuccess(), true); - // verify if the transaction receipt is valid - utils.verifyTransactionReceipt(setWorkerResponse); - - // confirm that worker is a set - const isWorkerResponse = await workersContract.isWorker(workerAddress); - assert.equal(isWorkerResponse.isSuccess(), true); - assert.equal(isWorkerResponse.data.isValid, true); -} - - -/** - * Utitlity function to test setBalance - * - * @param {Object} token - branded token object - * @param {string} address - account address - * @param {string} amount - amount that need to be set - * @param {BigNumber} gasPrice - gas price - * - */ -async function setBalance(token, address, amount) { - const amountInWei = airdropOstUsd.toWei(amount); - await token.setBalance( - constants.ops, - constants.opsPassphrase, - address, - amountInWei, - constants.gasUsed); - // check if the balance was set - const accountBalance = await token.balanceOf(address); - assert.equal(accountBalance, amountInWei); -} - -/** - * Utitlity function to get airdrop id from airdrop address - * - * @param {string} airdropAddress - airdrop address - * - * @return {Object} - formatted response - */ - -async function getAirdropIdFromAirdropAddress(airdropAddress) { - const airdropModelCacheObject = new AirdropModelCacheKlass({useObject: true, contractAddress: airdropAddress}) - , airdropModelCacheResponse = await airdropModelCacheObject.fetch() - , airdropRecord = airdropModelCacheResponse.data[airdropAddress.toLowerCase()] - ; - if (airdropRecord) { - return responseHelper.successWithData({airdropId: airdropRecord.id}); - } - return responseHelper.error("gaidfad", "No data found"); -} - -/** - * Utitlity function to register airdrop if not already registered - * - * @param {string} airdropAddress - airdrop address - * - */ -async function registerAirdrop(airdropAddress) { - // Do Airdrop Setup if setup was not done - const airDropIdResponse = await getAirdropIdFromAirdropAddress(airdropAddress); - if (airDropIdResponse.isFailure()) { - const registerAirdropResponse = await airdropManager.registerAirdrop( - airdropAddress, - constants.chainId - ); - assert.equal(registerAirdropResponse.isSuccess(), true); - - // check again if the database awas set; - const airDropIdAfterRegisterResponse = await getAirdropIdFromAirdropAddress(airdropAddress); - assert.equal(airDropIdAfterRegisterResponse.isSuccess(), true); - } -} - -/** - * Utitlity function to transfer token to airdrop budget holder - * - * @param {Object} token - Branded token object - * @param {string} airdropAddress - airdrop address - * @param {string} fromAddress - reserve address - * @param {string} fromPassphrase - passphrase - * @param {string} budgetHolderAddress - budget holder address - * @param {string} amount - amount to transfer to budget holder - * - * @return {transaction hash} - */ -async function transferTokenToAirdropBugetHolder (token, airdropAddress, fromAddress, fromPassphrase, budgetHolderAddress, amount) { - - const airdropBudgetAmountInWei = new BigNumber(airdropOstUsd.toWei(amount)); - const initialBalance = new BigNumber(await token.balanceOf(fromAddress)); - const beforeTransferAirdropBudgetHolderBalance = new BigNumber(await token.balanceOf(budgetHolderAddress)); - - logger.info("initialBalance:", initialBalance.toString(10), - "\nairdropBudgetAmount:", airdropBudgetAmountInWei.toString(10), - "\nairdropAddress:", airdropAddress); - - assert.equal(initialBalance.gte(airdropBudgetAmountInWei), true, "insufficent balance to transfer amount to budgetHolderAddress"); - - var transferToAirdropBudgetHolderResult = await airdropManager.transfer( - fromAddress, - fromPassphrase, - airdropAddress, - airdropBudgetAmountInWei, - constants.gasUsed, - constants.chainId, - constants.optionsReceipt - ); - logger.info("=======transferToAirdropBudgetHolderResult======="); - logger.info(transferToAirdropBudgetHolderResult); - assert.equal(transferToAirdropBudgetHolderResult.isSuccess(), true); - // verify if the transaction receipt is valid - await utils.verifyTransactionReceipt(transferToAirdropBudgetHolderResult); - // verify if the transaction was actually mined - await utils.verifyIfMined(airdropOstUsd, transferToAirdropBudgetHolderResult.data.transaction_hash); - - const afterTransferAirdropBudgetHolderBalance = new BigNumber(await token.balanceOf(budgetHolderAddress)); - assert.equal((beforeTransferAirdropBudgetHolderBalance.plus(airdropBudgetAmountInWei)).equals( afterTransferAirdropBudgetHolderBalance), true); - - // set transaction hash - transferToAirdropBudgetHolderTransactionHash = transferToAirdropBudgetHolderResult.data.transaction_hash; - return transferToAirdropBudgetHolderTransactionHash; -} - -/** - * Utitlity function get user airdrop balance - * - * @param {string} airdropAddress - airdrop address - * @param {Array} userAddressArray - user address array - * - * @return {Object} - formatted response - */ -async function getUserAirdropBalanceFromCache(airdropAddress, userAddressArray) { - // Get cache value - var airdropBalanceResult = await airdropManager.getAirdropBalance( - constants.chainId, - airdropAddress, - userAddressArray - ); - const zeroAmount = { - totalAirdropAmount: '0', - totalAirdropUsedAmount: '0', - balanceAirdropAmount: '0' - }; - var responseData = {}; - if (airdropBalanceResult.isSuccess()) { - responseData = airdropBalanceResult.data; - } - var data = {}; - for (var i = userAddressArray.length - 1; i >= 0; i--) { - if(responseData[userAddressArray[i]]) { - data[userAddressArray[i]] = responseData[userAddressArray[i]]; - } else { - data[userAddressArray[i]] = zeroAmount; - } - } - return responseHelper.successWithData(data); -} - -/** - * Utitlity function get user airdrop balance form DB, bypass cache layer - * - * @param {string} airdropAddress - airdrop address - * @param {Array} userAddressArray - user address array - * - * @return {Object} - formatted response - */ -async function getUserAirdropBalanceFromDB(airdropAddress, userAddressArray) { - - const airDropIdResponse = await getAirdropIdFromAirdropAddress(airdropAddress); - if (airDropIdResponse.isSuccess()) { - const airdropId = airDropIdResponse.data.airdropId; - const userAirdropDetailModel = new UserAirdropDetailKlass(); - - const queryResponse = await userAirdropDetailModel.getByUserAddresses(airdropId, userAddressArray); - - var responseData = {}; - if (queryResponse.isSuccess()) { - responseData = queryResponse.data; - } - var data = {}; - for (var i = userAddressArray.length - 1; i >= 0; i--) { - if(responseData[userAddressArray[i]]) { - data[userAddressArray[i]] = responseData[userAddressArray[i]]; - } else { - data[userAddressArray[i]] = { - totalAirdropAmount: '0', - totalAirdropUsedAmount: '0', - balanceAirdropAmount: '0' - }; - } - } - return responseHelper.successWithData(data); - } - return airDropIdResponse; -} - -/** - * Utitlity function to compare the airdrop balances from DB and cache - * - * @param {Object} dbBalance - airdrop balance from DB - * @param {Object} cacheBalance - airdrop balance from cache - * - */ -function validateDBandCacheAirdropBalances(dbBalance, cacheBalance) { - - const compare = function(obj1, obj2) { - assert.equal(obj1.totalAirdropAmount, obj2.totalAirdropAmount); - assert.equal(obj1.totalAirdropUsedAmount, obj2.totalAirdropUsedAmount); - assert.equal(obj1.balanceAirdropAmount, obj2.balanceAirdropAmount); - }; - - const dbUserKeys = Object.keys(dbBalance); - const cacheUserKeys = Object.keys(cacheBalance); - assert.equal(dbUserKeys.length, cacheUserKeys.length); - for (var i = dbUserKeys.length - 1; i >= 0; i--) { - const dbObject = dbBalance[dbUserKeys[i]]; - const cacheObject = cacheBalance[cacheUserKeys[i]]; - assert.isDefined(dbObject); - assert.isDefined(cacheObject); - compare(dbObject, cacheObject); - } -} - -/** - * Utitlity function to get balance of address from contract - * - * @param {Object} token - token - * @param {string} address - address whose balances need to be found - * - */ -async function getBalanceFromContract(token, address) { - var balances = {}; - for (var i = address.length - 1; i >= 0; i--) { - const addressKey = address[i]; - balances[addressKey] = new BigNumber(await token.balanceOf(addressKey)); - } - return balances; -} - -/** - * Utitlity function to get balance of address from cache - * - * @param {Object} token - token - * @param {string} address - address whose balances need to be found - * - */ -async function getBalanceFromCache(tokenObj, address) { - var balances = {}; - for (var i = address.length - 1; i >= 0; i--) { - const addressKey = address[i]; - const balance = await tokenObj.getBalanceOf(addressKey); - assert.equal(balance.isSuccess(), true); - balances[addressKey] = new BigNumber(balance.data.balance); - } - return balances; -} - -/** - * Utitlity function to compare balances from cache and contract - * - * @param {Object} contractBalances - balances from contract - * @param {Object} cacheBalance - balances from cache - * - */ - -function validateContractAndCacheBalance(cacheBalance, contractBalances) { - const contractKeys = Object.keys(cacheBalance); - const cacheKeys = Object.keys(contractBalances); - assert.equal(contractKeys.length, cacheKeys.length); - for (var i = contractKeys.length - 1; i >= 0; i--) { - const balanceFromContract = contractBalances[contractKeys[i]]; - const balanceFromCache = cacheBalance[contractKeys[i]]; - assert.isDefined(balanceFromContract); - assert.isDefined(balanceFromCache); - assert.equal(balanceFromCache.equals(balanceFromContract), true); - } -} - -/** - * Utitlity function to validate if airdrop was transfered successfully - * - * @param {string} accountAddress - user address - * @param {Object} initialAirdropBalance - Initial airdrop balance - * @param {Object} currentAirdropBalance - Current airdrop balance - * @param {BigNumber} airdropAmountTransfered - estimated airdrop amount that was transfered - */ -function validateAirdropTransferSuccess(accountAddress, initialAirdropBalance, currentAirdropBalance, airdropAmountTransfered) { - - const initialAirdropBalanceData = initialAirdropBalance.data[accountAddress]; - const currentAirdropBalanceData = currentAirdropBalance.data[accountAddress]; - - assert.isDefined(initialAirdropBalanceData); - assert.isDefined(currentAirdropBalanceData); - - const intialTotalAirdropAmount = new BigNumber(initialAirdropBalanceData.totalAirdropAmount); - const initialTotalAirdropUsedAmount = new BigNumber(initialAirdropBalanceData.totalAirdropUsedAmount); - const initialBalanceAirdropAmount = new BigNumber(initialAirdropBalanceData.balanceAirdropAmount); - - const totalAirdropAmount = new BigNumber(currentAirdropBalanceData.totalAirdropAmount); - const totalAirdropUsedAmount = new BigNumber(currentAirdropBalanceData.totalAirdropUsedAmount); - const balanceAirdropAmount = new BigNumber(currentAirdropBalanceData.balanceAirdropAmount); - - assert.equal(intialTotalAirdropAmount.equals(totalAirdropAmount), true); - assert.equal((initialTotalAirdropUsedAmount.plus(airdropAmountTransfered)).equals(totalAirdropUsedAmount), true); - assert.equal((initialBalanceAirdropAmount.minus(airdropAmountTransfered)).equals(balanceAirdropAmount), true); -} - -function validateTransferSuccess( - estimatedTokenAmount, - estimatedCommissionTokenAmount, - estimatedAirdropUsed, - spenderAddress, - beneficiary, - commissionBeneficiary, - airdropBudgetHolder, - initialBalances, - currentBalances) { - - assert.isDefined(estimatedTokenAmount); - assert.isDefined(estimatedCommissionTokenAmount); - assert.isDefined(estimatedAirdropUsed); - assert.isDefined(spenderAddress); - assert.isDefined(beneficiary); - assert.isDefined(commissionBeneficiary); - assert.isDefined(airdropBudgetHolder); - assert.isDefined(initialBalances); - assert.isDefined(currentBalances); - - const estimatedTotalAmount = estimatedTokenAmount.plus(estimatedCommissionTokenAmount); - const actualTransferAmount = estimatedTotalAmount.minus(estimatedAirdropUsed); - const calculatedBenficiaryAmount = initialBalances[beneficiary].plus(estimatedTokenAmount); - const calculatedCommisionAmount = initialBalances[commissionBeneficiary].plus(estimatedCommissionTokenAmount); - const calculatedSpenderAmount = initialBalances[spenderAddress].minus(actualTransferAmount); - const calculatesBugdetHolderAmount = initialBalances[airdropBudgetHolder].minus(estimatedAirdropUsed); - - assert.equal(calculatedBenficiaryAmount.equals(currentBalances[beneficiary]), true); - assert.equal(calculatedCommisionAmount.equals(currentBalances[commissionBeneficiary]), true); - assert.equal(calculatedSpenderAmount.equals(currentBalances[spenderAddress]), true); - assert.equal(calculatesBugdetHolderAmount.equals(currentBalances[airdropBudgetHolder]), true); -} - -/** - * Utitlity function to populate the cache of all test accounts - * - */ -async function populateCache() { - // Populate Cache - await brandedTokenObject.getBalanceOf(constants.account1); - await brandedTokenObject.getBalanceOf(constants.account2); - await brandedTokenObject.getBalanceOf(constants.account3); - await brandedTokenObject.getBalanceOf(constants.account4); - await brandedTokenObject.getBalanceOf(constants.account5); - await brandedTokenObject.getBalanceOf(constants.airdropBudgetHolder); -} -// Tests starts here -describe('Airdrop Pay', function() { - - it('should pass the initial checks', async function() { - // eslint-disable-next-line no-invalid-this - this.timeout(500000); - - // check if the address required for the testing are defined. - assert.isDefined(constants.deployer); - assert.isDefined(constants.ops); - assert.isDefined(constants.account1); - assert.isDefined(constants.workerAccount1); - assert.isDefined(constants.airdropBudgetHolder); - - assert.notEqual(constants.deployer, constants.ops); - assert.notEqual(constants.deployer, constants.account1); - assert.notEqual(constants.ops, constants.account1); - - // set worker - logger.info("============= Set worker ============="); - const currentBlockNumber = await web3RpcProvider.eth.getBlockNumber(); - await setWorker(constants.workerAccount1, new BigNumber(currentBlockNumber).plus(100000000000)); - - // Set Price Oracle - logger.info("============= Set Price Oracle ============="); - await setPriceOracle(airdropOstUsd, constants.currencyUSD, constants.priceOracles.OST.USD); - - // set accepted margin - logger.info("============= Set accepted margin ============="); - await setAcceptedMargin(airdropOstUsd, constants.currencyUSD, 50); - - // set balance for account 1 (Spender) - logger.info("============= Set account 1 balance ============="); - await setBalance(TC5, constants.account1, constants.account1InitialBrandedTokenBalance); - - // reset balance for account 2 to 100 - logger.info("============= Set account 2 balance ============="); - await setBalance(TC5, constants.account2, '100'); - - // reset balance for account 3 to 0 - logger.info("============= Set account 3 balance ============="); - await setBalance(TC5, constants.account3, '0'); - - // reset balance for account 4 to 0 - logger.info("============= Set account 4 balance ============="); - await setBalance(TC5, constants.account4, '0'); - - // reset balance of account airdropBudgetHolder to 0 - logger.info("============= Set airdropBudgetHolder balance ============="); - await setBalance(TC5, constants.airdropBudgetHolder, '0'); - - // Do Airdrop Setup if setup was not done - logger.info("============= Do Airdrop Setup if setup was not done ============="); - await registerAirdrop(constants.airdropOstUsdAddress); - - }); - - it('AirdropManager: transfer branded token from reserve to airdropBudgetHolder and approve airdrop contract', async function() { - // eslint-disable-next-line no-invalid-this - this.timeout(100000); - - const address = [ - constants.account1, - constants.airdropBudgetHolder - ]; - const initalBalancesFromContract = await getBalanceFromContract(TC5, address); - const initalBalancesCache = await getBalanceFromCache(brandedTokenObject, address); - validateContractAndCacheBalance(initalBalancesFromContract, initalBalancesCache); - - - // transfer amount - await transferTokenToAirdropBugetHolder(TC5, - constants.airdropOstUsdAddress, - constants.account1, - constants.accountPassphrase1, - constants.airdropBudgetHolder, - constants.airdropBudgetBrandedTokenBalance); - - const balanceFromContract = await getBalanceFromContract(TC5, address); - const balancesFromCache = await getBalanceFromCache(brandedTokenObject, address); - validateContractAndCacheBalance(balanceFromContract, balancesFromCache); - - // approve - var approveToAirdropBudgetHolderResult = await airdropManager.approve( - constants.airdropOstUsdAddress, - constants.airdropBudgetHolderPassphrase, - constants.gasUsed, - constants.chainId, - constants.optionsReceipt - ); - logger.info("=======approveToAirdropBudgetHolderResult======="); - logger.info(approveToAirdropBudgetHolderResult); - - assert.equal(approveToAirdropBudgetHolderResult.isSuccess(), true); - // verify if the transaction receipt is valid - await utils.verifyTransactionReceipt(approveToAirdropBudgetHolderResult); - // verify if the transaction was actually mined - await utils.verifyIfMined(airdropOstUsd, approveToAirdropBudgetHolderResult.data.transaction_hash); - }); - - - it('AirdropManager: batch allocate to airdrop users and check user balance', async function() { - // eslint-disable-next-line no-invalid-this - this.timeout(10000); - - var airdropUsers = constants.airdropUsers; - airdropUsers[constants.account2] = {airdropAmount: '100000000000000000000', expiryTimestamp: 0}; - - // checks for cache and DB consistency - const beforeAllocationBalanceFromDB = await getUserAirdropBalanceFromDB(constants.airdropOstUsdAddress, Object.keys(airdropUsers)); - const beforeAllocationBalanceFromCache = await getUserAirdropBalanceFromCache(constants.airdropOstUsdAddress, Object.keys(airdropUsers)); - validateDBandCacheAirdropBalances(beforeAllocationBalanceFromDB.data, beforeAllocationBalanceFromCache.data); - - var batchAllocateAirdropAmountResult = await airdropManager.batchAllocate( - constants.airdropOstUsdAddress, - transferToAirdropBudgetHolderTransactionHash, - airdropUsers, - constants.chainId - ); - - assert.equal(batchAllocateAirdropAmountResult.isSuccess(), true); - var airdropAllocationProofDetailModel = new airdropAllocationProofDetailKlass(); - var result = await airdropAllocationProofDetailModel.getByTransactionHash(transferToAirdropBudgetHolderTransactionHash); - var airdropAllocationProofDetailRecord = result[0]; - // airdrop_allocated_amount is less than or equal to airdrop_amount - assert.equal(new BigNumber(airdropAllocationProofDetailRecord.airdrop_allocated_amount).lte(new BigNumber(airdropAllocationProofDetailRecord.airdrop_amount)), true); - - - // checks for cache and DB consistency - const afterAllocationBalanceFromDB = await getUserAirdropBalanceFromDB(constants.airdropOstUsdAddress, Object.keys(airdropUsers)); - const afterAllocationBalanceFromCache = await getUserAirdropBalanceFromCache(constants.airdropOstUsdAddress, Object.keys(airdropUsers)); - validateDBandCacheAirdropBalances(afterAllocationBalanceFromDB.data, afterAllocationBalanceFromCache.data); - - // check if the airdrop balance reflects the proper value. - const allUserKeys = Object.keys(airdropUsers); - for (var i = allUserKeys.length - 1; i >= 0; i--) { - const userKey = allUserKeys[i]; - const initialTotalAirdropAmount = new BigNumber(beforeAllocationBalanceFromDB.data[userKey].totalAirdropAmount); - const initialTotalAirdropUsedAmount = new BigNumber(beforeAllocationBalanceFromDB.data[userKey].totalAirdropUsedAmount); - const initialBalanceAirdropAmount = new BigNumber(beforeAllocationBalanceFromDB.data[userKey].balanceAirdropAmount); - - const totalAirdropAmount = new BigNumber(afterAllocationBalanceFromDB.data[userKey].totalAirdropAmount); - const totalAirdropUsedAmount = new BigNumber(afterAllocationBalanceFromDB.data[userKey].totalAirdropUsedAmount); - const balanceAirdropAmount = new BigNumber(afterAllocationBalanceFromDB.data[userKey].balanceAirdropAmount); - - assert.equal((initialTotalAirdropAmount.plus(new BigNumber(airdropUsers[userKey].airdropAmount))).equals(totalAirdropAmount), true); - - assert.equal(initialTotalAirdropUsedAmount.equals(totalAirdropUsedAmount), true); - assert.equal(initialTotalAirdropUsedAmount.equals(0), true); - - assert.equal((initialBalanceAirdropAmount.plus(new BigNumber(airdropUsers[userKey].airdropAmount))).equals(balanceAirdropAmount), true); - } - }); - - - it('should fail when worker is not whitelisted', async function() { - // eslint-disable-next-line no-invalid-this - this.timeout(100000); - - // Populate Cache - populateCache(); - - const beneficiary = constants.account3 - , commissionAmount = new BigNumber(airdropOstUsd.toWei('0.9')) - , commissionBeneficiary = constants.account4 - , currency = constants.currencyUSD - , transferAmount = new BigNumber(airdropOstUsd.toWei('1.18')) - , spenderAddress = constants.account2 - , spenderPassphrase = constants.accountPassphrase2 - , airdropBudgetHolder = constants.airdropBudgetHolder - ; - - // checks for account balance cache and DB consistency - logger.info("============ Validating consistency for account balance form cache and contract ============="); - const address = [ - spenderAddress, - beneficiary, - commissionBeneficiary, - airdropBudgetHolder - ]; - const initalBalancesFromContract = await getBalanceFromContract(TC5, address); - const initalBalancesCache = await getBalanceFromCache(brandedTokenObject, address); - validateContractAndCacheBalance(initalBalancesFromContract, initalBalancesCache); - - - // checks for airdrop balance cache and DB consistency - logger.info("============ Validating consistency for airdrop balance form cache and DB ============="); - const airdropUserAddress = [spenderAddress]; - const initialAirdropBalanceFromDB = await getUserAirdropBalanceFromDB(constants.airdropOstUsdAddress, airdropUserAddress); - const initialAirdropBalanceFromCache = await getUserAirdropBalanceFromCache(constants.airdropOstUsdAddress, airdropUserAddress); - validateDBandCacheAirdropBalances(initialAirdropBalanceFromDB.data, initialAirdropBalanceFromCache.data); - - var airdropBalanceResult = await airdropManager.getAirdropBalance( - constants.chainId, - constants.airdropOstUsdAddress, - [spenderAddress] - ); - assert.equal(airdropBalanceResult.isSuccess(), true); - const availableAirdropBalance = new BigNumber(airdropBalanceResult.data[spenderAddress].balanceAirdropAmount); - - const estimatedValues = await airdropOstUsd.getPricePointAndCalculatedAmounts( - transferAmount, - commissionAmount, - currency); - assert.equal(estimatedValues.isSuccess(), true); - - const estimatedTokenAmount = new BigNumber(estimatedValues.data.tokenAmount); - const estimatedCommissionTokenAmount = new BigNumber(estimatedValues.data.commissionTokenAmount); - const intendedPricePoint = estimatedValues.data.pricePoint; - - const estimatedTotalAmount = new BigNumber(0).plus(estimatedTokenAmount).plus(estimatedCommissionTokenAmount); - - const estimatedAirdropUsed = BigNumber.min(estimatedTotalAmount, availableAirdropBalance); - logger.info("============ estimatedAirdropUsed ============"); - logger.info(estimatedAirdropUsed); - - // Approve account1 for transfer - const accountApproveResponse = await TC5.approve( - spenderAddress, - spenderPassphrase, - constants.airdropOstUsdAddress, - estimatedTotalAmount.plus(100), - constants.gasUsed); - - logger.info("============spender approving to contract============="); - logger.info(accountApproveResponse); - var worker1Balance = await web3RpcProvider.eth.getBalance(constants.workerAccount1); - logger.info("\nconstants.workerAccount1.balance: ", worker1Balance); - - const payResponse = await airdropOstUsd.pay( - constants.ops, - constants.opsPassphrase, - beneficiary, - transferAmount.toString(10), - commissionBeneficiary, - commissionAmount.toString(10), - currency, - intendedPricePoint, - spenderAddress, - constants.gasUsed, - constants.optionsReceipt); - - assert.equal(payResponse.isFailure(), true); - logger.info("============airdrop.pay response============="); - logger.info(payResponse); - - - // checks for account balance cache and DB consistency - logger.info("============ Validating consistency for account balance form cache and contract after pay ============="); - const balanceFromContract = await getBalanceFromContract(TC5, address); - const balancesFromCache = await getBalanceFromCache(brandedTokenObject, address); - validateContractAndCacheBalance(balanceFromContract, balancesFromCache); - //check if the initial and current balances are reverted properly - validateContractAndCacheBalance(initalBalancesFromContract, balanceFromContract); - - // checks for airdrop balance cache and DB consistency - logger.info("============ Validating consistency for airdrop balance form cache and DB after pay ============="); - const airdropBalanceFromDB = await getUserAirdropBalanceFromDB(constants.airdropOstUsdAddress, airdropUserAddress); - const airdropBalanceFromCache = await getUserAirdropBalanceFromCache(constants.airdropOstUsdAddress, airdropUserAddress); - validateDBandCacheAirdropBalances(airdropBalanceFromDB.data, airdropBalanceFromCache.data); - // validate if the airdrop transfer was reverted properly - validateDBandCacheAirdropBalances(initialAirdropBalanceFromDB.data, airdropBalanceFromDB.data); - - }); - - it('should pass when transfer amount is less than available airdrop amount', async function() { - // eslint-disable-next-line no-invalid-this - this.timeout(100000); - - // Populate Cache - populateCache(); - - const beneficiary = constants.account3 - , commissionAmount = new BigNumber(airdropOstUsd.toWei('0.7')) - , commissionBeneficiary = constants.account4 - , currency = constants.currencyUSD - , transferAmount = new BigNumber(airdropOstUsd.toWei('1.91')) - , spenderAddress = constants.account2 - , spenderPassphrase = constants.accountPassphrase2 - , airdropBudgetHolder = constants.airdropBudgetHolder - ; - - // checks for account balance cache and DB consistency - logger.info("============ Validating consistency for account balance form cache and contract ============="); - const address = [ - spenderAddress, - beneficiary, - commissionBeneficiary, - airdropBudgetHolder - ]; - const initalBalancesFromContract = await getBalanceFromContract(TC5, address); - const initalBalancesCache = await getBalanceFromCache(brandedTokenObject, address); - validateContractAndCacheBalance(initalBalancesFromContract, initalBalancesCache); - - - // checks for airdrop balance cache and DB consistency - logger.info("============ Validating consistency for airdrop balance form cache and DB ============="); - const airdropUserAddress = [spenderAddress]; - const initialAirdropBalanceFromDB = await getUserAirdropBalanceFromDB(constants.airdropOstUsdAddress, airdropUserAddress); - const initialAirdropBalanceFromCache = await getUserAirdropBalanceFromCache(constants.airdropOstUsdAddress, airdropUserAddress); - validateDBandCacheAirdropBalances(initialAirdropBalanceFromDB.data, initialAirdropBalanceFromCache.data); - - var airdropBalanceResult = await airdropManager.getAirdropBalance( - constants.chainId, - constants.airdropOstUsdAddress, - [spenderAddress] - ); - assert.equal(airdropBalanceResult.isSuccess(), true); - const availableAirdropBalance = new BigNumber(airdropBalanceResult.data[spenderAddress].balanceAirdropAmount); - - const estimatedValues = await airdropOstUsd.getPricePointAndCalculatedAmounts( - transferAmount, - commissionAmount, - currency); - assert.equal(estimatedValues.isSuccess(), true); - - const estimatedTokenAmount = new BigNumber(estimatedValues.data.tokenAmount); - const estimatedCommissionTokenAmount = new BigNumber(estimatedValues.data.commissionTokenAmount); - const intendedPricePoint = estimatedValues.data.pricePoint; - - const estimatedTotalAmount = new BigNumber(0).plus(estimatedTokenAmount).plus(estimatedCommissionTokenAmount); - - const estimatedAirdropUsed = BigNumber.min(estimatedTotalAmount, availableAirdropBalance); - logger.info("============ estimatedAirdropUsed ============"); - logger.info(estimatedAirdropUsed); - // here we make sure that airdrop amount used will be greater than 0 - assert.equal(estimatedAirdropUsed.gt(0), true); - // Approve account1 for transfer - const accountApproveResponse = await TC5.approve( - spenderAddress, - spenderPassphrase, - constants.airdropOstUsdAddress, - estimatedTotalAmount.plus(100), - constants.gasUsed); - - logger.info("============spender approving to contract============="); - logger.info(accountApproveResponse); - var worker1Balance = await web3RpcProvider.eth.getBalance(constants.workerAccount1); - logger.info("\nconstants.workerAccount1.balance: ", worker1Balance); - - const payResponse = await airdropOstUsd.pay( - constants.workerAccount1, - constants.workerAccountPassphrase1, - beneficiary, - transferAmount.toString(10), - commissionBeneficiary, - commissionAmount.toString(10), - currency, - intendedPricePoint, - spenderAddress, - constants.gasUsed, - constants.optionsReceipt); - - assert.equal(payResponse.isSuccess(), true); - logger.info("============airdrop.pay response============="); - logger.info(payResponse); - - // verify if the transaction receipt is valid - utils.verifyTransactionReceipt(payResponse); - // verify if the transaction is actually mined - await utils.verifyIfMined(airdropOstUsd, payResponse.data.transaction_hash); - - - // checks for account balance cache and DB consistency - logger.info("============ Validating consistency for account balance form cache and contract after pay ============="); - const balanceFromContract = await getBalanceFromContract(TC5, address); - const balancesFromCache = await getBalanceFromCache(brandedTokenObject, address); - validateContractAndCacheBalance(balanceFromContract, balancesFromCache); - //check if the transfer was propre - validateTransferSuccess( - estimatedTokenAmount, - estimatedCommissionTokenAmount, - estimatedAirdropUsed, - spenderAddress, - beneficiary, - commissionBeneficiary, - airdropBudgetHolder, - initalBalancesFromContract, - balanceFromContract); - - // checks for airdrop balance cache and DB consistency - logger.info("============ Validating consistency for airdrop balance form cache and DB after pay ============="); - const airdropBalanceFromDB = await getUserAirdropBalanceFromDB(constants.airdropOstUsdAddress, airdropUserAddress); - const airdropBalanceFromCache = await getUserAirdropBalanceFromCache(constants.airdropOstUsdAddress, airdropUserAddress); - validateDBandCacheAirdropBalances(airdropBalanceFromDB.data, airdropBalanceFromCache.data); - // validate if the airdrop transfer was proper - validateAirdropTransferSuccess( - spenderAddress, - initialAirdropBalanceFromDB, - airdropBalanceFromDB, - estimatedAirdropUsed); - - }); - - // This is with an assumption that pervious test was passed and due to that constants.account3 has some balance - it('should pass when airdrop amount is 0', async function() { - // eslint-disable-next-line no-invalid-this - this.timeout(100000); - - // Populate Cache - populateCache(); - - const beneficiary = constants.account1 - , commissionAmount = new BigNumber(airdropOstUsd.toWei('0.0000000001')) - , commissionBeneficiary = constants.account4 - , currency = constants.currencyUSD - , transferAmount = new BigNumber(airdropOstUsd.toWei('0.000000033')) - , spenderAddress = constants.account3 - , spenderPassphrase = constants.accountPassphrase3 - , airdropBudgetHolder = constants.airdropBudgetHolder - ; - - // checks for account balance cache and DB consistency - logger.info("============ Validating consistency for account balance form cache and contract ============="); - const address = [ - spenderAddress, - beneficiary, - commissionBeneficiary, - airdropBudgetHolder - ]; - const initalBalancesFromContract = await getBalanceFromContract(TC5, address); - const initalBalancesCache = await getBalanceFromCache(brandedTokenObject, address); - validateContractAndCacheBalance(initalBalancesFromContract, initalBalancesCache); - - - // checks for airdrop balance cache and DB consistency - logger.info("============ Validating consistency for airdrop balance form cache and DB ============="); - const airdropUserAddress = [spenderAddress]; - const initialAirdropBalanceFromDB = await getUserAirdropBalanceFromDB(constants.airdropOstUsdAddress, airdropUserAddress); - const initialAirdropBalanceFromCache = await getUserAirdropBalanceFromCache(constants.airdropOstUsdAddress, airdropUserAddress); - validateDBandCacheAirdropBalances(initialAirdropBalanceFromDB.data, initialAirdropBalanceFromCache.data); - - var airdropBalanceResult = await airdropManager.getAirdropBalance( - constants.chainId, - constants.airdropOstUsdAddress, - [spenderAddress] - ); - assert.equal(airdropBalanceResult.isSuccess(), true); - // this line is to make sure that the airdropBalance is not availalbe for the user. This is because this user was never allocated airdrop. - assert.isUndefined(airdropBalanceResult.data[spenderAddress]); - const availableAirdropBalance = new BigNumber(0); - - const estimatedValues = await airdropOstUsd.getPricePointAndCalculatedAmounts( - transferAmount, - commissionAmount, - currency); - assert.equal(estimatedValues.isSuccess(), true); - - const estimatedTokenAmount = new BigNumber(estimatedValues.data.tokenAmount); - const estimatedCommissionTokenAmount = new BigNumber(estimatedValues.data.commissionTokenAmount); - const intendedPricePoint = estimatedValues.data.pricePoint; - - const estimatedTotalAmount = new BigNumber(0).plus(estimatedTokenAmount).plus(estimatedCommissionTokenAmount); - - const estimatedAirdropUsed = BigNumber.min(estimatedTotalAmount, availableAirdropBalance); - logger.info("============ estimatedAirdropUsed ============"); - logger.info(estimatedAirdropUsed); - // Here we make sure that the airdrop amount is 0; - assert.equal(estimatedAirdropUsed.equals(0), true); - // Approve account1 for transfer - const accountApproveResponse = await TC5.approve( - spenderAddress, - spenderPassphrase, - constants.airdropOstUsdAddress, - estimatedTotalAmount.plus(100), - constants.gasUsed); - - logger.info("============spender approving to contract============="); - logger.info(accountApproveResponse); - var worker1Balance = await web3RpcProvider.eth.getBalance(constants.workerAccount1); - logger.info("\nconstants.workerAccount1.balance: ", worker1Balance); - - const payResponse = await airdropOstUsd.pay( - constants.workerAccount1, - constants.workerAccountPassphrase1, - beneficiary, - transferAmount.toString(10), - commissionBeneficiary, - commissionAmount.toString(10), - currency, - intendedPricePoint, - spenderAddress, - constants.gasUsed, - constants.optionsReceipt); - - assert.equal(payResponse.isSuccess(), true); - logger.info("============airdrop.pay response============="); - logger.info(payResponse); - - // verify if the transaction receipt is valid - utils.verifyTransactionReceipt(payResponse); - // verify if the transaction is actually mined - await utils.verifyIfMined(airdropOstUsd, payResponse.data.transaction_hash); - - - // checks for account balance cache and DB consistency - logger.info("============ Validating consistency for account balance form cache and contract after pay ============="); - const balanceFromContract = await getBalanceFromContract(TC5, address); - const balancesFromCache = await getBalanceFromCache(brandedTokenObject, address); - validateContractAndCacheBalance(balanceFromContract, balancesFromCache); - //check if the transfer was propre - validateTransferSuccess( - estimatedTokenAmount, - estimatedCommissionTokenAmount, - estimatedAirdropUsed, - spenderAddress, - beneficiary, - commissionBeneficiary, - airdropBudgetHolder, - initalBalancesFromContract, - balanceFromContract); - - // checks for airdrop balance cache and DB consistency - logger.info("============ Validating consistency for airdrop balance form cache and DB after pay ============="); - const airdropBalanceFromDB = await getUserAirdropBalanceFromDB(constants.airdropOstUsdAddress, airdropUserAddress); - const airdropBalanceFromCache = await getUserAirdropBalanceFromCache(constants.airdropOstUsdAddress, airdropUserAddress); - validateDBandCacheAirdropBalances(airdropBalanceFromDB.data, airdropBalanceFromCache.data); - // validate if the airdrop transfer was proper - validateAirdropTransferSuccess( - spenderAddress, - initialAirdropBalanceFromDB, - airdropBalanceFromDB, - estimatedAirdropUsed); - }); - - it('should pass when all airdrop amount is used and partial user balance is used', async function() { - // eslint-disable-next-line no-invalid-this - this.timeout(100000); - - // Populate Cache - populateCache(); - const spenderAddress = constants.account2 - , spenderPassphrase = constants.accountPassphrase2 - ; - - var airdropBalanceResult = await airdropManager.getAirdropBalance( - constants.chainId, - constants.airdropOstUsdAddress, - [spenderAddress] - ); - assert.equal(airdropBalanceResult.isSuccess(), true); - - const availableAirdropBalance = new BigNumber(airdropBalanceResult.data[spenderAddress].balanceAirdropAmount); - const partialAmount = new BigNumber(10); - - const beneficiary = constants.account3 - , commissionAmount = partialAmount - , commissionBeneficiary = constants.account4 - , currency = constants.currencyUSD - , transferAmount = availableAirdropBalance.div(6).floor() - , airdropBudgetHolder = constants.airdropBudgetHolder - ; - - // checks for account balance cache and DB consistency - logger.info("============ Validating consistency for account balance form cache and contract ============="); - const address = [ - spenderAddress, - beneficiary, - commissionBeneficiary, - airdropBudgetHolder - ]; - const initalBalancesFromContract = await getBalanceFromContract(TC5, address); - const initalBalancesCache = await getBalanceFromCache(brandedTokenObject, address); - validateContractAndCacheBalance(initalBalancesFromContract, initalBalancesCache); - - // checks for airdrop balance cache and DB consistency - logger.info("============ Validating consistency for airdrop balance form cache and DB ============="); - const airdropUserAddress = [spenderAddress]; - const initialAirdropBalanceFromDB = await getUserAirdropBalanceFromDB(constants.airdropOstUsdAddress, airdropUserAddress); - const initialAirdropBalanceFromCache = await getUserAirdropBalanceFromCache(constants.airdropOstUsdAddress, airdropUserAddress); - validateDBandCacheAirdropBalances(initialAirdropBalanceFromDB.data, initialAirdropBalanceFromCache.data); - - const estimatedValues = await airdropOstUsd.getPricePointAndCalculatedAmounts( - transferAmount, - commissionAmount, - currency); - assert.equal(estimatedValues.isSuccess(), true); - - const estimatedTokenAmount = new BigNumber(estimatedValues.data.tokenAmount); - const estimatedCommissionTokenAmount = new BigNumber(estimatedValues.data.commissionTokenAmount); - const intendedPricePoint = estimatedValues.data.pricePoint; - - const estimatedTotalAmount = new BigNumber(0).plus(estimatedTokenAmount).plus(estimatedCommissionTokenAmount); - - const estimatedAirdropUsed = BigNumber.min(estimatedTotalAmount, availableAirdropBalance); - logger.info("============ estimatedAirdropUsed ============"); - logger.info(estimatedAirdropUsed); - // here we make sure that airdrop amount used will be greater than 0 - assert.equal(estimatedAirdropUsed.gt(0), true); - // Approve account1 for transfer - const accountApproveResponse = await TC5.approve( - spenderAddress, - spenderPassphrase, - constants.airdropOstUsdAddress, - estimatedTotalAmount.plus(100), - constants.gasUsed); - - logger.info("============spender approving to contract============="); - logger.info(accountApproveResponse); - var worker1Balance = await web3RpcProvider.eth.getBalance(constants.workerAccount1); - logger.info("\nconstants.workerAccount1.balance: ", worker1Balance); - - const payResponse = await airdropOstUsd.pay( - constants.workerAccount1, - constants.workerAccountPassphrase1, - beneficiary, - transferAmount.toString(10), - commissionBeneficiary, - commissionAmount.toString(10), - currency, - intendedPricePoint, - spenderAddress, - constants.gasUsed, - constants.optionsReceipt); - - assert.equal(payResponse.isSuccess(), true); - logger.info("============airdrop.pay response============="); - logger.info(payResponse); - - // verify if the transaction receipt is valid - utils.verifyTransactionReceipt(payResponse); - // verify if the transaction is actually mined - await utils.verifyIfMined(airdropOstUsd, payResponse.data.transaction_hash); - - - // checks for account balance cache and DB consistency - logger.info("============ Validating consistency for account balance form cache and contract after pay ============="); - const balanceFromContract = await getBalanceFromContract(TC5, address); - const balancesFromCache = await getBalanceFromCache(brandedTokenObject, address); - validateContractAndCacheBalance(balanceFromContract, balancesFromCache); - //check if the transfer was propre - validateTransferSuccess( - estimatedTokenAmount, - estimatedCommissionTokenAmount, - estimatedAirdropUsed, - spenderAddress, - beneficiary, - commissionBeneficiary, - airdropBudgetHolder, - initalBalancesFromContract, - balanceFromContract); - - // checks for airdrop balance cache and DB consistency - logger.info("============ Validating consistency for airdrop balance form cache and DB after pay ============="); - const airdropBalanceFromDB = await getUserAirdropBalanceFromDB(constants.airdropOstUsdAddress, airdropUserAddress); - const airdropBalanceFromCache = await getUserAirdropBalanceFromCache(constants.airdropOstUsdAddress, airdropUserAddress); - validateDBandCacheAirdropBalances(airdropBalanceFromDB.data, airdropBalanceFromCache.data); - // validate if the airdrop transfer was proper - validateAirdropTransferSuccess( - spenderAddress, - initialAirdropBalanceFromDB, - airdropBalanceFromDB, - estimatedAirdropUsed); - - }); - - - it('Airdrop.Pay: It exits', async function() { - process.exit(0); - }); - - -}); \ No newline at end of file From 0d229db56b90cfe7ea8b5db9fb26905706977c3d Mon Sep 17 00:00:00 2001 From: abhay-pepo Date: Fri, 16 Mar 2018 02:39:28 +0530 Subject: [PATCH 006/115] debug level logging --- app/models/user_airdrop_detail.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/models/user_airdrop_detail.js b/app/models/user_airdrop_detail.js index b01f59f..bdda74b 100644 --- a/app/models/user_airdrop_detail.js +++ b/app/models/user_airdrop_detail.js @@ -39,8 +39,8 @@ const UserAirdropDetailKlassPrototype = { */ getByUserAddresses: async function (airdropId, userAddresses) { var oThis = this; - logger.info("========user_airdrop_detail.getByUserAddresses().userAddresses========="); - logger.info(userAddresses); + logger.debug("========user_airdrop_detail.getByUserAddresses().userAddresses========="); + logger.debug(userAddresses); return new Promise(async function (onResolve, onReject) { var result = {} , userAirdropDetail = {} @@ -58,7 +58,7 @@ const UserAirdropDetailKlassPrototype = { for (var i in userAddresses) { userAddressesMap[userAddresses[i].toLowerCase()] = userAddresses[i]; } - logger.info("userAddressesMap ", userAddressesMap); + logger.debug("userAddressesMap ", userAddressesMap); for (var uadIndex in userAirdropDetailResultArray) { userAirdropDetail = userAirdropDetailResultArray[uadIndex]; @@ -73,8 +73,8 @@ const UserAirdropDetailKlassPrototype = { balanceAirdropAmount: balanceAirdropAmount.toString(10) }; } - logger.info("========user_airdrop_detail.getByUserAddresses().result========="); - logger.info(result); + logger.debug("========user_airdrop_detail.getByUserAddresses().result========="); + logger.debug(result); return onResolve(responseHelper.successWithData(result)); } catch (error) { return onResolve(responseHelper.error('a_m_uad_1', 'error:' + error)); From aa29268a0b7a776dc308e1f8fd03a023ce1de8aa Mon Sep 17 00:00:00 2001 From: abhay-pepo Date: Fri, 16 Mar 2018 20:05:09 +0530 Subject: [PATCH 007/115] Bug fix for "Exception when converting Number to BigNumber with high precision" --- CHANGELOG.md | 5 +++++ VERSION | 2 +- lib/contract_interact/airdrop.js | 2 +- package.json | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d7d2d9..42eddc5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## OpenST-platform v1.0.1 + +Changelog: +- Fixed - Exception coming when converting Number to BigNumber with high precision + ## OpenST-Payments v1.0.0 (14 March 2018) OpenST-Payments 1.0.0 is the first release of OpenST-Payments. It provides `Airdrop` and `Pricer` contracts for token transfers, defines a `PriceOracle` interface, and introduces the concept of `Workers`. diff --git a/VERSION b/VERSION index afaf360..7f20734 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.0.0 \ No newline at end of file +1.0.1 \ No newline at end of file diff --git a/lib/contract_interact/airdrop.js b/lib/contract_interact/airdrop.js index 8c1e47c..8bfcab9 100644 --- a/lib/contract_interact/airdrop.js +++ b/lib/contract_interact/airdrop.js @@ -172,7 +172,7 @@ Airdrop.prototype.pay = async function (senderWorkerAddress, senderWorkerPassphr web3RpcProvider.utils.asciiToHex(currency), intendedPricePoint, spender, - userAirdropAmount.toString()); + userAirdropAmount.toString(10)); const notificationData = helper.getNotificationData( ['transfer.payments.airdrop.pay'], diff --git a/package.json b/package.json index a48816e..616f011 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@openstfoundation/openst-payments", - "version": "1.0.0", + "version": "1.0.1", "description": "Payment infrastructure on top of the OpenST network.", "keywords": [ "openst", From 358cb496fbb6e8b7eb82955ec4b8f60cab5afd6d Mon Sep 17 00:00:00 2001 From: abhay-pepo Date: Mon, 19 Mar 2018 11:32:16 +0530 Subject: [PATCH 008/115] Changelog updated --- CHANGELOG.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d7d2d9..f505a83 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +## OpenST-Payments v1.0.2 + +Changelog: +- Airdrop table caching and integration + +## OpenST-Payments v1.0.1 + +Changelog: +- Fixed - Exception coming when converting Number to BigNumber with high precision + ## OpenST-Payments v1.0.0 (14 March 2018) OpenST-Payments 1.0.0 is the first release of OpenST-Payments. It provides `Airdrop` and `Pricer` contracts for token transfers, defines a `PriceOracle` interface, and introduces the concept of `Workers`. From e4d2eb3d0f8eb12fe3200e0da770196b34cdb7aa Mon Sep 17 00:00:00 2001 From: abhay-pepo Date: Mon, 19 Mar 2018 11:52:45 +0530 Subject: [PATCH 009/115] Bump up --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 616f011..018f043 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@openstfoundation/openst-payments", - "version": "1.0.1", + "version": "1.0.2", "description": "Payment infrastructure on top of the OpenST network.", "keywords": [ "openst", From f550b671272cda2284baab7d57ff576aa1e61d41 Mon Sep 17 00:00:00 2001 From: abhay-pepo Date: Mon, 19 Mar 2018 12:38:43 +0530 Subject: [PATCH 010/115] Enable mocha test Airdrop.pay.exit --- mocha_test/services/airdrop/pay.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mocha_test/services/airdrop/pay.js b/mocha_test/services/airdrop/pay.js index 82c8119..8cde883 100644 --- a/mocha_test/services/airdrop/pay.js +++ b/mocha_test/services/airdrop/pay.js @@ -1118,9 +1118,9 @@ describe('Airdrop Pay', function() { }); - // it('Airdrop.Pay: It exits', async function() { - // process.exit(0); - // }); + it('Airdrop.Pay: It exits', async function() { + process.exit(0); + }); }); \ No newline at end of file From 2193ab5a1398838922b5ae3c9f0b1848fe3556f8 Mon Sep 17 00:00:00 2001 From: deepesh KN Date: Mon, 19 Mar 2018 14:20:12 +0530 Subject: [PATCH 011/115] Added error code for insufficient gas fund and transaction receipt with status 0 --- CHANGELOG.md | 6 ++++++ lib/contract_interact/helper.js | 18 +++++++++++------- package.json | 2 +- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f505a83..fe43bbb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## OpenST-Payments v1.0.3 + +Changelog: +- Added error code for insufficient gas fund +- Added error code for transaction receipt with status 0 + ## OpenST-Payments v1.0.2 Changelog: diff --git a/lib/contract_interact/helper.js b/lib/contract_interact/helper.js index 7403989..fbbe9f6 100644 --- a/lib/contract_interact/helper.js +++ b/lib/contract_interact/helper.js @@ -443,16 +443,16 @@ ContractInteractHelper.prototype = { transaction_receipt: receipt }); }; - const onReceiptFail = async function (errorReason, receipt) { + const onReceiptFail = async function (errorCode, errorReason, receipt) { // call fail callback if (failCallback != undefined && failCallback != null) { logger.debug("======helper.Calling failCallback======="); await failCallback(receipt); } notifyTransactionError(errorReason); - const errorCode = params.errorCode || "l_ci_h_pse"; + const code = `${params.errorCode}|${errorCode}`; const errorMessage = (errorReason && errorReason.message) ? errorReason.message : `Something went wrong: l_ci_h_pse`; - return responseHelper.error(errorCode, errorMessage); + return responseHelper.error(code, errorMessage); }; const onReceipt = function(receipt) { @@ -462,7 +462,7 @@ ContractInteractHelper.prototype = { return onReceiptSuccess(receipt); } else { const errorReason = "Transaction status is 0"; - return onReceiptFail(errorReason, receipt); + return onReceiptFail('l_ci_h_pse_status_0', errorReason, receipt); } }; @@ -500,7 +500,7 @@ ContractInteractHelper.prototype = { } } else { const errorReason = "Unable to get receipt"; - const receiptFailResponse = onReceiptFail(errorReason, {}); + const receiptFailResponse = onReceiptFail('l_ci_h_pse_1', errorReason, {}); if (isValueReturned == false) { isValueReturned = true; return onResolve(receiptFailResponse); @@ -509,7 +509,11 @@ ContractInteractHelper.prototype = { }); } else { - const receiptFailResponse =onReceiptFail(reason, {}); + var errorCode = 'l_ci_h_pse_2'; + if (reason && reason.message && reason.message.includes('insufficient funds for gas * price + value')) { + errorCode = 'l_ci_h_pse_gas_low'; + } + const receiptFailResponse =onReceiptFail(errorCode, reason, {}); if (isValueReturned == false) { isValueReturned = true; return onResolve(receiptFailResponse); @@ -519,7 +523,7 @@ ContractInteractHelper.prototype = { }) .catch(function(reason) { logger.error(`\n=======Exception at location 2========: ${reason} \n`); - const receiptFailResponse =onReceiptFail(reason, {}); + const receiptFailResponse =onReceiptFail('l_ci_h_pse_3', reason, {}); if (isValueReturned == false) { isValueReturned = true; return onResolve(receiptFailResponse); diff --git a/package.json b/package.json index 018f043..d5d8d44 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@openstfoundation/openst-payments", - "version": "1.0.2", + "version": "1.0.3", "description": "Payment infrastructure on top of the OpenST network.", "keywords": [ "openst", From 884895be7c407c1871c606a0f7eb4c5b0377db93 Mon Sep 17 00:00:00 2001 From: deepesh KN Date: Tue, 20 Mar 2018 16:25:59 +0530 Subject: [PATCH 012/115] Changed error message for low balance and low gas balance --- lib/contract_interact/airdrop.js | 2 +- lib/contract_interact/helper.js | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/contract_interact/airdrop.js b/lib/contract_interact/airdrop.js index 8bfcab9..80e8dfb 100644 --- a/lib/contract_interact/airdrop.js +++ b/lib/contract_interact/airdrop.js @@ -142,7 +142,7 @@ Airdrop.prototype.pay = async function (senderWorkerAddress, senderWorkerPassphr logger.debug(`\nuserInitialBalance.plus(airdropAmountToUse): ${(userInitialBalance.plus(airdropAmountToUse)).toString(10)}`); if ((userInitialBalance.plus(airdropAmountToUse)).lt(totalAmount)) { - return Promise.resolve(responseHelper.error('l_ci_a_pay_2', 'insufficient balance for the transaction. (spender+airdropAmountToUse) balance is insufficient for transaction.')); + return Promise.resolve(responseHelper.error('l_ci_a_pay_2', 'insufficient balance')); } var brandedTokenAddress = null; diff --git a/lib/contract_interact/helper.js b/lib/contract_interact/helper.js index fbbe9f6..6099411 100644 --- a/lib/contract_interact/helper.js +++ b/lib/contract_interact/helper.js @@ -509,11 +509,13 @@ ContractInteractHelper.prototype = { }); } else { + var errorReason = reason; var errorCode = 'l_ci_h_pse_2'; if (reason && reason.message && reason.message.includes('insufficient funds for gas * price + value')) { errorCode = 'l_ci_h_pse_gas_low'; + errorReason = {message: "insufficient gas"} } - const receiptFailResponse =onReceiptFail(errorCode, reason, {}); + const receiptFailResponse =onReceiptFail(errorCode, errorReason, {}); if (isValueReturned == false) { isValueReturned = true; return onResolve(receiptFailResponse); From a9687f435b0b40fc632758a17804961e5745b2fe Mon Sep 17 00:00:00 2001 From: deepesh KN Date: Tue, 20 Mar 2018 16:28:20 +0530 Subject: [PATCH 013/115] Updated change logs --- CHANGELOG.md | 6 ++++++ package.json | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fe43bbb..ffc8ca7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## OpenST-Payments v1.0.4 + +Changelog: +- Changed error message when insufficient balance +- Changed error message when insufficient gas + ## OpenST-Payments v1.0.3 Changelog: diff --git a/package.json b/package.json index d5d8d44..2fbf948 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@openstfoundation/openst-payments", - "version": "1.0.3", + "version": "1.0.4", "description": "Payment infrastructure on top of the OpenST network.", "keywords": [ "openst", From 9ab3cfb932fcba5d0ed6ea670a32ebbd47522265 Mon Sep 17 00:00:00 2001 From: deepesh KN Date: Wed, 21 Mar 2018 19:02:01 +0530 Subject: [PATCH 014/115] Updated code for error message --- lib/contract_interact/helper.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/contract_interact/helper.js b/lib/contract_interact/helper.js index 6099411..2ee294e 100644 --- a/lib/contract_interact/helper.js +++ b/lib/contract_interact/helper.js @@ -509,13 +509,12 @@ ContractInteractHelper.prototype = { }); } else { - var errorReason = reason; var errorCode = 'l_ci_h_pse_2'; if (reason && reason.message && reason.message.includes('insufficient funds for gas * price + value')) { errorCode = 'l_ci_h_pse_gas_low'; - errorReason = {message: "insufficient gas"} + reason.message = "insufficient gas" } - const receiptFailResponse =onReceiptFail(errorCode, errorReason, {}); + const receiptFailResponse =onReceiptFail(errorCode, reason, {}); if (isValueReturned == false) { isValueReturned = true; return onResolve(receiptFailResponse); From 3ba6b6a028a320c2b738b04fd7d8031a66dc3c4c Mon Sep 17 00:00:00 2001 From: deepesh KN Date: Wed, 21 Mar 2018 19:23:43 +0530 Subject: [PATCH 015/115] Updated package.json and travis.yml --- .travis.yml | 3 ++- package.json | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index df3066b..99343a0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,7 @@ branches: only: - master - develop + - deepesh/geth_version_update notifications: email: recipients: @@ -23,7 +24,7 @@ before_install: - sudo apt-get install software-properties-common - sudo add-apt-repository -y ppa:ethereum/ethereum - sudo apt-get update - - sudo bash mocha_test/scripts/install_geth_1_7_3.sh + - sudo apt-get install ethereum - sudo apt-get install solc - geth version install: diff --git a/package.json b/package.json index 2fbf948..52c1245 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "mustache": "2.3.0", "mysql": "2.14.1", "shortid": "2.2.8", - "web3": "1.0.0-beta.26" + "web3": "1.0.0-beta.33" }, "devDependencies": { "abi-decoder": "1.0.9", From 1ced392329626168d711128386144d8b405ba9b2 Mon Sep 17 00:00:00 2001 From: deepesh KN Date: Wed, 21 Mar 2018 22:01:55 +0530 Subject: [PATCH 016/115] Version updated to 1.0.4-beta.1 --- .travis.yml | 1 - package.json | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 99343a0..bccdfeb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,6 @@ branches: only: - master - develop - - deepesh/geth_version_update notifications: email: recipients: diff --git a/package.json b/package.json index 52c1245..d321f96 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@openstfoundation/openst-payments", - "version": "1.0.4", + "version": "1.0.4-beta.1", "description": "Payment infrastructure on top of the OpenST network.", "keywords": [ "openst", From 9a3a77887551b85f3b11cc9941f84ab1c234e85c Mon Sep 17 00:00:00 2001 From: abhay-pepo Date: Thu, 22 Mar 2018 16:27:47 +0530 Subject: [PATCH 017/115] Validate if reserve has sufficient balance for transfer --- CHANGELOG.md | 5 +++++ VERSION | 2 +- lib/airdrop_management/transfer.js | 14 ++++++++++++++ package.json | 2 +- 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ffc8ca7..25654f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## OpenST-Payments v1.0.5 + +Changelog: +- while transferring from reserve to airdrop budget holder validate if reserve has sufficient balance. + ## OpenST-Payments v1.0.4 Changelog: diff --git a/VERSION b/VERSION index 7f20734..1464c52 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.0.1 \ No newline at end of file +1.0.5 \ No newline at end of file diff --git a/lib/airdrop_management/transfer.js b/lib/airdrop_management/transfer.js index aea672e..1a06dd1 100644 --- a/lib/airdrop_management/transfer.js +++ b/lib/airdrop_management/transfer.js @@ -15,6 +15,7 @@ const rootPrefix = '../..' , basicHelper = require(rootPrefix + '/helpers/basic_helper') , logger = require(rootPrefix + '/helpers/custom_console_logger') , AirdropModelCacheKlass = require(rootPrefix + '/lib/cache_management/airdrop_model') + , BrandedTokenKlass = require(rootPrefix + '/lib/contract_interact/branded_token') ; /** @@ -128,6 +129,19 @@ transfer.prototype = { return onResolve(responseHelper.error('l_am_v_vp_7', 'ChainId is invalid')); } + const brandedTokenObject = new BrandedTokenKlass(oThis.brandedTokenContractAddress, oThis.chainId); + const senderBalanceResponse = await brandedTokenObject.getBalanceOf(oThis.senderAddress); + + if (senderBalanceResponse.isFailure()) { + return onResolve(responseHelper.error('l_am_v_vp_8', 'Error while getting sender balance')); + } + + const senderBalance = new BigNumber(senderBalanceResponse.data.balance); + logger.info("senderBalance: "+senderBalance.toString(10), "amount to transfer: "+amountInBigNumber); + if (senderBalance.lt(amountInBigNumber)){ + return onResolve(responseHelper.error('l_am_v_vp_9', 'Sender balance: '+ senderBalance.toString(10) +' is not enough to transfer amount: '+amountInBigNumber.toString(10))); + } + return onResolve(responseHelper.successWithData({})); }); diff --git a/package.json b/package.json index d321f96..f4e45e4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@openstfoundation/openst-payments", - "version": "1.0.4-beta.1", + "version": "1.0.5", "description": "Payment infrastructure on top of the OpenST network.", "keywords": [ "openst", From 152f890657fe4c493b1be046443253789f017415 Mon Sep 17 00:00:00 2001 From: abhay-pepo Date: Thu, 22 Mar 2018 16:32:46 +0530 Subject: [PATCH 018/115] remove logger --- lib/airdrop_management/transfer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/airdrop_management/transfer.js b/lib/airdrop_management/transfer.js index 1a06dd1..a34483a 100644 --- a/lib/airdrop_management/transfer.js +++ b/lib/airdrop_management/transfer.js @@ -137,7 +137,7 @@ transfer.prototype = { } const senderBalance = new BigNumber(senderBalanceResponse.data.balance); - logger.info("senderBalance: "+senderBalance.toString(10), "amount to transfer: "+amountInBigNumber); + //logger.debug("senderBalance: "+senderBalance.toString(10), "amount to transfer: "+amountInBigNumber); if (senderBalance.lt(amountInBigNumber)){ return onResolve(responseHelper.error('l_am_v_vp_9', 'Sender balance: '+ senderBalance.toString(10) +' is not enough to transfer amount: '+amountInBigNumber.toString(10))); } From 98eff80559b64819273157888f319076b07c4cb4 Mon Sep 17 00:00:00 2001 From: abhay-pepo Date: Thu, 22 Mar 2018 16:43:50 +0530 Subject: [PATCH 019/115] Update version, changelog and package.json --- CHANGELOG.md | 3 ++- VERSION | 2 +- package.json | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 25654f4..b67bf0c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ -## OpenST-Payments v1.0.5 +## OpenST-Payments 1.0.4.beta.2 Changelog: +- Upgrade Geth and Web3 version - while transferring from reserve to airdrop budget holder validate if reserve has sufficient balance. ## OpenST-Payments v1.0.4 diff --git a/VERSION b/VERSION index 1464c52..a6a3a43 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.0.5 \ No newline at end of file +1.0.4 \ No newline at end of file diff --git a/package.json b/package.json index f4e45e4..929089f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@openstfoundation/openst-payments", - "version": "1.0.5", + "version": "1.0.4.beta.2", "description": "Payment infrastructure on top of the OpenST network.", "keywords": [ "openst", From 35b3572e7ffbb3fb90ade4cf3ea275300672cc70 Mon Sep 17 00:00:00 2001 From: abhay-pepo Date: Thu, 22 Mar 2018 17:12:49 +0530 Subject: [PATCH 020/115] correct version updated --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 929089f..c5dd35b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@openstfoundation/openst-payments", - "version": "1.0.4.beta.2", + "version": "1.0.4-beta.2", "description": "Payment infrastructure on top of the OpenST network.", "keywords": [ "openst", From 5a9bfe05c8d0a363b2e13202ecab0945c8a5bf27 Mon Sep 17 00:00:00 2001 From: abhay-pepo Date: Mon, 26 Mar 2018 18:48:36 +0530 Subject: [PATCH 021/115] deployer moved as services --- index.js | 10 +- lib/airdrop_management/approve.js | 6 +- lib/airdrop_management/base.js | 6 +- lib/airdrop_management/batch_allocator.js | 6 +- lib/airdrop_management/register.js | 6 +- lib/airdrop_management/transfer.js | 6 +- lib/set_worker_and_ops.js | 16 +-- mocha_test/scripts/deploy_all.sh | 32 ++--- mocha_test/services/airdrop/pay.js | 3 +- {lib => services}/deployer.js | 149 +++++++++++----------- tools/deploy/EIP20TokenMock.js | 38 +++--- tools/deploy/airdrop.js | 42 +++--- tools/deploy/helper.js | 1 + tools/deploy/pricer.js | 36 +++--- tools/deploy/workers.js | 24 ++-- 15 files changed, 197 insertions(+), 184 deletions(-) rename {lib => services}/deployer.js (65%) diff --git a/index.js b/index.js index 9f0ac20..2eb25dc 100644 --- a/index.js +++ b/index.js @@ -1,16 +1,16 @@ +"use strict"; + /** * Index File of "@openstfoundation/openst-payments" node module */ -"use strict"; - const rootPrefix = "." , version = require(rootPrefix + '/package.json').version - , deployer = require(rootPrefix + '/lib/deployer') + , deployer = require(rootPrefix + '/services/deployer') , workers = require(rootPrefix + '/lib/contract_interact/workers') , airdrop = require(rootPrefix + '/lib/contract_interact/airdrop') , opsManaged = require(rootPrefix + "/lib/contract_interact/ops_managed_contract") - , airdropManager = require(rootPrefix + "/lib/airdrop_management/base") + , airdropManagerKlass = require(rootPrefix + "/lib/airdrop_management/base") ; const OSTPayment = function () { @@ -21,7 +21,7 @@ const OSTPayment = function () { oThis.opsManaged = opsManaged; oThis.workers = workers; oThis.airdrop = airdrop; - oThis.airdropManager = airdropManager; + oThis.airdropManager = airdropManagerKlass; }; module.exports = new OSTPayment(); \ No newline at end of file diff --git a/lib/airdrop_management/approve.js b/lib/airdrop_management/approve.js index e2de9c0..71b197e 100644 --- a/lib/airdrop_management/approve.js +++ b/lib/airdrop_management/approve.js @@ -30,7 +30,7 @@ const rootPrefix = '../..' * @return {Object} * */ -const approve = module.exports = function(params) { +const ApproveKlass = function(params) { logger.debug("=========Approve.params========="); logger.debug(params.airdropContractAddress, params.gasPrice, params.chainId, params.options); const oThis = this; @@ -46,7 +46,7 @@ const approve = module.exports = function(params) { oThis.brandedTokenObject = null; }; -approve.prototype = { +ApproveKlass.prototype = { /** * Perform approve by airdrop budget holder to contract @@ -151,4 +151,4 @@ approve.prototype = { }; -module.exports = approve; \ No newline at end of file +module.exports = ApproveKlass; \ No newline at end of file diff --git a/lib/airdrop_management/base.js b/lib/airdrop_management/base.js index f155a54..8b6eb65 100644 --- a/lib/airdrop_management/base.js +++ b/lib/airdrop_management/base.js @@ -19,9 +19,9 @@ const rootPrefix = '../..' * @constructor * */ -const base = module.exports = function() {}; +const BaseKlass = function() {}; -base.prototype = { +BaseKlass.prototype = { /** * Register Airdrop @@ -144,5 +144,5 @@ base.prototype = { }; -module.exports = new base(); +module.exports = BaseKlass; diff --git a/lib/airdrop_management/batch_allocator.js b/lib/airdrop_management/batch_allocator.js index cda0165..113959a 100644 --- a/lib/airdrop_management/batch_allocator.js +++ b/lib/airdrop_management/batch_allocator.js @@ -30,7 +30,7 @@ const rootPrefix = '../..' * * @return {Object} */ -const batchAllocator = module.exports = function(params) { +const BatchAllocatorKlass = function(params) { logger.debug("\n=========batchAllocator.params========="); logger.debug(params); const oThis = this; @@ -49,7 +49,7 @@ const batchAllocator = module.exports = function(params) { oThis.userAddresses = []; }; -batchAllocator.prototype = { +BatchAllocatorKlass.prototype = { /** * Perform batch allocation to airdrop users @@ -230,4 +230,4 @@ batchAllocator.prototype = { }; -module.exports = batchAllocator; \ No newline at end of file +module.exports = BatchAllocatorKlass; \ No newline at end of file diff --git a/lib/airdrop_management/register.js b/lib/airdrop_management/register.js index e2414f8..3a91030 100644 --- a/lib/airdrop_management/register.js +++ b/lib/airdrop_management/register.js @@ -26,7 +26,7 @@ const rootPrefix = '../..' * @return {Object} * */ -const register = module.exports = function (params) { +const RegisterKlass = function (params) { logger.debug("=======register.params======="); logger.debug(params); this.airdropContractAddress = params.airdropContractAddress; @@ -34,7 +34,7 @@ const register = module.exports = function (params) { }; -register.prototype = { +RegisterKlass.prototype = { /** * Perform method @@ -132,5 +132,5 @@ register.prototype = { }; -module.exports = register; +module.exports = RegisterKlass; diff --git a/lib/airdrop_management/transfer.js b/lib/airdrop_management/transfer.js index a34483a..8b500f5 100644 --- a/lib/airdrop_management/transfer.js +++ b/lib/airdrop_management/transfer.js @@ -34,7 +34,7 @@ const rootPrefix = '../..' * @return {Object} * */ -const transfer = module.exports = function(params) { +const TransferKlass = function(params) { logger.debug("\n=========Transfer params========="); logger.debug(params); const oThis = this; @@ -51,7 +51,7 @@ const transfer = module.exports = function(params) { }; -transfer.prototype = { +TransferKlass.prototype = { /** * Perform method @@ -181,5 +181,5 @@ transfer.prototype = { }; -module.exports = transfer; +module.exports = TransferKlass; diff --git a/lib/set_worker_and_ops.js b/lib/set_worker_and_ops.js index fdee9f5..509c0be 100644 --- a/lib/set_worker_and_ops.js +++ b/lib/set_worker_and_ops.js @@ -8,7 +8,7 @@ const rootPrefix = ".." , OpsManagedContract = require(rootPrefix + "/lib/contract_interact/ops_managed_contract") , logger = require(rootPrefix + '/helpers/custom_console_logger') - , Deployer = require(rootPrefix + '/lib/deployer') + , Deployer = require(rootPrefix + '/services/deployer') , returnTypes = require(rootPrefix + "/lib/global_constant/return_types") , coreAddresses = require(rootPrefix + '/config/core_addresses') , responseHelper = require(rootPrefix + '/lib/formatter/response') @@ -49,19 +49,19 @@ SetWorkerOps.prototype = { , gasPrice = (options || {}).gasPrice , chainId = (options || {}).chainId , constructorArgs = [] - , deployerInstance = new Deployer() , deployOptions = {returnType: returnTypes.transactionReceipt()} - ; + ; + const deployerInstance = new Deployer({ + contract_name: contractName, + constructor_args: constructorArgs, + gas_price: gasPrice, + options: deployOptions}); if(!gasPrice || !chainId){ return Promise.resolve(responseHelper.error("l_swao_2", "Gas price and Chain Id are mandatory")); } - const deployResult = await deployerInstance.deploy( - contractName, - constructorArgs, - gasPrice, - deployOptions); + const deployResult = await deployerInstance.perform(); if (deployResult.isSuccess()) { const contractAddress = deployResult.data.transaction_receipt.contractAddress; diff --git a/mocha_test/scripts/deploy_all.sh b/mocha_test/scripts/deploy_all.sh index 822d059..7475a23 100644 --- a/mocha_test/scripts/deploy_all.sh +++ b/mocha_test/scripts/deploy_all.sh @@ -6,57 +6,57 @@ sh ../contracts/compile.sh echo "\n********* Deploying test coin 1 *************" node ../tools/deploy/EIP20TokenMock.js 5 TC1 TestCoin1 18 0x12A05F200 travis tc1.txt -export OST_UTILITY_TEST_COIN1_C5_ADDRESS=$(cat ../lib/tc1.txt) +export OST_UTILITY_TEST_COIN1_C5_ADDRESS=$(cat ../tools/deploy/tc1.txt) echo '\nexport OST_UTILITY_TEST_COIN1_C5_ADDRESS='\'$OST_UTILITY_TEST_COIN1_C5_ADDRESS\'>>scripts/env_vars.sh -rm ../lib/tc1.txt +rm ../tools/deploy/tc1.txt echo "\n********* Done *************" echo "\n********* Deploying test coin 2 *************" . ./scripts/env_vars.sh node ../tools/deploy/EIP20TokenMock.js 2 TC2 TestCoin2 18 0x12A05F200 travis tc2.txt -export OST_UTILITY_TEST_COIN2_C2_ADDRESS=$(cat ../lib/tc2.txt) +export OST_UTILITY_TEST_COIN2_C2_ADDRESS=$(cat ../tools/deploy/tc2.txt) echo '\nexport OST_UTILITY_TEST_COIN2_C2_ADDRESS='\'$OST_UTILITY_TEST_COIN2_C2_ADDRESS\'>>scripts/env_vars.sh -rm ../lib/tc2.txt +rm ../tools/deploy/tc2.txt echo "\n********* Done *************" echo "\n********* Deploying test coin 3 *************" . ./scripts/env_vars.sh node ../tools/deploy/EIP20TokenMock.js 3 TC3 TestCoin3 10 0x12A05F200 travis tc3.txt -export OST_UTILITY_TEST_COIN3_C3_ADDRESS=$(cat ../lib/tc3.txt) +export OST_UTILITY_TEST_COIN3_C3_ADDRESS=$(cat ../tools/deploy/tc3.txt) echo '\nexport OST_UTILITY_TEST_COIN3_C3_ADDRESS='\'$OST_UTILITY_TEST_COIN3_C3_ADDRESS\'>>scripts/env_vars.sh -rm ../lib/tc3.txt +rm ../tools/deploy/tc3.txt echo "\n********* Done *************" echo "\n********* Deploying Pricer 1 *************" . ./scripts/env_vars.sh node ../tools/deploy/pricer.js $OST_UTILITY_TEST_COIN1_C5_ADDRESS OST 0x12A05F200 $OST_UTILITY_CHAIN_ID travis tp1.txt -export OST_UTILITY_TEST_PRICER_C5_ADDRESS=$(cat ../lib/tp1.txt) +export OST_UTILITY_TEST_PRICER_C5_ADDRESS=$(cat ../tools/deploy/tp1.txt) echo '\nexport OST_UTILITY_TEST_PRICER_C5_ADDRESS='\'$OST_UTILITY_TEST_PRICER_C5_ADDRESS\'>>scripts/env_vars.sh -rm ../lib/tp1.txt +rm ../tools/deploy/tp1.txt echo "\n********* Done *************" echo "\n********* Deploying Pricer 2 *************" . ./scripts/env_vars.sh node ../tools/deploy/pricer.js $OST_UTILITY_TEST_COIN2_C2_ADDRESS OST 0x12A05F200 $OST_UTILITY_CHAIN_ID travis tp2.txt -export OST_UTILITY_TEST_PRICER_C2_ADDRESS=$(cat ../lib/tp2.txt) +export OST_UTILITY_TEST_PRICER_C2_ADDRESS=$(cat ../tools/deploy/tp2.txt) echo '\nexport OST_UTILITY_TEST_PRICER_C2_ADDRESS='\'$OST_UTILITY_TEST_PRICER_C2_ADDRESS\'>>scripts/env_vars.sh -rm ../lib/tp2.txt +rm ../tools/deploy/tp2.txt echo "\n********* Done *************" echo "\n********* Deploying Pricer 3 *************" . ./scripts/env_vars.sh node ../tools/deploy/pricer.js $OST_UTILITY_TEST_COIN3_C3_ADDRESS OST 0x12A05F200 $OST_UTILITY_CHAIN_ID travis tp3.txt -export OST_UTILITY_TEST_PRICER_C3_ADDRESS=$(cat ../lib/tp3.txt) +export OST_UTILITY_TEST_PRICER_C3_ADDRESS=$(cat ../tools/deploy/tp3.txt) echo '\nexport OST_UTILITY_TEST_PRICER_C3_ADDRESS='\'$OST_UTILITY_TEST_PRICER_C3_ADDRESS\'>>scripts/env_vars.sh -rm ../lib/tp3.txt +rm ../tools/deploy/tp3.txt echo "\n********* Done *************" echo "\n********* Deploying Worker Contract Address *************" node ../tools/deploy/workers.js 0x12A05F200 $OST_UTILITY_CHAIN_ID travis w1.txt -export OST_UTILITY_WORKER_CONTRACT_ADDRESS=$(cat ../lib/w1.txt) +export OST_UTILITY_WORKER_CONTRACT_ADDRESS=$(cat ../tools/deploy/w1.txt) echo '\nexport OST_UTILITY_WORKER_CONTRACT_ADDRESS='\'$OST_UTILITY_WORKER_CONTRACT_ADDRESS\'>>scripts/env_vars.sh -rm ../lib/w1.txt +rm ../tools/deploy/w1.txt echo "\n********* Done *************" echo "\n Sourcing env_vars again" @@ -65,9 +65,9 @@ echo "\n Sourcing env_vars again" echo "\n********* Deploying Airdrop Contract Address *************" . ./scripts/env_vars.sh node ../tools/deploy/airdrop.js $OST_UTILITY_TEST_COIN1_C5_ADDRESS OST $OST_UTILITY_WORKER_CONTRACT_ADDRESS $OST_AIRDROP_BUDGET_HOLDER 0x12A05F200 $OST_UTILITY_CHAIN_ID travis ad1.txt -export OST_UTILITY_TEST_AIRDROP1_CONTRACT_ADDRESS=$(cat ../lib/ad1.txt) +export OST_UTILITY_TEST_AIRDROP1_CONTRACT_ADDRESS=$(cat ../tools/deploy/ad1.txt) echo '\nexport OST_UTILITY_TEST_AIRDROP1_CONTRACT_ADDRESS='\'$OST_UTILITY_TEST_AIRDROP1_CONTRACT_ADDRESS\'>>scripts/env_vars.sh -rm ../lib/ad1.txt +rm ../tools/deploy/ad1.txt echo "\n********* Done *************" diff --git a/mocha_test/services/airdrop/pay.js b/mocha_test/services/airdrop/pay.js index 8cde883..4e37195 100644 --- a/mocha_test/services/airdrop/pay.js +++ b/mocha_test/services/airdrop/pay.js @@ -23,7 +23,8 @@ const workersContract = new workers(constants.workersContractAddress, constants. const AirdropModelCacheKlass = require(rootPrefix + '/lib/cache_management/airdrop_model') - , airdropManager = require(rootPrefix + '/lib/airdrop_management/base') + , airdropManagerKlass = require(rootPrefix + '/lib/airdrop_management/base') + , airdropManager = new airdropManagerKlass() , airdropAllocationProofDetailKlass = require(rootPrefix + '/app/models/airdrop_allocation_proof_detail') , UserAirdropDetailKlass = require(rootPrefix + '/app/models/user_airdrop_detail') , responseHelper = require(rootPrefix + '/lib/formatter/response') diff --git a/lib/deployer.js b/services/deployer.js similarity index 65% rename from lib/deployer.js rename to services/deployer.js index 49bfc82..05d3439 100644 --- a/lib/deployer.js +++ b/services/deployer.js @@ -1,58 +1,86 @@ +"use strict"; + /** * This is script for deploying any contract.

* - * Prerequisite: - *
    - *
  1. Deployer Address
  2. - *
- * + * @module services/deployer + */ + +const uuid = require('uuid') + , rootPrefix = '..' + , web3Provider = require(rootPrefix + '/lib/web3/providers/rpc') + , coreConstants = require(rootPrefix + '/config/core_constants') + , coreAddresses = require(rootPrefix + '/config/core_addresses') + , logger = require(rootPrefix + '/helpers/custom_console_logger') + , responseHelper = require(rootPrefix + '/lib/formatter/response') + , basicHelper = require(rootPrefix + '/helpers/basic_helper') + , deployerName = 'deployer' +; + +/** + * Constructor to create object of deployer * + * @param {String} contract_name - name of contract + * @param {Object} constructor_args - contract deployment constructor arguments + * @param {String} gas_price - gas price + * @param {Object} options - deployment options * + * @constructor * - * @module lib/deployer */ +const DeployerKlass = function(params) { + logger.debug("\n=========deployer params========="); + logger.debug(params); + const oThis = this; + + oThis.contractName = params.contract_name; + oThis.constructorArgs = params.constructor_args; + oThis.gasPrice = params.gas_price; + oThis.options = params.options; +}; -const uuid = require('uuid'); -const fs = require('fs'); -const Path = require('path'); +DeployerKlass.prototype = { -const rootPrefix = '..'; -const web3Provider = require(rootPrefix + '/lib/web3/providers/rpc'); -const coreConstants = require(rootPrefix + '/config/core_constants'); -const coreAddresses = require(rootPrefix + '/config/core_addresses'); -const logger = require(rootPrefix + '/helpers/custom_console_logger'); -const responseHelper = require(rootPrefix + '/lib/formatter/response'); -const basicHelper = require(rootPrefix + '/helpers/basic_helper'); + /** + * Perform method + * + * @return {promise} - returns a promise which resolves to an object of kind Result + * + */ + perform: async function () { -const deployerName = 'deployer'; + const oThis = this; -/** - * @constructor - * - */ -const Deploy = module.exports = function () {}; + var r = null; + + r = await oThis.validateParams(); + logger.debug("\n=========Deployer.validateParams.result========="); + logger.debug(r); + if(r.isFailure()) return r; -Deploy.prototype = { + r = oThis.deploy(); + logger.debug("\n=========Deployer.deploy.result========="); + logger.debug(r); + return r; + + }, /** * Validate deploy parameters * - * @param {string} contractName - Contract name - * @param {BigNumber} gasPrice - Gas price - * - * @return {response} + * @return {result} - returns object of kind Result * */ - validateDeployParams: function( - contractName, - gasPrice) { + validateParams: function() { + + const oThis = this; - if (!contractName) { + if (!oThis.contractName) { logger.error("Error: Contract name is mandatory"); return responseHelper.error('l_d_1', 'Contract name is mandatory'); } - if (!gasPrice) { + if (!oThis.gasPrice) { logger.error("Error: Gas price is mandatory"); return responseHelper.error('l_d_2', 'Gas price is mandatory'); } @@ -76,56 +104,39 @@ Deploy.prototype = { /** * Deploy contract * - * @param {string} contractName - Contract name - pricer / airdrop / workers - * @param {Array} constructorArgs - Contract constructor params - * @param {BigNumber} gasPrice - Gas price - * @param {object} options - for params like returnType, tag. - * - * @return {response} + * @return {promise} - returns a promise which resolves to an object of kind Result * */ - deploy: function( - contractName, - constructorArgs, - gasPrice, - options) { + deploy: function() { const oThis = this; return new Promise(function (onResolve, onReject) { - logger.debug("Contract name: " + contractName); - logger.debug("Gas price: " + gasPrice); - logger.debug("Constructor arguments: " + constructorArgs); - - const validationResult = oThis.validateDeployParams( - contractName, - gasPrice); - - if (validationResult.isFailure()) { - return onResolve(validationResult); - } + logger.debug("Contract name: " + oThis.contractName); + logger.debug("Gas price: " + oThis.gasPrice); + logger.debug("Constructor arguments: " + oThis.constructorArgs); const txUUID = uuid.v4(); - const returnType = basicHelper.getReturnType(options.returnType); + const returnType = basicHelper.getReturnType(oThis.options.returnType); const asyncPerform = function () { const deployerAddress = coreAddresses.getAddressForUser(deployerName); const deployerAddrPassphrase = coreAddresses.getPassphraseForUser(deployerName); - const contractAbi = coreAddresses.getAbiForContract(contractName); - const contractBin = coreAddresses.getBinForContract(contractName); + const contractAbi = coreAddresses.getAbiForContract(oThis.contractName); + const contractBin = coreAddresses.getBinForContract(oThis.contractName); const txParams = { from: deployerAddress, data: (web3Provider.utils.isHexStrict(contractBin) ? "" : "0x") + contractBin, - gasPrice: gasPrice, + gasPrice: oThis.gasPrice, gas: coreConstants.OST_GAS_LIMIT }; - if (constructorArgs) { - txParams.arguments = constructorArgs; + if (oThis.constructorArgs) { + txParams.arguments = oThis.constructorArgs; } var contract = new web3Provider.eth.Contract( @@ -209,21 +220,9 @@ Deploy.prototype = { } }); - }, - - /** - * Write contract address to file based on parameter - * - * @param {String} fileName - file name - * @param {Hex} contractAddress - contract Address - * - * @return {} - */ - writeContractAddressToFile: function(fileName, contractAddress) { - // Write contract address to file - if ( fileName !== '') { - fs.writeFileSync(Path.join(__dirname, '/' + fileName), contractAddress); - } } + }; +module.exports = DeployerKlass; + diff --git a/tools/deploy/EIP20TokenMock.js b/tools/deploy/EIP20TokenMock.js index aeae046..58a16c8 100644 --- a/tools/deploy/EIP20TokenMock.js +++ b/tools/deploy/EIP20TokenMock.js @@ -1,3 +1,5 @@ +"use strict"; + /** * This is script for deploying Pricer contract on any chain.

* @@ -10,13 +12,14 @@ * @module tools/deploy/EIP20TokenMock */ -const readline = require('readline'); -const rootPrefix = '../..'; -const prompts = readline.createInterface(process.stdin, process.stdout); -const logger = require(rootPrefix + '/helpers/custom_console_logger'); -const Deployer = require(rootPrefix + '/lib/deployer'); -const coreConstants = require(rootPrefix + '/config/core_constants'); -const BigNumber = require('bignumber.js'); +const readline = require('readline') + , rootPrefix = '../..' + , prompts = readline.createInterface(process.stdin, process.stdout) + , logger = require(rootPrefix + '/helpers/custom_console_logger') + , Deployer = require(rootPrefix + '/services/deployer') + , BigNumber = require('bignumber.js') + , helper = require(rootPrefix + "/tools/deploy/helper") +; /** * It is the main performer method of this deployment script @@ -88,7 +91,9 @@ async function performer(argv) { prompts.close(); } - const contractName = 'eip20tokenmock'; + const contractName = 'eip20tokenmock' + , options = {returnType: "txReceipt"} + ; var constructorArgs = [ conversionRate, @@ -98,21 +103,20 @@ async function performer(argv) { decimals ]; - const options = {returnType: "txReceipt"}; - - const deployerInstance = new Deployer(); + const deployerInstance = new Deployer({ + contract_name: contractName, + constructor_args: constructorArgs, + gas_price: gasPrice, + options: options + }); - const deployResult = await deployerInstance.deploy( - contractName, - constructorArgs, - gasPrice, - options); + const deployResult = await deployerInstance.perform(); if (deployResult.isSuccess()) { const contractAddress = deployResult.data.transaction_receipt.contractAddress; logger.win("contractAddress: " + contractAddress); if (fileForContractAddress !== '') { - deployerInstance.writeContractAddressToFile(fileForContractAddress, contractAddress); + await helper.writeContractAddressToFile(fileForContractAddress, contractAddress); } } } diff --git a/tools/deploy/airdrop.js b/tools/deploy/airdrop.js index a9005a6..050a5a6 100644 --- a/tools/deploy/airdrop.js +++ b/tools/deploy/airdrop.js @@ -1,3 +1,5 @@ +"use strict"; + /** * This is script for deploying Pricer contract on any chain.

* @@ -15,16 +17,17 @@ * @module tools/deploy/pricer */ -const readline = require('readline'); -const rootPrefix = '../..'; -const web3Provider = require(rootPrefix + '/lib/web3/providers/rpc'); -const Deployer = require(rootPrefix + '/lib/deployer'); -const coreConstants = require(rootPrefix + '/config/core_constants'); -const coreAddresses = require(rootPrefix + '/config/core_addresses'); -const prompts = readline.createInterface(process.stdin, process.stdout); -const logger = require(rootPrefix + '/helpers/custom_console_logger'); -const OpsManagedContract = require(rootPrefix + "/lib/contract_interact/ops_managed_contract"); -const returnTypes = require(rootPrefix + "/lib/global_constant/return_types"); +const readline = require('readline') + , rootPrefix = '../..' + , web3Provider = require(rootPrefix + '/lib/web3/providers/rpc') + , Deployer = require(rootPrefix + '/services/deployer') + , coreAddresses = require(rootPrefix + '/config/core_addresses') + , prompts = readline.createInterface(process.stdin, process.stdout) + , logger = require(rootPrefix + '/helpers/custom_console_logger') + , OpsManagedContract = require(rootPrefix + "/lib/contract_interact/ops_managed_contract") + , returnTypes = require(rootPrefix + "/lib/global_constant/return_types") + , helper = require(rootPrefix + "/tools/deploy/helper") +; // Different addresses used for deployment const deployerName = "deployer" @@ -123,27 +126,28 @@ async function performer(argv) { } const contractName = 'airdrop' - , deployerInstance = new Deployer() + , deployOptions = {returnType: returnTypes.transactionReceipt()} ; - const constructorArgs = [ brandedTokenAddress, web3Provider.utils.asciiToHex(baseCurrency), workerContractAddress, airdropBudgetHolder ]; - const deployOptions = {returnType: returnTypes.transactionReceipt()}; - const deployResult = await deployerInstance.deploy( - contractName, - constructorArgs, - gasPrice, - deployOptions); + + const deployerInstance = new Deployer({ + contract_name: contractName, + constructor_args: constructorArgs, + gas_price: gasPrice, + options: deployOptions + }); + const deployResult = await deployerInstance.perform(); if (deployResult.isSuccess()) { const contractAddress = deployResult.data.transaction_receipt.contractAddress; logger.win("contractAddress: " + contractAddress); if (fileForContractAddress !== '') { - deployerInstance.writeContractAddressToFile(fileForContractAddress, contractAddress); + helper.writeContractAddressToFile(fileForContractAddress, contractAddress); } logger.debug("Setting Ops Address to: " + opsAddress); diff --git a/tools/deploy/helper.js b/tools/deploy/helper.js index 06d0da7..1065ad3 100644 --- a/tools/deploy/helper.js +++ b/tools/deploy/helper.js @@ -206,6 +206,7 @@ const deployHelper = { writeContractAddressToFile: function(fileName, contractAddress) { // Write contract address to file if ( fileName !== '') { + logger.debug("Writing to file: ", fileName, "contract address: ", contractAddress); fs.writeFileSync(Path.join(__dirname, '/' + fileName), contractAddress); } } diff --git a/tools/deploy/pricer.js b/tools/deploy/pricer.js index 1407d34..b34b538 100644 --- a/tools/deploy/pricer.js +++ b/tools/deploy/pricer.js @@ -15,16 +15,17 @@ * @module tools/deploy/pricer */ -const readline = require('readline'); -const rootPrefix = '../..'; -const web3Provider = require(rootPrefix + '/lib/web3/providers/rpc'); -const prompts = readline.createInterface(process.stdin, process.stdout); -const logger = require(rootPrefix + '/helpers/custom_console_logger'); -const OpsManagedContract = require(rootPrefix + "/lib/contract_interact/ops_managed_contract"); -const Deployer = require(rootPrefix + '/lib/deployer'); -const coreAddresses = require(rootPrefix + '/config/core_addresses'); -const coreConstants = require(rootPrefix + '/config/core_constants'); -const returnTypes = require(rootPrefix + "/lib/global_constant/return_types"); +const readline = require('readline') + , rootPrefix = '../..' + , web3Provider = require(rootPrefix + '/lib/web3/providers/rpc') + , prompts = readline.createInterface(process.stdin, process.stdout) + , logger = require(rootPrefix + '/helpers/custom_console_logger') + , OpsManagedContract = require(rootPrefix + "/lib/contract_interact/ops_managed_contract") + , Deployer = require(rootPrefix + '/services/deployer') + , coreAddresses = require(rootPrefix + '/config/core_addresses') + , returnTypes = require(rootPrefix + "/lib/global_constant/return_types") + , helper = require(rootPrefix + "/tools/deploy/helper") +; // Different addresses used for deployment const deployerName = "deployer" @@ -125,22 +126,23 @@ async function performer(argv) { ]; const contractName = 'pricer' - , deployerInstance = new Deployer() , deployOptions = {returnType: returnTypes.transactionReceipt()}; ; - const deployResult = await deployerInstance.deploy( - contractName, - constructorArgs, - gasPrice, - deployOptions); + const deployerInstance = new Deployer({ + contract_name: contractName, + constructor_args: constructorArgs, + gas_price: gasPrice, + options: deployOptions + }); + const deployResult = await deployerInstance.perform(); if (deployResult.isSuccess()) { const contractAddress = deployResult.data.transaction_receipt.contractAddress; logger.win("contractAddress: " + contractAddress); if (fileForContractAddress !== '') { - deployerInstance.writeContractAddressToFile(fileForContractAddress, contractAddress); + helper.writeContractAddressToFile(fileForContractAddress, contractAddress); } logger.debug("Setting Ops Address to: " + opsAddress); diff --git a/tools/deploy/workers.js b/tools/deploy/workers.js index dd3444d..7930c13 100644 --- a/tools/deploy/workers.js +++ b/tools/deploy/workers.js @@ -1,3 +1,5 @@ +"use strict"; + /** * This is script for deploying Workers contract on any chain.

* @@ -15,14 +17,15 @@ * @module tools/deploy/workers */ -const readline = require('readline'); -const rootPrefix = '../..'; -const prompts = readline.createInterface(process.stdin, process.stdout); -const logger = require(rootPrefix + '/helpers/custom_console_logger'); -const Deployer = require(rootPrefix + '/lib/deployer'); -const SetWorkerAndOpsKlass = require(rootPrefix + '/lib/set_worker_and_ops') - , setWorkerOps = new SetWorkerAndOpsKlass(); - +const readline = require('readline') + , rootPrefix = '../..' + , prompts = readline.createInterface(process.stdin, process.stdout) + , logger = require(rootPrefix + '/helpers/custom_console_logger') + , Deployer = require(rootPrefix + '/services/deployer') + , helper = require(rootPrefix + "/tools/deploy/helper") + , SetWorkerAndOpsKlass = require(rootPrefix + '/lib/set_worker_and_ops') + , setWorkerOps = new SetWorkerAndOpsKlass() +; /** * It is the main performer method of this deployment script @@ -80,13 +83,12 @@ async function performer(argv) { var response = await setWorkerOps.perform({gasPrice: gasPrice, chainId: chainId}); logger.debug("**** Deployment Response", response); if (response.isSuccess() && fileForContractAddress !== '') { - var deployerInstance = new Deployer(); - deployerInstance.writeContractAddressToFile(fileForContractAddress, response.data.workerContractAddress); + helper.writeContractAddressToFile(fileForContractAddress, response.data.workerContractAddress); } process.exit(0); } -// node tools/deploy/worker.js gasPrice chainId +// node tools/deploy/workers.js gasPrice chainId performer(process.argv); From f1f64644034c4a8bc7339bd4b38b2234fd73afac Mon Sep 17 00:00:00 2001 From: abhay-pepo Date: Mon, 26 Mar 2018 19:04:43 +0530 Subject: [PATCH 022/115] deployer moved to services/deploy --- index.js | 5 +++-- lib/set_worker_and_ops.js | 2 +- services/{ => deploy}/deployer.js | 0 tools/deploy/EIP20TokenMock.js | 2 +- tools/deploy/airdrop.js | 2 +- tools/deploy/pricer.js | 2 +- tools/deploy/workers.js | 1 - 7 files changed, 7 insertions(+), 7 deletions(-) rename services/{ => deploy}/deployer.js (100%) diff --git a/index.js b/index.js index 2eb25dc..b59f140 100644 --- a/index.js +++ b/index.js @@ -6,22 +6,23 @@ const rootPrefix = "." , version = require(rootPrefix + '/package.json').version - , deployer = require(rootPrefix + '/services/deployer') , workers = require(rootPrefix + '/lib/contract_interact/workers') , airdrop = require(rootPrefix + '/lib/contract_interact/airdrop') , opsManaged = require(rootPrefix + "/lib/contract_interact/ops_managed_contract") , airdropManagerKlass = require(rootPrefix + "/lib/airdrop_management/base") + , serviceManifest = require(rootPrefix + '/services/manifest') ; const OSTPayment = function () { const oThis = this; oThis.version = version; - oThis.deployer = deployer; oThis.opsManaged = opsManaged; oThis.workers = workers; oThis.airdrop = airdrop; oThis.airdropManager = airdropManagerKlass; + + oThis.services = serviceManifest; }; module.exports = new OSTPayment(); \ No newline at end of file diff --git a/lib/set_worker_and_ops.js b/lib/set_worker_and_ops.js index 509c0be..94b137b 100644 --- a/lib/set_worker_and_ops.js +++ b/lib/set_worker_and_ops.js @@ -8,7 +8,7 @@ const rootPrefix = ".." , OpsManagedContract = require(rootPrefix + "/lib/contract_interact/ops_managed_contract") , logger = require(rootPrefix + '/helpers/custom_console_logger') - , Deployer = require(rootPrefix + '/services/deployer') + , Deployer = require(rootPrefix + '/services/deploy/deployer') , returnTypes = require(rootPrefix + "/lib/global_constant/return_types") , coreAddresses = require(rootPrefix + '/config/core_addresses') , responseHelper = require(rootPrefix + '/lib/formatter/response') diff --git a/services/deployer.js b/services/deploy/deployer.js similarity index 100% rename from services/deployer.js rename to services/deploy/deployer.js diff --git a/tools/deploy/EIP20TokenMock.js b/tools/deploy/EIP20TokenMock.js index 58a16c8..6978c33 100644 --- a/tools/deploy/EIP20TokenMock.js +++ b/tools/deploy/EIP20TokenMock.js @@ -16,7 +16,7 @@ const readline = require('readline') , rootPrefix = '../..' , prompts = readline.createInterface(process.stdin, process.stdout) , logger = require(rootPrefix + '/helpers/custom_console_logger') - , Deployer = require(rootPrefix + '/services/deployer') + , Deployer = require(rootPrefix + '/services/deploy/deployer') , BigNumber = require('bignumber.js') , helper = require(rootPrefix + "/tools/deploy/helper") ; diff --git a/tools/deploy/airdrop.js b/tools/deploy/airdrop.js index 050a5a6..292e6ef 100644 --- a/tools/deploy/airdrop.js +++ b/tools/deploy/airdrop.js @@ -20,7 +20,7 @@ const readline = require('readline') , rootPrefix = '../..' , web3Provider = require(rootPrefix + '/lib/web3/providers/rpc') - , Deployer = require(rootPrefix + '/services/deployer') + , Deployer = require(rootPrefix + '/services/deploy/deployer') , coreAddresses = require(rootPrefix + '/config/core_addresses') , prompts = readline.createInterface(process.stdin, process.stdout) , logger = require(rootPrefix + '/helpers/custom_console_logger') diff --git a/tools/deploy/pricer.js b/tools/deploy/pricer.js index b34b538..149ded7 100644 --- a/tools/deploy/pricer.js +++ b/tools/deploy/pricer.js @@ -21,7 +21,7 @@ const readline = require('readline') , prompts = readline.createInterface(process.stdin, process.stdout) , logger = require(rootPrefix + '/helpers/custom_console_logger') , OpsManagedContract = require(rootPrefix + "/lib/contract_interact/ops_managed_contract") - , Deployer = require(rootPrefix + '/services/deployer') + , Deployer = require(rootPrefix + '/services/deploy/deployer') , coreAddresses = require(rootPrefix + '/config/core_addresses') , returnTypes = require(rootPrefix + "/lib/global_constant/return_types") , helper = require(rootPrefix + "/tools/deploy/helper") diff --git a/tools/deploy/workers.js b/tools/deploy/workers.js index 7930c13..4f714f8 100644 --- a/tools/deploy/workers.js +++ b/tools/deploy/workers.js @@ -21,7 +21,6 @@ const readline = require('readline') , rootPrefix = '../..' , prompts = readline.createInterface(process.stdin, process.stdout) , logger = require(rootPrefix + '/helpers/custom_console_logger') - , Deployer = require(rootPrefix + '/services/deployer') , helper = require(rootPrefix + "/tools/deploy/helper") , SetWorkerAndOpsKlass = require(rootPrefix + '/lib/set_worker_and_ops') , setWorkerOps = new SetWorkerAndOpsKlass() From 56356b10bcd707cb52a7b40899b7bef2a7161ef4 Mon Sep 17 00:00:00 2001 From: abhay-pepo Date: Mon, 26 Mar 2018 19:59:32 +0530 Subject: [PATCH 023/115] Airdrop Manager moved to manifest --- index.js | 8 --- lib/contract_interact/airdrop.js | 2 +- lib/transaction_helper.js | 2 +- mocha_test/services/airdrop/pay.js | 2 +- .../adjust_airdrop_amount.js | 0 .../airdrop_management/approve.js | 0 .../airdrop_management/base_old.js | 10 +-- .../airdrop_management/batch_allocator.js | 0 .../airdrop_management/register.js | 0 .../airdrop_management/transfer.js | 0 .../airdrop_management/user_balance.js | 0 services/deploy/deployer.js | 2 +- services/manifest.js | 67 +++++++++++++++++++ 13 files changed, 76 insertions(+), 17 deletions(-) rename {lib => services}/airdrop_management/adjust_airdrop_amount.js (100%) rename {lib => services}/airdrop_management/approve.js (100%) rename lib/airdrop_management/base.js => services/airdrop_management/base_old.js (91%) rename {lib => services}/airdrop_management/batch_allocator.js (100%) rename {lib => services}/airdrop_management/register.js (100%) rename {lib => services}/airdrop_management/transfer.js (100%) rename {lib => services}/airdrop_management/user_balance.js (100%) create mode 100644 services/manifest.js diff --git a/index.js b/index.js index b59f140..5a28327 100644 --- a/index.js +++ b/index.js @@ -6,10 +6,6 @@ const rootPrefix = "." , version = require(rootPrefix + '/package.json').version - , workers = require(rootPrefix + '/lib/contract_interact/workers') - , airdrop = require(rootPrefix + '/lib/contract_interact/airdrop') - , opsManaged = require(rootPrefix + "/lib/contract_interact/ops_managed_contract") - , airdropManagerKlass = require(rootPrefix + "/lib/airdrop_management/base") , serviceManifest = require(rootPrefix + '/services/manifest') ; @@ -17,10 +13,6 @@ const OSTPayment = function () { const oThis = this; oThis.version = version; - oThis.opsManaged = opsManaged; - oThis.workers = workers; - oThis.airdrop = airdrop; - oThis.airdropManager = airdropManagerKlass; oThis.services = serviceManifest; }; diff --git a/lib/contract_interact/airdrop.js b/lib/contract_interact/airdrop.js index 80e8dfb..d601664 100644 --- a/lib/contract_interact/airdrop.js +++ b/lib/contract_interact/airdrop.js @@ -21,7 +21,7 @@ const rootPrefix = '../..' , eventGlobalConstants = require(rootPrefix+'/lib/global_constant/events') , notificationGlobalConstant = require(rootPrefix + '/lib/global_constant/notification') , Pricer = require(rootPrefix + '/lib/contract_interact/pricer') - , AirdropUserBalanceKlass = require(rootPrefix + '/lib/airdrop_management/user_balance') + , AirdropUserBalanceKlass = require(rootPrefix + '/services/airdrop_management/user_balance') , AirdropCacheKlass = require(rootPrefix + '/lib/cache_management/airdrop') ; diff --git a/lib/transaction_helper.js b/lib/transaction_helper.js index b5d1e9e..b51750e 100644 --- a/lib/transaction_helper.js +++ b/lib/transaction_helper.js @@ -14,7 +14,7 @@ const rootPrefix = '..' , responseHelper = require(rootPrefix + '/lib/formatter/response') , Token = require(rootPrefix + '/lib/contract_interact/branded_token') , UserAirdropDetailCacheKlass = require(rootPrefix + '/lib/cache_multi_management/user_airdrop_detail') - , AdjustAirdropAmountKlass = require(rootPrefix + '/lib/airdrop_management/adjust_airdrop_amount') + , AdjustAirdropAmountKlass = require(rootPrefix + '/services/airdrop_management/adjust_airdrop_amount') , web3EventsDecoder = require(rootPrefix + '/lib/web3/events/decoder') , logger = require(rootPrefix + '/helpers/custom_console_logger') , eventGlobalConstants = require(rootPrefix+'/lib/global_constant/events') diff --git a/mocha_test/services/airdrop/pay.js b/mocha_test/services/airdrop/pay.js index 4e37195..468883d 100644 --- a/mocha_test/services/airdrop/pay.js +++ b/mocha_test/services/airdrop/pay.js @@ -23,7 +23,7 @@ const workersContract = new workers(constants.workersContractAddress, constants. const AirdropModelCacheKlass = require(rootPrefix + '/lib/cache_management/airdrop_model') - , airdropManagerKlass = require(rootPrefix + '/lib/airdrop_management/base') + , airdropManagerKlass = require(rootPrefix + '/services/airdrop_management/base') , airdropManager = new airdropManagerKlass() , airdropAllocationProofDetailKlass = require(rootPrefix + '/app/models/airdrop_allocation_proof_detail') , UserAirdropDetailKlass = require(rootPrefix + '/app/models/user_airdrop_detail') diff --git a/lib/airdrop_management/adjust_airdrop_amount.js b/services/airdrop_management/adjust_airdrop_amount.js similarity index 100% rename from lib/airdrop_management/adjust_airdrop_amount.js rename to services/airdrop_management/adjust_airdrop_amount.js diff --git a/lib/airdrop_management/approve.js b/services/airdrop_management/approve.js similarity index 100% rename from lib/airdrop_management/approve.js rename to services/airdrop_management/approve.js diff --git a/lib/airdrop_management/base.js b/services/airdrop_management/base_old.js similarity index 91% rename from lib/airdrop_management/base.js rename to services/airdrop_management/base_old.js index 8b6eb65..6a8f6b4 100644 --- a/lib/airdrop_management/base.js +++ b/services/airdrop_management/base_old.js @@ -6,11 +6,11 @@ * */ const rootPrefix = '../..' - , Register = require(rootPrefix + '/lib/airdrop_management/register') - , Transfer = require(rootPrefix + '/lib/airdrop_management/transfer') - , Approve = require(rootPrefix + '/lib/airdrop_management/approve') - , BatchAllocator = require(rootPrefix + '/lib/airdrop_management/batch_allocator') - , UserBalance = require(rootPrefix + '/lib/airdrop_management/user_balance') + , Register = require(rootPrefix + '/services/airdrop_management/register') + , Transfer = require(rootPrefix + '/services/airdrop_management/transfer') + , Approve = require(rootPrefix + '/services/airdrop_management/approve') + , BatchAllocator = require(rootPrefix + '/services/airdrop_management/batch_allocator') + , UserBalance = require(rootPrefix + '/services/airdrop_management/user_balance') ; /** diff --git a/lib/airdrop_management/batch_allocator.js b/services/airdrop_management/batch_allocator.js similarity index 100% rename from lib/airdrop_management/batch_allocator.js rename to services/airdrop_management/batch_allocator.js diff --git a/lib/airdrop_management/register.js b/services/airdrop_management/register.js similarity index 100% rename from lib/airdrop_management/register.js rename to services/airdrop_management/register.js diff --git a/lib/airdrop_management/transfer.js b/services/airdrop_management/transfer.js similarity index 100% rename from lib/airdrop_management/transfer.js rename to services/airdrop_management/transfer.js diff --git a/lib/airdrop_management/user_balance.js b/services/airdrop_management/user_balance.js similarity index 100% rename from lib/airdrop_management/user_balance.js rename to services/airdrop_management/user_balance.js diff --git a/services/deploy/deployer.js b/services/deploy/deployer.js index 05d3439..a17ea45 100644 --- a/services/deploy/deployer.js +++ b/services/deploy/deployer.js @@ -7,7 +7,7 @@ */ const uuid = require('uuid') - , rootPrefix = '..' + , rootPrefix = '../..' , web3Provider = require(rootPrefix + '/lib/web3/providers/rpc') , coreConstants = require(rootPrefix + '/config/core_constants') , coreAddresses = require(rootPrefix + '/config/core_addresses') diff --git a/services/manifest.js b/services/manifest.js new file mode 100644 index 0000000..cc7c897 --- /dev/null +++ b/services/manifest.js @@ -0,0 +1,67 @@ +"use strict"; + +/** + * Service manifest + * + * @module services/manifest + */ + +const rootPrefix = ".." + + , deployer = require(rootPrefix + '/services/deploy/deployer') + + , register = require(rootPrefix + '/services/airdrop_management/register') + , transfer = require(rootPrefix + '/services/airdrop_management/transfer') + , approve = require(rootPrefix + '/services/airdrop_management/approve') + , batchAllocator = require(rootPrefix + '/services/airdrop_management/batch_allocator') + , userBalance = require(rootPrefix + '/services/airdrop_management/user_balance') + + , workers = require(rootPrefix + '/lib/contract_interact/workers') + , airdrop = require(rootPrefix + '/lib/contract_interact/airdrop') + , opsManaged = require(rootPrefix + "/lib/contract_interact/ops_managed_contract") +; + +/** + * Service Manifest Constructor + * + * @constructor + */ +const ServiceManifestKlass = function() {}; + +ServiceManifestKlass.prototype = { + /** + * deploy any contract + * + * @constant {object} + */ + deploy: { + deployer: deployer + }, + + /** + * airdrop Manager + * + * @constant {object} + */ + airdropManager: { + registerAirdrop: register, + transfer: transfer, + approve: approve, + batchAllocator: batchAllocator, + userBalance: userBalance + }, + + /** + * Contract Interact related services + * + * @constant {object} + */ + contractInteract: { + workers: workers, + airdrop: airdrop, + opsManaged:opsManaged + }, + +}; + +module.exports = new ServiceManifestKlass(); \ No newline at end of file From b9960e0634c2c7631b8e930ed47cfaefc59520a7 Mon Sep 17 00:00:00 2001 From: abhay-pepo Date: Mon, 26 Mar 2018 20:40:15 +0530 Subject: [PATCH 024/115] airdrop management base not needed --- services/airdrop_management/base_old.js | 148 ------------------------ 1 file changed, 148 deletions(-) delete mode 100644 services/airdrop_management/base_old.js diff --git a/services/airdrop_management/base_old.js b/services/airdrop_management/base_old.js deleted file mode 100644 index 6a8f6b4..0000000 --- a/services/airdrop_management/base_old.js +++ /dev/null @@ -1,148 +0,0 @@ -/** - * - * This is a utility file which would be used for executing all methods related to airdrop.

- * - * @module lib/airdrop_management/base - * - */ -const rootPrefix = '../..' - , Register = require(rootPrefix + '/services/airdrop_management/register') - , Transfer = require(rootPrefix + '/services/airdrop_management/transfer') - , Approve = require(rootPrefix + '/services/airdrop_management/approve') - , BatchAllocator = require(rootPrefix + '/services/airdrop_management/batch_allocator') - , UserBalance = require(rootPrefix + '/services/airdrop_management/user_balance') -; - -/** - * Constructor to create object of base - * - * @constructor - * - */ -const BaseKlass = function() {}; - -BaseKlass.prototype = { - - /** - * Register Airdrop - * - * @param {Hex} airdropContractAddress - airdrop contract address - * @param {Number} chainId - chain Id - * - * @return {Promise} - * - */ - registerAirdrop: function(airdropContractAddress, chainId) { - return new Promise(async function (onResolve, onReject) { - - const registerAirdropObject = new Register({ - airdropContractAddress: airdropContractAddress, - chainId: chainId - }); - onResolve(registerAirdropObject.perform()); - - }); - - }, - - /** - * Transfer airdrop amount to airdrop budget holder - * - * @param {Hex} senderAddress - Sender Address - * @param {string} senderPassphrase - passphrase - * @param {Hex} airdropContractAddress - airdrop contract address - * @param {BigNumber} amount - amount to transfer - * @param {Hex} gasPrice - gasPrice - * @param {Number} chainId - chainId - * @param {Object} options - options e.g. {returnType: '', tag: ''} - * - * @return {Promise} - * - */ - transfer: function (senderAddress, senderPassphrase, airdropContractAddress, amount, gasPrice, chainId, options) { - - var transferObject = new Transfer({ - senderAddress: senderAddress, - senderPassphrase: senderPassphrase, - airdropContractAddress: airdropContractAddress, - amount: amount, - gasPrice: gasPrice, - chainId: chainId, - options: options}); - return transferObject.perform(); - - }, - - /** - * approve airdrop amount to airdrop contract address - * - * @param {Hex} airdropContractAddress - airdrop contract address - * @param {string} airdropBudgetHolderPassphrase - passphrase - * @param {Hex} gasPrice - gasPrice - * @param {Number} chainId - chainId - * @param {Object} options - options e.g. {returnType: '', tag: ''} - * - * @return {Promise} - * - */ - approve: function (airdropContractAddress, airdropBudgetHolderPassphrase, gasPrice, chainId, options) { - - var approveObject = new Approve({ - airdropContractAddress: airdropContractAddress, - airdropBudgetHolderPassphrase: airdropBudgetHolderPassphrase, - gasPrice: gasPrice, - chainId: chainId, - options: options}); - return approveObject.perform(); - - }, - - /** - * batch allocate to users - * - * @param {Hex} airdropContractAddress - airdrop contract address - * @param {Hex} transactionHash - transfer transaction hash - * @param {Object} airdropUsers - airdropUsers => {address: {airdropAmount:2, expiryTimestamp: timestamp}} - * @param {Number} chainId - chainId - * - * @return {response} - * - */ - batchAllocate: function (airdropContractAddress, transactionHash, airdropUsers, chainId) { - const batchAllocatorObject = new BatchAllocator({ - airdropContractAddress: airdropContractAddress, - transactionHash: transactionHash, - airdropUsers: airdropUsers, - chainId: chainId - }); - - return batchAllocatorObject.perform(); - }, - - /** - * Get user airdrop balance - * - * @param {Integer} chainId - chain Id - * @param {Hex} airdropContractAddress - airdrop contract address - * @param {Array} userAddresses - array of user addresses - * - * @return {response} - { - * '0x934ebd34b2a4f16d4de16256df36a6013785557d': {totalAirdropAmount: '10000000000000000', totalAirdropUsedAmount: '10000000000000000', balanceAirdropAmount: '10000000000000000'}, - * '0x934ebd34b2a4f16d4de16256df36a6013785557e': {totalAirdropAmount: '20000000000000000', totalAirdropUsedAmount: '20000000000000000', balanceAirdropAmount: '10000000000000000'} - * } - * - */ - getAirdropBalance: function (chainId, airdropContractAddress, userAddresses) { - var userBalance = new UserBalance({ - chainId: chainId, - airdropContractAddress: airdropContractAddress, - userAddresses: userAddresses - }); - return userBalance.perform(); - }, - - -}; - -module.exports = BaseKlass; - From 96ad5ae5001aa6b3b283f76a60a700d85deb2dff Mon Sep 17 00:00:00 2001 From: deepesh KN Date: Tue, 27 Mar 2018 16:02:44 +0530 Subject: [PATCH 025/115] Initial ws changes --- helpers/custom_console_logger.js | 4 ++-- lib/contract_interact/EIP20TokenMock.js | 6 +++--- lib/contract_interact/branded_token.js | 2 +- lib/contract_interact/ops_managed_contract.js | 2 +- lib/contract_interact/owned_contract.js | 2 +- lib/deployer.js | 9 ++++++++- lib/web3/providers/rpc.js | 5 +++-- mocha_test/scripts/nohup.out | 0 mocha_test/scripts/run_chain.sh | 4 ++-- mocha_test/scripts/set_env_vars.sh | 2 ++ mocha_test/scripts/start_test_chain.sh | 1 + package.json | 3 ++- tools/deploy/EIP20TokenMock.js | 1 + tools/deploy/airdrop.js | 2 +- tools/deploy/helper.js | 2 +- tools/deploy/pricer.js | 1 + 16 files changed, 30 insertions(+), 16 deletions(-) create mode 100644 mocha_test/scripts/nohup.out diff --git a/helpers/custom_console_logger.js b/helpers/custom_console_logger.js index a8a1de0..0756d97 100644 --- a/helpers/custom_console_logger.js +++ b/helpers/custom_console_logger.js @@ -60,12 +60,12 @@ module.exports = { }, debug: function () { - if (coreConstants.DEBUG_ENABLED == 1) { + //if (coreConstants.DEBUG_ENABLED == 1) { var args = [this.INFO_PRE]; args = args.concat(Array.prototype.slice.call(arguments)); args.push(this.CONSOLE_RESET); console.log.apply(console, args); - } + //} }, //Method to Log Success/Win. diff --git a/lib/contract_interact/EIP20TokenMock.js b/lib/contract_interact/EIP20TokenMock.js index 104c438..4b4c450 100644 --- a/lib/contract_interact/EIP20TokenMock.js +++ b/lib/contract_interact/EIP20TokenMock.js @@ -64,7 +64,7 @@ MockToken.prototype = { helper.assertAddress(senderAddress); currContract.options.address = this.contractAddress; - currContract.setProvider( web3RpcProvider.currentProvider ); + //currContract.setProvider( web3RpcProvider.currentProvider ); const transactionObject = currContract.methods.setBalance(ownerAddress, value); const encodedABI = transactionObject.encodeABI(); return helper.safeSendFromAddr( @@ -97,7 +97,7 @@ MockToken.prototype = { helper.assertAddress(senderAddress); currContract.options.address = this.contractAddress; - currContract.setProvider( web3RpcProvider.currentProvider ); + //currContract.setProvider( web3RpcProvider.currentProvider ); const transactionObject = currContract.methods.setConverionRate(conversionRate); const encodedABI = transactionObject.encodeABI(); return helper.safeSendFromAddr( @@ -132,7 +132,7 @@ MockToken.prototype = { helper.assertAddress(spenderAddress); currContract.options.address = this.contractAddress; - currContract.setProvider( web3RpcProvider.currentProvider ); + //currContract.setProvider( web3RpcProvider.currentProvider ); const transactionObject = currContract.methods.approve(spenderAddress, value); const encodedABI = transactionObject.encodeABI(); return helper.safeSendFromAddr( diff --git a/lib/contract_interact/branded_token.js b/lib/contract_interact/branded_token.js index 1a4233e..a4ff8c3 100644 --- a/lib/contract_interact/branded_token.js +++ b/lib/contract_interact/branded_token.js @@ -44,7 +44,7 @@ const BrandedToken = function (brandedTokenAddress, chainId) { oThis.brandedTokenAddress = brandedTokenAddress; oThis.chainId = chainId; oThis.balanceCache = new BalanceCacheKlass(chainId, brandedTokenAddress); - currContract.setProvider(web3RpcProvider.currentProvider); + //currContract.setProvider(web3RpcProvider.currentProvider); }; BrandedToken.prototype = { diff --git a/lib/contract_interact/ops_managed_contract.js b/lib/contract_interact/ops_managed_contract.js index 06f5713..43a5541 100644 --- a/lib/contract_interact/ops_managed_contract.js +++ b/lib/contract_interact/ops_managed_contract.js @@ -41,7 +41,7 @@ const OpsManagedContract = function (contractAddress, defaultGasPrice, chainId) this.currContract = currContract; this.defaultGasPrice = defaultGasPrice; this.currContract.options.address = contractAddress; - this.currContract.setProvider(web3RpcProvider.currentProvider); + //this.currContract.setProvider(web3RpcProvider.currentProvider); this.chainId = chainId; OwnedContract.call(this, contractAddress, web3RpcProvider, currContract, defaultGasPrice); }; diff --git a/lib/contract_interact/owned_contract.js b/lib/contract_interact/owned_contract.js index a38194b..00f118c 100644 --- a/lib/contract_interact/owned_contract.js +++ b/lib/contract_interact/owned_contract.js @@ -27,7 +27,7 @@ const OwnedContract = function (contractAddress, web3RpcProvider, currContract, this.currContract = currContract; this.defaultGasPrice = defaultGasPrice; this.currContract.options.address = contractAddress; - this.currContract.setProvider( web3RpcProvider.currentProvider ); + //this.currContract.setProvider( web3RpcProvider.currentProvider ); }; OwnedContract.prototype = { diff --git a/lib/deployer.js b/lib/deployer.js index 49bfc82..5b8f2bb 100644 --- a/lib/deployer.js +++ b/lib/deployer.js @@ -135,7 +135,7 @@ Deploy.prototype = { ); // this is needed since the contract object - contract.setProvider(web3Provider.currentProvider); + //contract.setProvider(web3Provider.currentProvider); // Unlock account web3Provider.eth.personal.unlockAccount( @@ -186,6 +186,13 @@ Deploy.prototype = { return onResolve(responseHelper.error(errorCode, 'Contract deployment failed')); } }); + }) + .catch(function(reason) { + const errorCode = "l_d_8"; + logger.error(`${errorCode}: Contract deployment failed`); + if (basicHelper.isReturnTypeTxReceipt(returnType)) { + return onResolve(responseHelper.error(errorCode, 'Contract deployment failed')); + } }); }) .catch(function(reason) { diff --git a/lib/web3/providers/rpc.js b/lib/web3/providers/rpc.js index 8e49a40..8fd174b 100644 --- a/lib/web3/providers/rpc.js +++ b/lib/web3/providers/rpc.js @@ -3,7 +3,8 @@ const coreConstants = require('../../../config/core_constants'); const Web3 = require('web3') - , provider = new Web3.providers.HttpProvider(coreConstants.OST_UTILITY_GETH_RPC_PROVIDER) - , web3RpcProvider = new Web3(provider); + //, provider = new Web3.providers.HttpProvider(coreConstants.OST_UTILITY_GETH_RPC_PROVIDER) + //, web3RpcProvider = new Web3(provider); + , web3RpcProvider = new Web3(coreConstants.OST_UTILITY_GETH_RPC_PROVIDER); module.exports = web3RpcProvider; diff --git a/mocha_test/scripts/nohup.out b/mocha_test/scripts/nohup.out new file mode 100644 index 0000000..e69de29 diff --git a/mocha_test/scripts/run_chain.sh b/mocha_test/scripts/run_chain.sh index d34497a..fba4780 100755 --- a/mocha_test/scripts/run_chain.sh +++ b/mocha_test/scripts/run_chain.sh @@ -1,6 +1,6 @@ #!/bin/bash -DATADIR=./st-poa +DATADIR=/Users/Deepesh/Documents/SimpleToken/workspace/openst-payments/mocha_test/scripts/st-poa LOCAL_NETWORK_ID="--networkid 20171010" -geth --datadir "$DATADIR" $LOCAL_NETWORK_ID --port 30301 --rpcport 9546 --ws --wsport 19546 --wsorigins "*" --gasprice 0 --targetgaslimit 100000000 --etherbase 0 --unlock 0 --password pw --rpc --maxpeers 0 --mine --minerthreads 4 --rpcapi net,eth,web3,personal +geth --datadir "$DATADIR" $LOCAL_NETWORK_ID --port 30301 --rpcport 9546 --rpcapi net,eth,web3,personal --wsapi net,eth,web3,personal --ws --wsport 19546 --wsorigins "*" --gasprice 0 --targetgaslimit 100000000 --etherbase 0 --unlock 0 --password pw --rpc --maxpeers 0 --mine --minerthreads 4 diff --git a/mocha_test/scripts/set_env_vars.sh b/mocha_test/scripts/set_env_vars.sh index 260f350..4f05a64 100644 --- a/mocha_test/scripts/set_env_vars.sh +++ b/mocha_test/scripts/set_env_vars.sh @@ -3,6 +3,8 @@ export OST_UTILITY_GAS_PRICE='0x12A05F200' export OST_UTILITY_GETH_RPC_PROVIDER='http://127.0.0.1:9546' +#export OST_UTILITY_GETH_RPC_PROVIDER='ws://127.0.0.1:19546' + export OST_UTILITY_DEPLOYER_ADDR='' export OST_UTILITY_DEPLOYER_PASSPHRASE='testtest' export OST_UTILITY_OPS_ADDR='' diff --git a/mocha_test/scripts/start_test_chain.sh b/mocha_test/scripts/start_test_chain.sh index 17a8ae8..44bee8b 100644 --- a/mocha_test/scripts/start_test_chain.sh +++ b/mocha_test/scripts/start_test_chain.sh @@ -5,5 +5,6 @@ cat set_env_vars.sh>env_vars.sh sh init_keys.sh sh init_chain.sh nohup sh run_chain.sh /dev/null 2>&1 & +sleep 10 node ./geth_checker.js diff --git a/package.json b/package.json index c5dd35b..7eef603 100644 --- a/package.json +++ b/package.json @@ -24,11 +24,12 @@ "dependencies": { "@openstfoundation/openst-cache": "1.0.1", "@openstfoundation/openst-notification": "1.0.0", + "@ostdotcom/ost-price-oracle": "^1.0.0", "bignumber.js": "4.1.0", "mustache": "2.3.0", "mysql": "2.14.1", "shortid": "2.2.8", - "web3": "1.0.0-beta.33" + "web3": "1.0.0-beta.26" }, "devDependencies": { "abi-decoder": "1.0.9", diff --git a/tools/deploy/EIP20TokenMock.js b/tools/deploy/EIP20TokenMock.js index aeae046..8ba63a2 100644 --- a/tools/deploy/EIP20TokenMock.js +++ b/tools/deploy/EIP20TokenMock.js @@ -115,6 +115,7 @@ async function performer(argv) { deployerInstance.writeContractAddressToFile(fileForContractAddress, contractAddress); } } + process.exit(0); } diff --git a/tools/deploy/airdrop.js b/tools/deploy/airdrop.js index a9005a6..7690b91 100644 --- a/tools/deploy/airdrop.js +++ b/tools/deploy/airdrop.js @@ -166,7 +166,7 @@ async function performer(argv) { logger.error("Error deploying contract"); logger.error(deployResult); } - + process.exit(0); } // node tools/deploy/airdrop.js brandedTokenContractAddress baseCurrency workerContractAddress airdropBudgetHolder gasPrice chainId diff --git a/tools/deploy/helper.js b/tools/deploy/helper.js index 06d0da7..61c7c69 100644 --- a/tools/deploy/helper.js +++ b/tools/deploy/helper.js @@ -108,7 +108,7 @@ const deployHelper = { options ); // this is needed since the contract object - contract.setProvider(web3Provider.currentProvider); + //contract.setProvider(web3Provider.currentProvider); const deploy = function () { const encodeABI = contract.deploy(options).encodeABI(); diff --git a/tools/deploy/pricer.js b/tools/deploy/pricer.js index 1407d34..69305bf 100644 --- a/tools/deploy/pricer.js +++ b/tools/deploy/pricer.js @@ -164,6 +164,7 @@ async function performer(argv) { logger.error(deployResult); } + process.exit(0); } performer(process.argv); From bbb04a6c4835ecc3e855c8feb4a4d6203c0565a6 Mon Sep 17 00:00:00 2001 From: abhay-pepo Date: Tue, 27 Mar 2018 16:15:57 +0530 Subject: [PATCH 026/115] New services and tested services --- lib/contract_interact/airdrop.js | 2 +- lib/set_worker_and_ops.js | 26 +++- services/airdrop/pay.js | 139 +++++++++++++++++ .../adjust_airdrop_amount.js | 4 +- services/airdrop_management/approve.js | 30 ++-- .../airdrop_management/batch_allocator.js | 30 ++-- services/airdrop_management/register.js | 31 ++-- services/airdrop_management/transfer.js | 33 ++-- services/airdrop_management/user_balance.js | 30 ++-- services/deploy/deployer.js | 24 +-- services/manifest.js | 45 ++++-- services/ops_managed/get_ops.js | 109 ++++++++++++++ services/ops_managed/set_ops.js | 123 +++++++++++++++ services/workers/is_worker.js | 108 +++++++++++++ services/workers/set_worker.js | 142 ++++++++++++++++++ tools/deploy/airdrop.js | 36 +++-- tools/deploy/pricer.js | 36 +++-- 17 files changed, 832 insertions(+), 116 deletions(-) create mode 100644 services/airdrop/pay.js create mode 100644 services/ops_managed/get_ops.js create mode 100644 services/ops_managed/set_ops.js create mode 100644 services/workers/is_worker.js create mode 100644 services/workers/set_worker.js diff --git a/lib/contract_interact/airdrop.js b/lib/contract_interact/airdrop.js index d601664..d8efda6 100644 --- a/lib/contract_interact/airdrop.js +++ b/lib/contract_interact/airdrop.js @@ -27,7 +27,6 @@ const rootPrefix = '../..' const contractAbi = coreAddresses.getAbiForContract('airdrop') , currContract = new web3RpcProvider.eth.Contract(contractAbi) - , gasLimit = coreConstants.OST_GAS_LIMIT ; /** @@ -66,6 +65,7 @@ Airdrop.prototype.constructor = Airdrop; * @param {string} currency - quote currency * @param {BigNumber} intendedPricePoint - price point at which the pay is intended (in wei) * @param {string} spender - User address + * @param {Hex} gas_price - gas price * @param {object} options - for params like returnType, tag. * * @return {promise} diff --git a/lib/set_worker_and_ops.js b/lib/set_worker_and_ops.js index 94b137b..1b73b8e 100644 --- a/lib/set_worker_and_ops.js +++ b/lib/set_worker_and_ops.js @@ -6,12 +6,13 @@ * @module lib/set_worker_and_ops */ const rootPrefix = ".." - , OpsManagedContract = require(rootPrefix + "/lib/contract_interact/ops_managed_contract") , logger = require(rootPrefix + '/helpers/custom_console_logger') , Deployer = require(rootPrefix + '/services/deploy/deployer') , returnTypes = require(rootPrefix + "/lib/global_constant/return_types") , coreAddresses = require(rootPrefix + '/config/core_addresses') , responseHelper = require(rootPrefix + '/lib/formatter/response') + , SetOpsKlass = require(rootPrefix + '/services/ops_managed/set_ops') + , GetOpsKlass = require(rootPrefix + '/services/ops_managed/get_ops') ; // Different addresses used for deployment @@ -72,14 +73,25 @@ SetWorkerOps.prototype = { returnType: returnTypes.transactionReceipt(), tag: '' } - , opsManaged = new OpsManagedContract(contractAddress, gasPrice, chainId) ; - var result = await opsManaged.setOpsAddress(deployerAddress, - deployerPassphrase, - opsAddress, - setOpsOptions); + const SetOpsObject = new SetOpsKlass({ + contract_address: contractAddress, + gas_price: gasPrice, + chain_id: chainId, + deployer_address: deployerAddress, + deployer_passphrase: deployerPassphrase, + ops_address: opsAddress, + options: setOpsOptions + }); + var result = await SetOpsObject.perform(); logger.debug(result); - var contractOpsAddress = await opsManaged.getOpsAddress(); + + const GetOpsObject = new GetOpsKlass({ + contract_address: contractAddress, + gas_price: gasPrice, + chain_id: chainId + }); + var contractOpsAddress = await GetOpsObject.perform(); logger.debug("Ops Address Set to: ", contractOpsAddress); return Promise.resolve(responseHelper.successWithData({workerContractAddress: contractAddress})); } else{ diff --git a/services/airdrop/pay.js b/services/airdrop/pay.js new file mode 100644 index 0000000..a3acb79 --- /dev/null +++ b/services/airdrop/pay.js @@ -0,0 +1,139 @@ +"use strict"; + +/** + * + * This class would be used for executing airdrop pay.

+ * + * @module services/airdrop/pay + * + */ + +const rootPrefix = '../..' + , responseHelper = require(rootPrefix + '/lib/formatter/response') + , basicHelper = require(rootPrefix + '/helpers/basic_helper') + , logger = require(rootPrefix + '/helpers/custom_console_logger') + , AirdropContractInteractKlass = require(rootPrefix + '/lib/contract_interact/airdrop') +; + +/** + * Constructor to create object of airdrop PayKlass + * + * @param {string} airdrop_contract_address - airdrop contract address + * @param {string} chain_id - chain Id + * @param {string} sender_worker_address - address of worker + * @param {string} sender_worker_passphrase - passphrase of worker + * @param {string} beneficiary_address - address of beneficiary account + * @param {BigNumber} transfer_amount - transfer amount (in wei) + * @param {string} commission_beneficiary_address - address of commision beneficiary account + * @param {BigNumber} commission_amount - commission amount (in wei) + * @param {string} currency - quote currency + * @param {BigNumber} intended_price_point - price point at which the pay is intended (in wei) + * @param {string} spender - User address + * @param {Hex} gas_price - gas price + * @param {object} options - for params like returnType, tag. + * + * @constructor + * + */ +const PayKlass = function (params) { + logger.debug("=======PayKlass.params======="); + logger.debug(params.airdrop_contract_address, params.chain_id, params.sender_worker_address, params.beneficiary_address, + params.transfer_amount, params.commission_beneficiary_address, params.commission_amount, params.intended_price_point, + params.spender, params.gas_price, params.options); + + const oThis = this + ; + + oThis.airdropContractAddress = params.airdrop_contract_address; + oThis.chainId = params.chain_id; + oThis.senderWorkerAddress = params.sender_worker_address; + oThis.senderWorkerPassphrase = params.sender_worker_passphrase; + oThis.beneficiaryAddress = params.beneficiary_address; + oThis.transferAmount = params.transfer_amount; + oThis.commissionBeneficiaryAddress = params.commission_beneficiary_address; + oThis.commissionAmount = params.commission_amount; + oThis.intendedPricePoint = params.intended_price_point; + oThis.spender = params.spender; + oThis.gasPrice = params.gas_price; + oThis.options = params.options; +}; + +PayKlass.prototype = { + + /** + * Perform method + * + * @return {promise} + * + */ + perform: async function () { + const oThis = this + ; + + try { + var r = null; + + r = await oThis.validateParams(); + logger.debug("=======PayKlass.validateParams.result======="); + logger.debug(r); + if (r.isFailure()) return r; + + r = await oThis.pay(); + logger.debug("=======PayKlass.pay.result======="); + logger.debug(r); + + return r; + + } catch (err) { + return responseHelper.error('s_a_p_perform_1', 'Something went wrong. ' + err.message); + } + + }, + + /** + * Validation of params + * + * @return {promise} + * + */ + validateParams: function () { + const oThis = this + ; + if (!basicHelper.isAddressValid(oThis.airdropContractAddress)) { + return responseHelper.error('s_a_p_validateParams_1', 'airdrop contract address is invalid'); + } + + return responseHelper.successWithData({}); + }, + + /** + * airdrop pay + * + * @return {promise} + * + */ + pay: function () { + const oThis = this + ; + const AirdropContractInteractObject = new AirdropContractInteractKlass( + oThis.airdropContractAddress, + oThis.chainId + ); + return AirdropContractInteractObject.pay( + oThis.senderWorkerAddress, + oThis.senderWorkerPassphrase, + oThis.beneficiaryAddress, + oThis.transferAmount, + oThis.commissionBeneficiaryAddress, + oThis.commissionAmount, + oThis.currency, + oThis.intendedPricePoint, + oThis.spender, + oThis.gasPrice, + oThis.options + ); + } + +}; + +module.exports = PayKlass; \ No newline at end of file diff --git a/services/airdrop_management/adjust_airdrop_amount.js b/services/airdrop_management/adjust_airdrop_amount.js index 2f20a0f..ad9a287 100644 --- a/services/airdrop_management/adjust_airdrop_amount.js +++ b/services/airdrop_management/adjust_airdrop_amount.js @@ -1,8 +1,10 @@ +"use strict"; + /** * * This class would be used for calculating user airdrop balance.

* - * @module lib/airdrop_management/user_balance + * @module services/airdrop_management/adjust_airdrop_amount * */ diff --git a/services/airdrop_management/approve.js b/services/airdrop_management/approve.js index 71b197e..bebc17b 100644 --- a/services/airdrop_management/approve.js +++ b/services/airdrop_management/approve.js @@ -1,8 +1,10 @@ +"use strict"; + /** * * This is a utility file which would be used for executing approve by airdrop budget holder.

* - * @module lib/airdrop_management/approve + * @module services/airdrop_management/approve * */ @@ -58,17 +60,21 @@ ApproveKlass.prototype = { const oThis = this; - var r = null; - - r = await oThis.validateParams(); - logger.debug("\n=========Approve.validateParams.result========="); - logger.debug(r); - if(r.isFailure()) return r; - - r = oThis.doApprove(); - logger.debug("\n=========Approve.doApprove.result========="); - logger.debug(r); - return r; + try { + var r = null; + + r = await oThis.validateParams(); + logger.debug("\n=========Approve.validateParams.result========="); + logger.debug(r); + if(r.isFailure()) return r; + + r = oThis.doApprove(); + logger.debug("\n=========Approve.doApprove.result========="); + logger.debug(r); + return r; + } catch(err) { + return responseHelper.error('s_am_a_perform_1', 'Something went wrong. ' + err.message) + } }, diff --git a/services/airdrop_management/batch_allocator.js b/services/airdrop_management/batch_allocator.js index 113959a..5151c63 100644 --- a/services/airdrop_management/batch_allocator.js +++ b/services/airdrop_management/batch_allocator.js @@ -1,8 +1,10 @@ +"use strict"; + /** * * This is a utility file which would be used for allocating amount to airdrop users.

* - * @module lib/airdrop_management/batch_allocator + * @module services/airdrop_management/batch_allocator * */ @@ -61,17 +63,23 @@ BatchAllocatorKlass.prototype = { const oThis = this; - var r = null; + try { + + var r = null; + + r = await oThis.validateParams(); + logger.debug("\n=========batchAllocator.validateParams.result========="); + logger.debug(r); + if(r.isFailure()) return r; - r = await oThis.validateParams(); - logger.debug("\n=========batchAllocator.validateParams.result========="); - logger.debug(r); - if(r.isFailure()) return r; + r = await oThis.allocateAirdropAmountToUsers(); + logger.debug("\n=========batchAllocator.allocateAirdropAmountToUsers.result========="); + logger.debug(r); + return r; - r = await oThis.allocateAirdropAmountToUsers(); - logger.debug("\n=========batchAllocator.allocateAirdropAmountToUsers.result========="); - logger.debug(r); - return r; + } catch(err){ + return responseHelper.error('s_am_ba_perform_1', 'Something went wrong. ' + err.message) + } }, /** @@ -101,7 +109,7 @@ BatchAllocatorKlass.prototype = { return onResolve(responseHelper.error('l_am_ba_vp_3', 'given airdrop record is not present in DB')); } var airdropAllocationProofDetailModel = new airdropAllocationProofDetailKlass(); - result = await airdropAllocationProofDetailModel.getByTransactionHash(oThis.transactionHash); + const result = await airdropAllocationProofDetailModel.getByTransactionHash(oThis.transactionHash); oThis.airdropAllocationProofDetailRecord = result[0]; if (!oThis.airdropAllocationProofDetailRecord) { return onResolve(responseHelper.error('l_am_ba_vp_4', 'Invalid transactionHash. Given airdropAllocationProofDetailRecord is not present in DB')); diff --git a/services/airdrop_management/register.js b/services/airdrop_management/register.js index 3a91030..af79c82 100644 --- a/services/airdrop_management/register.js +++ b/services/airdrop_management/register.js @@ -1,8 +1,10 @@ +"use strict"; + /** * * This class would be used for executing airdrop register.

* - * @module lib/airdrop_management/register + * @module services/airdrop_management/register * */ @@ -46,18 +48,21 @@ RegisterKlass.prototype = { const oThis = this ; - - var r = null; - - r = await oThis.validateParams(); - logger.debug("=======register.validateParams.result======="); - logger.debug(r); - if (r.isFailure()) return r; - - r = await oThis.runRegister(); - logger.debug("=======register.runRegister.result======="); - logger.debug(r); - return r; + try { + var r = null; + + r = await oThis.validateParams(); + logger.debug("=======register.validateParams.result======="); + logger.debug(r); + if (r.isFailure()) return r; + + r = await oThis.runRegister(); + logger.debug("=======register.runRegister.result======="); + logger.debug(r); + return r; + } catch(err) { + return responseHelper.error('s_am_r_perform_1', 'Something went wrong. ' + err.message); + } }, diff --git a/services/airdrop_management/transfer.js b/services/airdrop_management/transfer.js index 8b500f5..cd362c8 100644 --- a/services/airdrop_management/transfer.js +++ b/services/airdrop_management/transfer.js @@ -1,8 +1,10 @@ +"use strict"; + /** * * This is a utility file which would be used for executing transfer amount to airdrop budget holder.

* - * @module lib/airdrop_management/transfer + * @module services/airdrop_management/transfer * */ @@ -36,7 +38,8 @@ const rootPrefix = '../..' */ const TransferKlass = function(params) { logger.debug("\n=========Transfer params========="); - logger.debug(params); + // Don't log passphrase + logger.debug(params.senderAddress, params.airdropContractAddress, params.amount, params.gasPrice, params.chainId, params.options); const oThis = this; oThis.senderAddress = params.senderAddress; oThis.senderPassphrase = params.senderPassphrase; @@ -63,17 +66,21 @@ TransferKlass.prototype = { const oThis = this; - var r = null; - - r = await oThis.validateParams(); - logger.debug("\n=========Transfer.validateParams.result========="); - logger.debug(r); - if(r.isFailure()) return r; - - r = oThis.doTransfer(); - logger.debug("\n=========Transfer.doTransfer.result========="); - logger.debug(r); - return r; + try { + var r = null; + + r = await oThis.validateParams(); + logger.debug("\n=========Transfer.validateParams.result========="); + logger.debug(r); + if(r.isFailure()) return r; + + r = oThis.doTransfer(); + logger.debug("\n=========Transfer.doTransfer.result========="); + logger.debug(r); + return r; + } catch(err) { + return responseHelper.error('s_am_t_perform_1', 'Something went wrong. ' + err.message); + } }, diff --git a/services/airdrop_management/user_balance.js b/services/airdrop_management/user_balance.js index 0320a5a..0fc133d 100644 --- a/services/airdrop_management/user_balance.js +++ b/services/airdrop_management/user_balance.js @@ -1,8 +1,10 @@ +"use strict"; + /** * * This class would be used for calculating user airdrop balance.

* - * @module lib/airdrop_management/user_balance + * @module services/airdrop_management/user_balance * */ @@ -50,17 +52,21 @@ AirdropUserBalanceKlass.prototype = { const oThis = this; - var r = null; - - r = await oThis.validateParams(); - logger.debug("=======userBalance.validateParams.result======="); - logger.debug(r); - if(r.isFailure()) return r; - - r = await oThis.getUserAirdropBalance(); - logger.debug("=======userBalance.getUserAirdropBalance.result======="); - logger.debug(r); - return r; + try { + var r = null; + + r = await oThis.validateParams(); + logger.debug("=======userBalance.validateParams.result======="); + logger.debug(r); + if(r.isFailure()) return r; + + r = await oThis.getUserAirdropBalance(); + logger.debug("=======userBalance.getUserAirdropBalance.result======="); + logger.debug(r); + return r; + } catch(err) { + return responseHelper.error('s_am_ub_perform_1', 'Something went wrong. ' + err.message); + } }, diff --git a/services/deploy/deployer.js b/services/deploy/deployer.js index a17ea45..839b415 100644 --- a/services/deploy/deployer.js +++ b/services/deploy/deployer.js @@ -3,7 +3,7 @@ /** * This is script for deploying any contract.

* - * @module services/deployer + * @module services/deploy/deployer */ const uuid = require('uuid') @@ -51,17 +51,21 @@ DeployerKlass.prototype = { const oThis = this; - var r = null; + try { + var r = null; - r = await oThis.validateParams(); - logger.debug("\n=========Deployer.validateParams.result========="); - logger.debug(r); - if(r.isFailure()) return r; + r = await oThis.validateParams(); + logger.debug("\n=========Deployer.validateParams.result========="); + logger.debug(r); + if(r.isFailure()) return r; - r = oThis.deploy(); - logger.debug("\n=========Deployer.deploy.result========="); - logger.debug(r); - return r; + r = oThis.deploy(); + logger.debug("\n=========Deployer.deploy.result========="); + logger.debug(r); + return r; + } catch(err) { + return responseHelper.error('s_am_ub_perform_1', 'Something went wrong. ' + err.message); + } }, diff --git a/services/manifest.js b/services/manifest.js index cc7c897..430e28c 100644 --- a/services/manifest.js +++ b/services/manifest.js @@ -8,7 +8,8 @@ const rootPrefix = ".." - , deployer = require(rootPrefix + '/services/deploy/deployer') + //, deployWorkers = require(rootPrefix + '/services/deploy/workers') + //, deployAirdrop = require(rootPrefix + '/services/deploy/airdrop') , register = require(rootPrefix + '/services/airdrop_management/register') , transfer = require(rootPrefix + '/services/airdrop_management/transfer') @@ -16,9 +17,13 @@ const rootPrefix = ".." , batchAllocator = require(rootPrefix + '/services/airdrop_management/batch_allocator') , userBalance = require(rootPrefix + '/services/airdrop_management/user_balance') - , workers = require(rootPrefix + '/lib/contract_interact/workers') - , airdrop = require(rootPrefix + '/lib/contract_interact/airdrop') - , opsManaged = require(rootPrefix + "/lib/contract_interact/ops_managed_contract") + , setWorker = require(rootPrefix + '/services/workers/set_worker') + , isWorker = require(rootPrefix + '/services/workers/is_worker') + + , pay = require(rootPrefix + '/services/airdrop/pay') + + , getOps = require(rootPrefix + "/services/ops_managed/get_ops") + , setOps = require(rootPrefix + "/services/ops_managed/set_ops") ; /** @@ -29,13 +34,25 @@ const rootPrefix = ".." const ServiceManifestKlass = function() {}; ServiceManifestKlass.prototype = { + /** * deploy any contract * * @constant {object} */ deploy: { - deployer: deployer + //workers: deployWorkers, + //airdrop: deployAirdrop + }, + + /** + * Ops Managed related services + * + * @constant {object} + */ + opsManaged: { + getOps: getOps, + setOps: setOps }, /** @@ -52,16 +69,24 @@ ServiceManifestKlass.prototype = { }, /** - * Contract Interact related services + * workers * * @constant {object} */ - contractInteract: { - workers: workers, - airdrop: airdrop, - opsManaged:opsManaged + workers: { + setWorker: setWorker, + isWorker: isWorker }, + /** + * airdrop + * + * @constant {object} + */ + airdrop: { + pay: pay + } + }; module.exports = new ServiceManifestKlass(); \ No newline at end of file diff --git a/services/ops_managed/get_ops.js b/services/ops_managed/get_ops.js new file mode 100644 index 0000000..c5c8641 --- /dev/null +++ b/services/ops_managed/get_ops.js @@ -0,0 +1,109 @@ +"use strict"; + +/** + * + * This class would be used for executing getOps.

+ * + * @module services/ops_managed/get_ops + * + */ + +const rootPrefix = '../..' + , responseHelper = require(rootPrefix + '/lib/formatter/response') + , basicHelper = require(rootPrefix + '/helpers/basic_helper') + , logger = require(rootPrefix + '/helpers/custom_console_logger') + , OpsManagedContractInteractKlass = require(rootPrefix + '/lib/contract_interact/ops_managed_contract') +; + +/** + * Constructor to create object of get_ops + * + * @constructor + * + * @param {string} contract_address - contract address + * @param {string} gas_price - gas price + * @param {object} chain_id - chain id + * + * @return {Object} + * + */ +const GetOpsKlass = function (params) { + logger.debug("=======GetOpsKlass.params======="); + logger.debug(params); + + const oThis = this + ; + oThis.contractAddress = params.contract_address; + oThis.gasPrice = params.gas_price; + oThis.chainId = params.chain_id; + +}; + +GetOpsKlass.prototype = { + + /** + * Perform method + * + * @return {promise} + * + */ + perform: async function () { + const oThis = this + ; + try { + var r = null; + + r = await oThis.validateParams(); + logger.debug("=======GetOpsKlass.validateParams.result======="); + logger.debug(r); + if (r.isFailure()) return r; + + r = await oThis.getOps(); + logger.debug("=======GetOpsKlass.getOps.result======="); + logger.debug(r); + + return r; + + } catch (err) { + return responseHelper.error('s_om_go_perform_1', 'Something went wrong. ' + err.message); + } + + }, + + /** + * Validation of params + * + * @return {promise} + * + */ + validateParams: function () { + const oThis = this + ; + if (!basicHelper.isAddressValid(oThis.contractAddress)) { + return responseHelper.error('s_om_go_validateParams_1', 'contract address is invalid'); + } + + return responseHelper.successWithData({}); + }, + + /** + * get Ops + * + * @return {promise} + * + */ + getOps: function () { + const oThis = this + ; + + const OpsManagedContractInteractObject = new OpsManagedContractInteractKlass( + oThis.contractAddress, + oThis.gasPrice, + oThis.chainId + ); + return OpsManagedContractInteractObject.getOpsAddress(); + } + +}; + +module.exports = GetOpsKlass; \ No newline at end of file diff --git a/services/ops_managed/set_ops.js b/services/ops_managed/set_ops.js new file mode 100644 index 0000000..3c9daeb --- /dev/null +++ b/services/ops_managed/set_ops.js @@ -0,0 +1,123 @@ +"use strict"; + +/** + * + * This class would be used for executing setOps.

+ * + * @module services/ops_managed/set_ops + * + */ + +const rootPrefix = '../..' + , responseHelper = require(rootPrefix + '/lib/formatter/response') + , basicHelper = require(rootPrefix + '/helpers/basic_helper') + , logger = require(rootPrefix + '/helpers/custom_console_logger') + , OpsManagedContractInteractKlass = require(rootPrefix + '/lib/contract_interact/ops_managed_contract') +; + +/** + * Constructor to create object of set_ops + * + * @constructor + * + * @param {string} contract_address - contract address + * @param {Hex} gas_price - gas price + * @param {Number} chain_id - chain id + * @param {string} deployer_address - deployer address + * @param {string} deployer_passphrase - deployer passphrase + * @param {string} ops_address - ops addresses + * @param {object} options - options + * + * @return {Object} + * + */ +const SetOpsKlass = function (params) { + logger.debug("=======GetOpsKlass.params======="); + // Don't log passphrase + logger.debug(params.contract_address, params.gas_price, params.chain_id, params.deployer_address, params.ops_address, params.options); + + const oThis = this + ; + oThis.contractAddress = params.contract_address; + oThis.gasPrice = params.gas_price; + oThis.chainId = params.chain_id; + oThis.deployerAddress = params.deployer_address; + oThis.deployerPassphrase = params.deployer_passphrase; + oThis.opsAddress = params.ops_address; + oThis.options = params.options; + +}; + +SetOpsKlass.prototype = { + + /** + * Perform method + * + * @return {promise} + * + */ + perform: async function () { + const oThis = this + ; + try { + var r = null; + + r = await oThis.validateParams(); + logger.debug("=======SetOpsKlass.validateParams.result======="); + logger.debug(r); + if (r.isFailure()) return r; + + r = await oThis.setOps(); + logger.debug("=======SetOpsKlass.setOps.result======="); + logger.debug(r); + + return r; + + } catch (err) { + return responseHelper.error('s_om_go_perform_1', 'Something went wrong. ' + err.message); + } + + }, + + /** + * Validation of params + * + * @return {promise} + * + */ + validateParams: function () { + const oThis = this + ; + if (!basicHelper.isAddressValid(oThis.contractAddress)) { + return responseHelper.error('s_om_go_validateParams_1', 'contract address is invalid'); + } + + return responseHelper.successWithData({}); + }, + + /** + * set Ops + * + * @return {promise} + * + */ + setOps: function () { + const oThis = this + ; + + const OpsManagedContractInteractObject = new OpsManagedContractInteractKlass( + oThis.contractAddress, + oThis.gasPrice, + oThis.chainId + ); + return OpsManagedContractInteractObject.setOpsAddress( + oThis.deployerAddress, + oThis.deployerPassphrase, + oThis.opsAddress, + oThis.options + ); + } + +}; + +module.exports = SetOpsKlass; \ No newline at end of file diff --git a/services/workers/is_worker.js b/services/workers/is_worker.js new file mode 100644 index 0000000..6093fa6 --- /dev/null +++ b/services/workers/is_worker.js @@ -0,0 +1,108 @@ +"use strict"; + +/** + * + * This class would be used for executing worker is_worker.

+ * + * @module services/workers/is_worker + * + */ + +const rootPrefix = '../..' + , responseHelper = require(rootPrefix + '/lib/formatter/response') + , basicHelper = require(rootPrefix + '/helpers/basic_helper') + , logger = require(rootPrefix + '/helpers/custom_console_logger') + , WorkersContractInteractKlass = require(rootPrefix + '/lib/contract_interact/workers') +; + +/** + * Constructor to create object of register + * + * @constructor + * + * @param {string} workers_contract_address - contract address of workers + * @param {string} worker_address - worker address + * @param {object} chain_id - chain id + * + * @return {Object} + * + */ +const IsWorkerKlass = function (params) { + logger.debug("=======IsWorkerKlass.params======="); + logger.debug(params); + + const oThis = this + ; + + oThis.workersContractAddress = params.workers_contract_address; + oThis.workerAddress = params.worker_address; + oThis.chainId = params.chain_id; + +}; + +IsWorkerKlass.prototype = { + + /** + * Perform method + * + * @return {promise} + * + */ + perform: async function () { + const oThis = this + ; + try { + var r = null; + + r = await oThis.validateParams(); + logger.debug("=======IsWorkerKlass.validateParams.result======="); + logger.debug(r); + if (r.isFailure()) return r; + + r = await oThis.isWorker(); + logger.debug("=======IsWorkerKlass.setWorker.result======="); + logger.debug(r); + + return r; + + } catch (err) { + return responseHelper.error('s_w_iw_perform_1', 'Something went wrong. ' + err.message); + } + + }, + + /** + * Validation of params + * + * @return {promise} + * + */ + validateParams: function () { + const oThis = this + ; + if (!basicHelper.isAddressValid(oThis.workerAddress)) { + return responseHelper.error('s_w_iw_validateParams_1', 'worker address is invalid'); + } + + return responseHelper.successWithData({}); + }, + + /** + * is Worker + * + * @return {promise} + * + */ + isWorker: function () { + const oThis = this + ; + const workersContractInteractObject = new WorkersContractInteractKlass( + oThis.workersContractAddress, + oThis.chainId + ); + return workersContractInteractObject.isWorker(oThis.workerAddress); + } + +}; + +module.exports = IsWorkerKlass; \ No newline at end of file diff --git a/services/workers/set_worker.js b/services/workers/set_worker.js new file mode 100644 index 0000000..39d85f4 --- /dev/null +++ b/services/workers/set_worker.js @@ -0,0 +1,142 @@ +"use strict"; + +/** + * + * This class would be used for executing airdrop register.

+ * + * @module services/workers/set_worker + * + */ + +const rootPrefix = '../..' + , responseHelper = require(rootPrefix + '/lib/formatter/response') + , basicHelper = require(rootPrefix + '/helpers/basic_helper') + , logger = require(rootPrefix + '/helpers/custom_console_logger') + , BigNumber = require('bignumber.js') + , WorkersContractInteractKlass = require(rootPrefix + '/lib/contract_interact/workers') +; + +/** + * Constructor to create object of register + * + * @constructor + * + * @param {string} workers_contract_address - contract address of workers + * @param {string} sender_address - address of sender + * @param {string} sender_passphrase - passphrase of sender + * @param {string} worker_address - worker address + * @param {number} deactivation_height - block number till which the worker is valid + * @param {BigNumber} gas_price - gas price + * @param {object} chain_id - chain id + * @param {object} options - for params like returnType, tag. + * + * @return {Object} + * + */ +const SetWorkerKlass = function (params) { + logger.debug("=======SetWorkerKlass.params======="); + // Don't log passphrase + logger.debug(params.workers_contract_address, params.sender_address, params.worker_address, params.deactivation_height, params.gas_price, params.chain_id, params.options); + const oThis = this; + + oThis.workersContractAddress = params.workers_contract_address; + oThis.senderAddress = params.sender_address; + oThis.senderPassphrase = params.sender_passphrase; + oThis.workerAddress = params.worker_address; + oThis.deactivationHeight = params.deactivation_height; + oThis.gasPrice = params.gas_price; + oThis.chainId = params.chain_id; + oThis.options = params.options + +}; + +SetWorkerKlass.prototype = { + + /** + * Perform method + * + * @return {promise} + * + */ + perform: async function () { + const oThis = this + ; + + try { + var r = null; + + r = await oThis.validateParams(); + logger.debug("=======SetWorkerKlass.validateParams.result======="); + logger.debug(r); + if (r.isFailure()) return r; + + r = await oThis.setWorker(); + logger.debug("=======SetWorkerKlass.setWorker.result======="); + logger.debug(r); + + return r; + + } catch (err) { + return responseHelper.error('s_w_sw_perform_1', 'Something went wrong. ' + err.message); + } + + }, + + /** + * Validation of params + * + * @return {promise} + * + */ + validateParams: function () { + const oThis = this; + if (!basicHelper.isAddressValid(oThis.workersContractAddress)) { + return responseHelper.error('s_w_sw_validateParams_1', 'workers contract address is invalid'); + } + if (!oThis.gasPrice) { + return responseHelper.error('s_w_sw_validateParams_2', 'gas is mandatory'); + } + if (!basicHelper.isAddressValid(oThis.senderAddress)) { + return responseHelper.error('s_w_sw_validateParams_3', 'sender address is invalid'); + } + if (!basicHelper.isAddressValid(oThis.workerAddress)) { + return responseHelper.error('s_w_sw_validateParams_4', 'worker address is invalid'); + } + if (!oThis.deactivationHeight) { + return responseHelper.error('s_w_sw_validateParams_5', 'deactivation height is mandatory'); + } + const deactivationHeight = new BigNumber(oThis.deactivationHeight); + if (deactivationHeight.isNaN() || deactivationHeight.lt(0) || !deactivationHeight.isInteger()) { + return responseHelper.error('s_w_sw_validateParams_6', 'deactivation height value is invalid'); + } + + return responseHelper.successWithData({}); + }, + + /** + * Set Worker + * + * @return {promise} + * + */ + setWorker: function () { + const oThis = this + ; + + const workersContractInteractObject = new WorkersContractInteractKlass( + oThis.workersContractAddress, + oThis.chainId + ); + return workersContractInteractObject.setWorker( + oThis.senderAddress, + oThis.senderPassphrase, + oThis.workerAddress, + oThis.deactivationHeight.toString(10), + oThis.gasPrice, + oThis.options + ); + } + +}; + +module.exports = SetWorkerKlass; \ No newline at end of file diff --git a/tools/deploy/airdrop.js b/tools/deploy/airdrop.js index 292e6ef..084b62c 100644 --- a/tools/deploy/airdrop.js +++ b/tools/deploy/airdrop.js @@ -24,9 +24,10 @@ const readline = require('readline') , coreAddresses = require(rootPrefix + '/config/core_addresses') , prompts = readline.createInterface(process.stdin, process.stdout) , logger = require(rootPrefix + '/helpers/custom_console_logger') - , OpsManagedContract = require(rootPrefix + "/lib/contract_interact/ops_managed_contract") , returnTypes = require(rootPrefix + "/lib/global_constant/return_types") , helper = require(rootPrefix + "/tools/deploy/helper") + , SetOpsKlass = require(rootPrefix + '/services/ops_managed/set_ops') + , GetOpsKlass = require(rootPrefix + '/services/ops_managed/get_ops') ; // Different addresses used for deployment @@ -150,20 +151,29 @@ async function performer(argv) { helper.writeContractAddressToFile(fileForContractAddress, contractAddress); } + const setOpsOptions = { + returnType: returnTypes.transactionReceipt(), + tag: '' + }; logger.debug("Setting Ops Address to: " + opsAddress); - const opsManaged = new OpsManagedContract(contractAddress, gasPrice, chainId) - , setOpsOptions = { - returnType: returnTypes.transactionReceipt(), - tag: '' - } - ; - var setOpsResult = await opsManaged.setOpsAddress(deployerAddress, - deployerPassphrase, - opsAddress, - setOpsOptions - ); + const SetOpsObject = new SetOpsKlass({ + contract_address: contractAddress, + gas_price: gasPrice, + chain_id: chainId, + deployer_address: deployerAddress, + deployer_passphrase: deployerPassphrase, + ops_address: opsAddress, + options: setOpsOptions + }); + var setOpsResult = await SetOpsObject.perform(); logger.debug(setOpsResult); - var contractOpsAddress = await opsManaged.getOpsAddress(); + + const GetOpsObject = new GetOpsKlass({ + contract_address: contractAddress, + gas_price: gasPrice, + chain_id: chainId + }); + var contractOpsAddress = await GetOpsObject.perform(); logger.debug("Ops Address Set to: " + contractOpsAddress); } else { diff --git a/tools/deploy/pricer.js b/tools/deploy/pricer.js index 149ded7..80a82b3 100644 --- a/tools/deploy/pricer.js +++ b/tools/deploy/pricer.js @@ -20,11 +20,12 @@ const readline = require('readline') , web3Provider = require(rootPrefix + '/lib/web3/providers/rpc') , prompts = readline.createInterface(process.stdin, process.stdout) , logger = require(rootPrefix + '/helpers/custom_console_logger') - , OpsManagedContract = require(rootPrefix + "/lib/contract_interact/ops_managed_contract") , Deployer = require(rootPrefix + '/services/deploy/deployer') , coreAddresses = require(rootPrefix + '/config/core_addresses') , returnTypes = require(rootPrefix + "/lib/global_constant/return_types") , helper = require(rootPrefix + "/tools/deploy/helper") + , SetOpsKlass = require(rootPrefix + '/services/ops_managed/set_ops') + , GetOpsKlass = require(rootPrefix + '/services/ops_managed/get_ops') ; // Different addresses used for deployment @@ -145,20 +146,29 @@ async function performer(argv) { helper.writeContractAddressToFile(fileForContractAddress, contractAddress); } - logger.debug("Setting Ops Address to: " + opsAddress); const setOpsOptions = { - returnType: returnTypes.transactionReceipt(), - tag: '' - } - , opsManaged = new OpsManagedContract(contractAddress, gasPrice, chainId) - ; - var setOpsResult = await opsManaged.setOpsAddress( - deployerAddress, - deployerPassphrase, - opsAddress, - setOpsOptions); + returnType: returnTypes.transactionReceipt(), + tag: '' + } + logger.debug("Setting Ops Address to: " + opsAddress); + const SetOpsObject = new SetOpsKlass({ + contract_address: contractAddress, + gas_price: gasPrice, + chain_id: chainId, + deployer_address: deployerAddress, + deployer_passphrase: deployerPassphrase, + ops_address: opsAddress, + options: setOpsOptions + }); + var setOpsResult = await SetOpsObject.perform(); logger.debug(setOpsResult); - const contractOpsAddress = await opsManaged.getOpsAddress(); + + const GetOpsObject = new GetOpsKlass({ + contract_address: contractAddress, + gas_price: gasPrice, + chain_id: chainId + }); + var contractOpsAddress = await GetOpsObject.perform(); logger.debug("Ops Address Set to: " + contractOpsAddress); } else { From 28d5b5b8be6f4ce8c1227b655e2c9d36fa6f53ae Mon Sep 17 00:00:00 2001 From: abhay-pepo Date: Tue, 27 Mar 2018 17:07:35 +0530 Subject: [PATCH 027/115] Worker Services is tested --- lib/contract_interact/workers.js | 35 ---- mocha_test/services/airdrop/pay.js | 31 ++- mocha_test/services/workers/_is_worker.js | 11 +- mocha_test/services/workers/_set_worker.js | 223 +++++++++++++-------- 4 files changed, 162 insertions(+), 138 deletions(-) diff --git a/lib/contract_interact/workers.js b/lib/contract_interact/workers.js index 76c678e..41e18c9 100644 --- a/lib/contract_interact/workers.js +++ b/lib/contract_interact/workers.js @@ -69,10 +69,6 @@ Workers.prototype = { ; try { - const validationResponse = oThis._validateSetWorkersParams(senderAddress, workerAddress, deactivationHeight, gasPrice); - - if (validationResponse.isFailure()) return Promise.resolve(validationResponse); - const returnType = basicHelper.getReturnType(options.returnType) , transactionObject = currContract.methods.setWorker(workerAddress, deactivationHeight); @@ -241,37 +237,6 @@ Workers.prototype = { } }, - /** - * Validate set workers params - * - * @param {string} senderAddress - address of sender - * @param {string} workerAddress - worker address - * @param {number} deactivationHeight - block number till which the worker is valid - * @param {BigNumber} gasPrice - gas price - * - * @return {result} - * - */ - _validateSetWorkersParams: function (senderAddress, workerAddress, deactivationHeight, gasPrice ) { - if (!gasPrice) { - return responseHelper.error('l_ci_w_validateSetWorkersParams_1', 'gas is mandatory'); - } - if (!basicHelper.isAddressValid(senderAddress)) { - return responseHelper.error('l_ci_w_validateSetWorkersParams_2', 'sender address is invalid'); - } - if (!basicHelper.isAddressValid(workerAddress)) { - return responseHelper.error('l_ci_w_validateSetWorkersParams_3', 'worker address is invalid'); - } - if (!deactivationHeight) { - return responseHelper.error('l_ci_w_validateSetWorkersParams_4', 'deactivation height is mandatory'); - } - deactivationHeight = new BigNumber(deactivationHeight); - if (deactivationHeight.isNaN() || deactivationHeight.lt(0) || !deactivationHeight.isInteger()) { - return responseHelper.error('l_ci_w_validateSetWorkersParams_5', 'deactivation height value is invalid'); - } - return responseHelper.successWithData({}); - }, - /** * Validate remove worker params * diff --git a/mocha_test/services/airdrop/pay.js b/mocha_test/services/airdrop/pay.js index 468883d..901ea42 100644 --- a/mocha_test/services/airdrop/pay.js +++ b/mocha_test/services/airdrop/pay.js @@ -8,15 +8,15 @@ const rootPrefix = "../../.." , BigNumber = require('bignumber.js') , utils = require(rootPrefix+'/mocha_test/lib/utils') , airdrop = require(rootPrefix + '/lib/contract_interact/airdrop') - , workers = require(rootPrefix + '/lib/contract_interact/workers') , mockToken = require(rootPrefix + '/lib/contract_interact/EIP20TokenMock') , BrandedTokenKlass = require(rootPrefix + '/lib/contract_interact/branded_token') , web3RpcProvider = require(rootPrefix + '/lib/web3/providers/rpc') , logger = require(rootPrefix + '/helpers/custom_console_logger') + , SetWorkerKlass = require(rootPrefix + '/services/workers/set_worker') + , IsWorkerKlass = require(rootPrefix + '/services/workers/is_worker') ; -const workersContract = new workers(constants.workersContractAddress, constants.chainId) - , airdropOstUsd = new airdrop(constants.airdropOstUsdAddress, constants.chainId) +const airdropOstUsd = new airdrop(constants.airdropOstUsdAddress, constants.chainId) , TC5 = new mockToken(constants.TC5Address) , brandedTokenObject = new BrandedTokenKlass(constants.TC5Address, constants.chainId) ; @@ -100,20 +100,29 @@ async function setPriceOracle(airdropObject, currency, address) { * */ async function setWorker(workerAddress, deactivationHeight) { - const setWorkerResponse = await workersContract.setWorker( - constants.ops, - constants.opsPassphrase, - workerAddress, - deactivationHeight.toString(10), - constants.gasUsed, - constants.optionsReceipt); + const SetWorkerObject = new SetWorkerKlass({ + workers_contract_address: constants.workersContractAddress, + sender_address: constants.ops, + sender_passphrase: constants.opsPassphrase, + worker_address: workerAddress, + deactivation_height: deactivationHeight.toString(10), + gas_price: constants.gasUsed, + chain_id: constants.chainId, + options: constants.optionsReceipt + }); + const setWorkerResponse = await SetWorkerObject.perform(); assert.equal(setWorkerResponse.isSuccess(), true); // verify if the transaction receipt is valid utils.verifyTransactionReceipt(setWorkerResponse); // confirm that worker is a set - const isWorkerResponse = await workersContract.isWorker(workerAddress); + const IsWorkerObject = new IsWorkerKlass({ + workers_contract_address: constants.workersContractAddress, + worker_address: workerAddress, + chain_id: constants.chainId + }); + const isWorkerResponse = await IsWorkerObject.perform(); assert.equal(isWorkerResponse.isSuccess(), true); assert.equal(isWorkerResponse.data.isValid, true); } diff --git a/mocha_test/services/workers/_is_worker.js b/mocha_test/services/workers/_is_worker.js index cd1159b..ef1c2ca 100644 --- a/mocha_test/services/workers/_is_worker.js +++ b/mocha_test/services/workers/_is_worker.js @@ -5,8 +5,7 @@ const chai = require('chai') const rootPrefix = "../../.." , constants = require(rootPrefix + '/mocha_test/lib/constants') - , workersModule = require(rootPrefix + '/lib/contract_interact/workers') - , workers = new workersModule(constants.workersContractAddress, constants.chainId) + , IsWorkerKlass = require(rootPrefix + '/services/workers/is_worker') ; describe('Is worker', function() { @@ -17,8 +16,12 @@ describe('Is worker', function() { // eslint-disable-next-line no-invalid-this this.timeout(100000); - // set worker - const response = await workers.isWorker(0); + const IsWorkerObject = new IsWorkerKlass({ + workers_contract_address: constants.workersContractAddress, + worker_address: 0, + chain_id: constants.chainId + }); + const response = await IsWorkerObject.perform(); // confirm failure reponse and message assert.equal(response.isFailure(), true); diff --git a/mocha_test/services/workers/_set_worker.js b/mocha_test/services/workers/_set_worker.js index b9a34e0..5c061ab 100644 --- a/mocha_test/services/workers/_set_worker.js +++ b/mocha_test/services/workers/_set_worker.js @@ -7,9 +7,9 @@ const rootPrefix = "../../.." , constants = require(rootPrefix + '/mocha_test/lib/constants') , BigNumber = require('bignumber.js') , utils = require(rootPrefix+'/mocha_test/lib/utils') - , workersModule = require(rootPrefix + '/lib/contract_interact/workers') - , workers = new workersModule(constants.workersContractAddress, constants.chainId) , web3RpcProvider = require(rootPrefix + '/lib/web3/providers/rpc') + , SetWorkerKlass = require(rootPrefix + '/services/workers/set_worker') + , IsWorkerKlass = require(rootPrefix + '/services/workers/is_worker') ; describe('Set worker', function() { @@ -32,13 +32,17 @@ describe('Set worker', function() { ; // set worker - const response = await workers.setWorker( - constants.ops, - constants.opsPassphrase, - constants.workerAccount1, - deactivationHeight.toNumber(), - 0, - constants.optionsReceipt); + var SetWorkerObject = new SetWorkerKlass({ + workers_contract_address: constants.workersContractAddress, + sender_address: constants.ops, + sender_passphrase: constants.opsPassphrase, + worker_address: constants.workerAccount1, + deactivation_height: deactivationHeight.toString(10), + gas_price: 0, + chain_id: constants.chainId, + options: constants.optionsReceipt + }); + const response = await SetWorkerObject.perform(); // confirm failure reponse and message assert.equal(response.isFailure(), true); @@ -56,14 +60,17 @@ describe('Set worker', function() { ; // set worker - const response = await workers.setWorker( - 0, - constants.opsPassphrase, - constants.workerAccount1, - deactivationHeight.toNumber(), - constants.gasUsed, - constants.optionsReceipt); - + var SetWorkerObject = new SetWorkerKlass({ + workers_contract_address: constants.workersContractAddress, + sender_address: 0, + sender_passphrase: constants.opsPassphrase, + worker_address: constants.workerAccount1, + deactivation_height: deactivationHeight.toString(10), + gas_price: constants.gasUsed, + chain_id: constants.chainId, + options: constants.optionsReceipt + }); + const response = await SetWorkerObject.perform(); // confirm failure reponse and message assert.equal(response.isFailure(), true); assert.equal(response.err.msg, 'sender address is invalid'); @@ -80,13 +87,17 @@ describe('Set worker', function() { ; // set worker - const response = await workers.setWorker( - constants.ops, - constants.opsPassphrase, - 0, - deactivationHeight.toNumber(), - constants.gasUsed, - constants.optionsReceipt); + var SetWorkerObject = new SetWorkerKlass({ + workers_contract_address: constants.workersContractAddress, + sender_address: constants.ops, + sender_passphrase: constants.opsPassphrase, + worker_address: 0, + deactivation_height: deactivationHeight.toString(10), + gas_price: constants.gasUsed, + chain_id: constants.chainId, + options: constants.optionsReceipt + }); + const response = await SetWorkerObject.perform(); // confirm failure reponse and message assert.equal(response.isFailure(), true); @@ -104,13 +115,17 @@ describe('Set worker', function() { ; // set worker - const response = await workers.setWorker( - constants.ops, - constants.opsPassphrase, - constants.workerAccount1, - null, - constants.gasUsed, - constants.optionsReceipt); + var SetWorkerObject = new SetWorkerKlass({ + workers_contract_address: constants.workersContractAddress, + sender_address: constants.ops, + sender_passphrase: constants.opsPassphrase, + worker_address: constants.workerAccount1, + deactivation_height: null, + gas_price: constants.gasUsed, + chain_id: constants.chainId, + options: constants.optionsReceipt + }); + const response = await SetWorkerObject.perform(); // confirm failure reponse and message assert.equal(response.isFailure(), true); @@ -128,14 +143,17 @@ describe('Set worker', function() { ; // set worker - const response = await workers.setWorker( - constants.ops, - constants.opsPassphrase, - constants.workerAccount1, - 'NaN', - constants.gasUsed, - constants.optionsReceipt); - + var SetWorkerObject = new SetWorkerKlass({ + workers_contract_address: constants.workersContractAddress, + sender_address: constants.ops, + sender_passphrase: constants.opsPassphrase, + worker_address: constants.workerAccount1, + deactivation_height: 'NaN', + gas_price: constants.gasUsed, + chain_id: constants.chainId, + options: constants.optionsReceipt + }); + const response = await SetWorkerObject.perform(); // confirm failure reponse and message assert.equal(response.isFailure(), true); assert.equal(response.err.msg, 'deactivation height value is invalid'); @@ -152,14 +170,17 @@ describe('Set worker', function() { ; // set worker - const response = await workers.setWorker( - constants.ops, - constants.opsPassphrase, - constants.workerAccount1, - -1, - constants.gasUsed, - constants.optionsReceipt); - + var SetWorkerObject = new SetWorkerKlass({ + workers_contract_address: constants.workersContractAddress, + sender_address: constants.ops, + sender_passphrase: constants.opsPassphrase, + worker_address: constants.workerAccount1, + deactivation_height: -1, + gas_price: constants.gasUsed, + chain_id: constants.chainId, + options: constants.optionsReceipt + }); + const response = await SetWorkerObject.perform(); // confirm failure reponse and message assert.equal(response.isFailure(), true); assert.equal(response.err.msg, 'deactivation height value is invalid'); @@ -176,14 +197,17 @@ describe('Set worker', function() { ; // set worker - const response = await workers.setWorker( - constants.ops, - constants.opsPassphrase, - constants.workerAccount1, - 0.1, - constants.gasUsed, - constants.optionsReceipt); - + var SetWorkerObject = new SetWorkerKlass({ + workers_contract_address: constants.workersContractAddress, + sender_address: constants.ops, + sender_passphrase: constants.opsPassphrase, + worker_address: constants.workerAccount1, + deactivation_height: 0.1, + gas_price: constants.gasUsed, + chain_id: constants.chainId, + options: constants.optionsReceipt + }); + const response = await SetWorkerObject.perform(); // confirm failure reponse and message assert.equal(response.isFailure(), true); assert.equal(response.err.msg, 'deactivation height value is invalid'); @@ -200,27 +224,38 @@ describe('Set worker', function() { ; // confirm that worker is not a worker - const isWorkerBefore = await workers.isWorker(constants.workerAccount1); + var IsWorkerObject = new IsWorkerKlass({ + workers_contract_address: constants.workersContractAddress, + worker_address: constants.workerAccount1, + chain_id: constants.chainId + }); + const isWorkerBefore = await IsWorkerObject.perform(); assert.equal(isWorkerBefore.isSuccess(), true); assert.equal(isWorkerBefore.data.isValid, false); // set worker - const response = await workers.setWorker( - constants.ops, - constants.opsPassphrase, - constants.workerAccount1, - deactivationHeight.toNumber(), - constants.gasUsed, - constants.optionsReceipt); + var SetWorkerObject = new SetWorkerKlass({ + workers_contract_address: constants.workersContractAddress, + sender_address: constants.ops, + sender_passphrase: constants.opsPassphrase, + worker_address: constants.workerAccount1, + deactivation_height: deactivationHeight.toString(10), + gas_price: constants.gasUsed, + chain_id: constants.chainId, + options: constants.optionsReceipt + }); + const response = await SetWorkerObject.perform(); // verify if the transaction receipt is valid utils.verifyTransactionReceipt(response); - // verify if the transaction has was actually mined - await utils.verifyIfMined(workers, response.data.transaction_hash); - // confirm that worker is a worker - const isWorkerAfter = await workers.isWorker(constants.workerAccount1); + var IsWorkerObject = new IsWorkerKlass({ + workers_contract_address: constants.workersContractAddress, + worker_address: constants.workerAccount1, + chain_id: constants.chainId + }); + const isWorkerAfter = await IsWorkerObject.perform(); assert.equal(isWorkerAfter.isSuccess(), true); assert.equal(isWorkerAfter.data.isValid, true); @@ -236,13 +271,17 @@ describe('Set worker', function() { ; // set worker - const response = await workers.setWorker( - constants.ops, - constants.opsPassphrase, - constants.workerAccount1, - deactivationHeight.toNumber(), - constants.gasUsed, - constants.optionsUUID); + var SetWorkerObject = new SetWorkerKlass({ + workers_contract_address: constants.workersContractAddress, + sender_address: constants.ops, + sender_passphrase: constants.opsPassphrase, + worker_address: constants.workerAccount1, + deactivation_height: deactivationHeight.toString(10), + gas_price: constants.gasUsed, + chain_id: constants.chainId, + options: constants.optionsUUID + }); + const response = await SetWorkerObject.perform(); // verify transaction UUID // we will not verify if it got mined as its just interaction layer testing @@ -260,13 +299,17 @@ describe('Set worker', function() { ; // set worker - const response = await workers.setWorker( - constants.ops, - constants.opsPassphrase, - constants.workerAccount1, - deactivationHeight.toNumber(), - constants.gasUsed, - constants.optionsHash); + var SetWorkerObject = new SetWorkerKlass({ + workers_contract_address: constants.workersContractAddress, + sender_address: constants.ops, + sender_passphrase: constants.opsPassphrase, + worker_address: constants.workerAccount1, + deactivation_height: deactivationHeight.toString(10), + gas_price: constants.gasUsed, + chain_id: constants.chainId, + options: constants.optionsHash + }); + const response = await SetWorkerObject.perform(); // verify transaction hash utils.verifyTransactionHash(response); @@ -283,13 +326,17 @@ describe('Set worker', function() { ; // set worker - const response = await workers.setWorker( - constants.ops, - constants.opsPassphrase, - constants.workerAccount1, - deactivationHeight.toNumber(), - constants.gasUsed, - constants.optionsReceipt); + var SetWorkerObject = new SetWorkerKlass({ + workers_contract_address: constants.workersContractAddress, + sender_address: constants.ops, + sender_passphrase: constants.opsPassphrase, + worker_address: constants.workerAccount1, + deactivation_height: deactivationHeight.toString(10), + gas_price: constants.gasUsed, + chain_id: constants.chainId, + options: constants.optionsReceipt + }); + const response = await SetWorkerObject.perform(); // verify transaction receipt utils.verifyTransactionReceipt(response); From f645a6b77db424a1efea51897cab78b1b7f54358 Mon Sep 17 00:00:00 2001 From: deepesh KN Date: Tue, 27 Mar 2018 17:20:59 +0530 Subject: [PATCH 028/115] Added websocket provider --- .travis.yml | 2 +- README.md | 1 + config/core_constants.js | 3 +- docs/baseCacheMultiManagementKlass.html | 1137 --- docs/classes.list.html | 396 - docs/fonts/glyphicons-halflings-regular.eot | Bin 20127 -> 0 bytes docs/fonts/glyphicons-halflings-regular.svg | 288 - docs/fonts/glyphicons-halflings-regular.ttf | Bin 45404 -> 0 bytes docs/fonts/glyphicons-halflings-regular.woff | Bin 23424 -> 0 bytes docs/fonts/glyphicons-halflings-regular.woff2 | Bin 18028 -> 0 bytes docs/global.html | 375 - docs/img/glyphicons-halflings-white.png | Bin 8777 -> 0 bytes docs/img/glyphicons-halflings.png | Bin 12799 -> 0 bytes docs/index.html | 304 - ...helpers_basic_helper-BasicHelperKlass.html | 2419 ------ docs/module-helpers_basic_helper.html | 311 - ...ib_airdrop_management_approve-approve.html | 807 -- ...module-lib_airdrop_management_approve.html | 311 - ...dule-lib_airdrop_management_base-base.html | 1478 ---- docs/module-lib_airdrop_management_base.html | 311 - ...gement_batch_allocator-batchAllocator.html | 881 -- ...ib_airdrop_management_batch_allocator.html | 311 - ..._airdrop_management_register-register.html | 735 -- ...odule-lib_airdrop_management_register.html | 311 - ..._airdrop_management_transfer-transfer.html | 855 -- ...odule-lib_airdrop_management_transfer.html | 311 - ...user_balance-AdjustAirdropAmountKlass.html | 831 -- ..._user_balance-AirdropUserBalanceKlass.html | 759 -- ...e-lib_airdrop_management_user_balance.html | 407 - ...ent_airdrop_cache-AirdropBalanceCache.html | 428 - ...le-lib_cache_management_airdrop_cache.html | 311 - ...management_balance_cache-BalanceCache.html | 889 -- ...le-lib_cache_management_balance_cache.html | 311 - ...e_management_pricer_cache-PricerCache.html | 3891 --------- ...ule-lib_cache_management_pricer_cache.html | 311 - ...lib_contract_interact_airdrop-Airdrop.html | 1075 --- .../module-lib_contract_interact_airdrop.html | 311 - ...t_interact_branded_token-BrandedToken.html | 1953 ----- ...e-lib_contract_interact_branded_token.html | 311 - ...nteract_helper-ContractInteractHelper.html | 4009 --------- docs/module-lib_contract_interact_helper.html | 311 - ...s_managed_contract-OpsManagedContract.html | 774 -- ...ontract_interact_ops_managed_contract.html | 311 - ...interact_owned_contract-OwnedContract.html | 763 -- ...-lib_contract_interact_owned_contract.html | 311 - ...ib_contract_interact_pricer-MockToken.html | 1199 --- ...e-lib_contract_interact_pricer-Pricer.html | 5207 ----------- docs/module-lib_contract_interact_pricer.html | 407 - ...lib_contract_interact_workers-Workers.html | 2038 ----- .../module-lib_contract_interact_workers.html | 311 - docs/module-lib_deployer-Deploy.html | 894 -- docs/module-lib_deployer.html | 316 - ..._builder_mysql-MySQLQueryBuilderKlass.html | 2662 ------ docs/module-lib_query_builder_mysql.html | 339 - ...e-lib_set_worker_and_ops-SetWorkerOps.html | 603 -- docs/module-lib_set_worker_and_ops.html | 311 - ..._transaction_helper-TransactionHelper.html | 4093 --------- docs/module-lib_transaction_helper.html | 311 - ...b3_events_formatter-web3EventsDecoder.html | 491 -- ..._events_formatter-web3EventsFormatter.html | 457 - docs/module-lib_web3_events_formatter.html | 407 - docs/module-tools_deploy_DeployHelper.html | 821 -- docs/module-tools_deploy_EIP20TokenMock.html | 448 - docs/module-tools_deploy_helper.html | 306 - docs/module-tools_deploy_pricer.html | 1495 ---- docs/module-tools_deploy_workers.html | 406 - docs/modules.list.html | 396 - docs/namespaces.list.html | 396 - docs/quicksearch.html | 31 - docs/scripts/docstrap.lib.js | 11 - docs/scripts/fulltext-search-ui.js | 89 - docs/scripts/fulltext-search.js | 36 - docs/scripts/lunr.min.js | 6 - docs/scripts/prettify/Apache-License-2.0.txt | 202 - docs/scripts/prettify/jquery.min.js | 6 - docs/scripts/prettify/lang-css.js | 21 - docs/scripts/prettify/prettify.js | 496 -- docs/scripts/sunlight.js | 1157 --- docs/scripts/toc.js | 203 - docs/styles/darkstrap.css | 960 --- docs/styles/prettify-tomorrow.css | 132 - docs/styles/site.cerulean.css | 7008 --------------- docs/styles/site.cosmo.css | 7061 --------------- docs/styles/site.cyborg.css | 7048 --------------- docs/styles/site.darkly.css | 7171 ---------------- docs/styles/site.darkstrap.css | 5638 ------------ docs/styles/site.dibs-bootstrap.css | 5899 ------------- docs/styles/site.flatly.css | 7147 ---------------- docs/styles/site.journal.css | 6973 --------------- docs/styles/site.lumen.css | 7298 ---------------- docs/styles/site.paper.css | 7623 ----------------- docs/styles/site.readable.css | 6997 --------------- docs/styles/site.sandstone.css | 7035 --------------- docs/styles/site.simplex.css | 7023 --------------- docs/styles/site.slate.css | 7343 ---------------- docs/styles/site.spacelab.css | 7055 --------------- docs/styles/site.superhero.css | 7131 --------------- docs/styles/site.united.css | 6895 --------------- docs/styles/site.yeti.css | 7195 ---------------- docs/styles/sunlight.dark.css | 345 - docs/styles/sunlight.default.css | 344 - docs/userAirdropDetailCache.html | 864 -- helpers/custom_console_logger.js | 4 +- lib/contract_interact/EIP20TokenMock.js | 18 +- lib/contract_interact/airdrop.js | 14 +- lib/contract_interact/branded_token.js | 16 +- lib/contract_interact/helper.js | 86 +- lib/contract_interact/ops_managed_contract.js | 16 +- lib/contract_interact/owned_contract.js | 12 +- lib/contract_interact/pricer.js | 60 +- lib/contract_interact/workers.js | 20 +- lib/deployer.js | 2 +- lib/web3/providers/rpc.js | 2 - lib/web3/providers/ws.js | 8 + mocha_test/scripts/geth_checker.js | 4 +- mocha_test/scripts/nohup.out | 0 mocha_test/scripts/run_chain.sh | 2 +- mocha_test/scripts/set_env_vars.sh | 2 +- mocha_test/scripts/travis_test.sh | 6 +- .../services/airdrop/airdrop_budget_holder.js | 4 +- mocha_test/services/airdrop/get_workers.js | 4 +- mocha_test/services/airdrop/pay.js | 18 +- mocha_test/services/workers/_set_worker.js | 24 +- mocha_test/services/workers/remove.js | 4 +- tools/deploy/airdrop.js | 2 +- tools/deploy/pricer.js | 2 +- 126 files changed, 172 insertions(+), 184729 deletions(-) delete mode 100644 docs/baseCacheMultiManagementKlass.html delete mode 100644 docs/classes.list.html delete mode 100644 docs/fonts/glyphicons-halflings-regular.eot delete mode 100644 docs/fonts/glyphicons-halflings-regular.svg delete mode 100644 docs/fonts/glyphicons-halflings-regular.ttf delete mode 100644 docs/fonts/glyphicons-halflings-regular.woff delete mode 100644 docs/fonts/glyphicons-halflings-regular.woff2 delete mode 100644 docs/global.html delete mode 100644 docs/img/glyphicons-halflings-white.png delete mode 100644 docs/img/glyphicons-halflings.png delete mode 100644 docs/index.html delete mode 100644 docs/module-helpers_basic_helper-BasicHelperKlass.html delete mode 100644 docs/module-helpers_basic_helper.html delete mode 100644 docs/module-lib_airdrop_management_approve-approve.html delete mode 100644 docs/module-lib_airdrop_management_approve.html delete mode 100644 docs/module-lib_airdrop_management_base-base.html delete mode 100644 docs/module-lib_airdrop_management_base.html delete mode 100644 docs/module-lib_airdrop_management_batch_allocator-batchAllocator.html delete mode 100644 docs/module-lib_airdrop_management_batch_allocator.html delete mode 100644 docs/module-lib_airdrop_management_register-register.html delete mode 100644 docs/module-lib_airdrop_management_register.html delete mode 100644 docs/module-lib_airdrop_management_transfer-transfer.html delete mode 100644 docs/module-lib_airdrop_management_transfer.html delete mode 100644 docs/module-lib_airdrop_management_user_balance-AdjustAirdropAmountKlass.html delete mode 100644 docs/module-lib_airdrop_management_user_balance-AirdropUserBalanceKlass.html delete mode 100644 docs/module-lib_airdrop_management_user_balance.html delete mode 100644 docs/module-lib_cache_management_airdrop_cache-AirdropBalanceCache.html delete mode 100644 docs/module-lib_cache_management_airdrop_cache.html delete mode 100644 docs/module-lib_cache_management_balance_cache-BalanceCache.html delete mode 100644 docs/module-lib_cache_management_balance_cache.html delete mode 100644 docs/module-lib_cache_management_pricer_cache-PricerCache.html delete mode 100644 docs/module-lib_cache_management_pricer_cache.html delete mode 100644 docs/module-lib_contract_interact_airdrop-Airdrop.html delete mode 100644 docs/module-lib_contract_interact_airdrop.html delete mode 100644 docs/module-lib_contract_interact_branded_token-BrandedToken.html delete mode 100644 docs/module-lib_contract_interact_branded_token.html delete mode 100644 docs/module-lib_contract_interact_helper-ContractInteractHelper.html delete mode 100644 docs/module-lib_contract_interact_helper.html delete mode 100644 docs/module-lib_contract_interact_ops_managed_contract-OpsManagedContract.html delete mode 100644 docs/module-lib_contract_interact_ops_managed_contract.html delete mode 100644 docs/module-lib_contract_interact_owned_contract-OwnedContract.html delete mode 100644 docs/module-lib_contract_interact_owned_contract.html delete mode 100644 docs/module-lib_contract_interact_pricer-MockToken.html delete mode 100644 docs/module-lib_contract_interact_pricer-Pricer.html delete mode 100644 docs/module-lib_contract_interact_pricer.html delete mode 100644 docs/module-lib_contract_interact_workers-Workers.html delete mode 100644 docs/module-lib_contract_interact_workers.html delete mode 100644 docs/module-lib_deployer-Deploy.html delete mode 100644 docs/module-lib_deployer.html delete mode 100644 docs/module-lib_query_builder_mysql-MySQLQueryBuilderKlass.html delete mode 100644 docs/module-lib_query_builder_mysql.html delete mode 100644 docs/module-lib_set_worker_and_ops-SetWorkerOps.html delete mode 100644 docs/module-lib_set_worker_and_ops.html delete mode 100644 docs/module-lib_transaction_helper-TransactionHelper.html delete mode 100644 docs/module-lib_transaction_helper.html delete mode 100644 docs/module-lib_web3_events_formatter-web3EventsDecoder.html delete mode 100644 docs/module-lib_web3_events_formatter-web3EventsFormatter.html delete mode 100644 docs/module-lib_web3_events_formatter.html delete mode 100644 docs/module-tools_deploy_DeployHelper.html delete mode 100644 docs/module-tools_deploy_EIP20TokenMock.html delete mode 100644 docs/module-tools_deploy_helper.html delete mode 100644 docs/module-tools_deploy_pricer.html delete mode 100644 docs/module-tools_deploy_workers.html delete mode 100644 docs/modules.list.html delete mode 100644 docs/namespaces.list.html delete mode 100644 docs/quicksearch.html delete mode 100644 docs/scripts/docstrap.lib.js delete mode 100644 docs/scripts/fulltext-search-ui.js delete mode 100644 docs/scripts/fulltext-search.js delete mode 100644 docs/scripts/lunr.min.js delete mode 100644 docs/scripts/prettify/Apache-License-2.0.txt delete mode 100644 docs/scripts/prettify/jquery.min.js delete mode 100644 docs/scripts/prettify/lang-css.js delete mode 100644 docs/scripts/prettify/prettify.js delete mode 100644 docs/scripts/sunlight.js delete mode 100644 docs/scripts/toc.js delete mode 100644 docs/styles/darkstrap.css delete mode 100644 docs/styles/prettify-tomorrow.css delete mode 100644 docs/styles/site.cerulean.css delete mode 100644 docs/styles/site.cosmo.css delete mode 100644 docs/styles/site.cyborg.css delete mode 100644 docs/styles/site.darkly.css delete mode 100644 docs/styles/site.darkstrap.css delete mode 100644 docs/styles/site.dibs-bootstrap.css delete mode 100644 docs/styles/site.flatly.css delete mode 100644 docs/styles/site.journal.css delete mode 100644 docs/styles/site.lumen.css delete mode 100644 docs/styles/site.paper.css delete mode 100644 docs/styles/site.readable.css delete mode 100644 docs/styles/site.sandstone.css delete mode 100644 docs/styles/site.simplex.css delete mode 100644 docs/styles/site.slate.css delete mode 100644 docs/styles/site.spacelab.css delete mode 100644 docs/styles/site.superhero.css delete mode 100644 docs/styles/site.united.css delete mode 100644 docs/styles/site.yeti.css delete mode 100644 docs/styles/sunlight.dark.css delete mode 100644 docs/styles/sunlight.default.css delete mode 100644 docs/userAirdropDetailCache.html create mode 100644 lib/web3/providers/ws.js delete mode 100644 mocha_test/scripts/nohup.out diff --git a/.travis.yml b/.travis.yml index bccdfeb..df3066b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,7 +23,7 @@ before_install: - sudo apt-get install software-properties-common - sudo add-apt-repository -y ppa:ethereum/ethereum - sudo apt-get update - - sudo apt-get install ethereum + - sudo bash mocha_test/scripts/install_geth_1_7_3.sh - sudo apt-get install solc - geth version install: diff --git a/README.md b/README.md index 5f203bb..09f7a47 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,7 @@ sh start_test_chain.sh ```bash export OST_UTILITY_GETH_RPC_PROVIDER='' +export OST_UTILITY_GETH_WS_PROVIDER='' export OST_UTILITY_DEPLOYER_ADDR='' export OST_UTILITY_DEPLOYER_PASSPHRASE='' export OST_UTILITY_OPS_ADDR='' diff --git a/config/core_constants.js b/config/core_constants.js index eb6ac87..4d3ba21 100644 --- a/config/core_constants.js +++ b/config/core_constants.js @@ -16,10 +16,11 @@ function define(name, value) { }); } //Cache engine -define('CACHING_ENGINE', process.env.OST_CACHING_ENGINE), +define('CACHING_ENGINE', process.env.OST_CACHING_ENGINE); // Geth define('OST_UTILITY_GETH_RPC_PROVIDER', process.env.OST_UTILITY_GETH_RPC_PROVIDER); +define('OST_UTILITY_GETH_WS_PROVIDER', process.env.OST_UTILITY_GETH_WS_PROVIDER); // Gas limit define('OST_GAS_LIMIT', 9000000); define('OST_PAY_GAS_LIMIT', 150000); diff --git a/docs/baseCacheMultiManagementKlass.html b/docs/baseCacheMultiManagementKlass.html deleted file mode 100644 index 284a793..0000000 --- a/docs/baseCacheMultiManagementKlass.html +++ /dev/null @@ -1,1137 +0,0 @@ - - - - - - - OpenST Payments Class: baseCacheMultiManagementKlass - - - - - - - - - - - - - -
-
- - -
- -
- - -

Class: baseCacheMultiManagementKlass

-
- -
- -

- baseCacheMultiManagementKlass -

- - -
- - -
-
- - -
-
-

new baseCacheMultiManagementKlass(params)

- - -
-
- - -
- constructor -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
params - - -Object - - - - - cache key generation & expiry related params
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- - -
- - - - - - - - - - - - - - -

Methods

- -
- -
-
-

_fetchFromCache()

- - -
-
- - -
- fetch from cache -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -Object - - - -
-
- - - - - -
- - - -
-
-

_setCache(dataToSet)

- - -
-
- - -
- set data in cache. -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
dataToSet - - -Object - - - - - data to set in cache
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -Result - - - -
-
- - - - - -
- - - -
-
-

clear()

- - -
-
- - -
- clear cache -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -Promise.<Result> - - - -
-
- - - - - -
- - - -
-
-

fetch()

- - -
-
- - -
- Fetch data from cache, in case of cache miss calls sub class method to fetch data from source -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
- - On success, data.value has value. On failure, error details returned. -
- - - -
-
- Type -
-
- -Promise.<Result> - - - -
-
- - - - - -
- - - -
-
-

fetchDataFromSource()

- - -
-
- - -
- fetch data from source -return should be of klass Result -data attr of return is returned and set in cache -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -Result - - - -
-
- - - - - -
- - - -
-
-

setCacheExpiry()

- - -
-
- - -
- set cache expiry in oThis.cacheExpiry and return it -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -Number - - - -
-
- - - - - -
- - - -
-
-

setCacheKeys()

- - -
-
- - -
- set cache keys in oThis.cacheKeys and return it -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -String - - - -
-
- - - - - -
- -
- - - - - -
- -
- - - - -
-
- -
- - -
- -
- - -
-
- - - - - -
- - - - - - OpenST Foundation Ltd. - - - - Documentation generated by JSDoc 3.5.5 - - using the DocStrap template. - -
- - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/classes.list.html b/docs/classes.list.html deleted file mode 100644 index d73d5c4..0000000 --- a/docs/classes.list.html +++ /dev/null @@ -1,396 +0,0 @@ - - - - - - - OpenST Payments Classes - - - - - - - - - - - - - -
-
- - -
- -
- - -

Classes

-
- -
- -

- -

- - -
- - -
-
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - -

Classes

- -
-
baseCacheMultiManagementKlass
-
- -
BasicHelperKlass
-
- -
approve
-
- -
base
-
- -
batchAllocator
-
- -
register
-
- -
transfer
-
- -
AdjustAirdropAmountKlass
-
- -
AirdropUserBalanceKlass
-
- -
AirdropBalanceCache
-
- -
BalanceCache
-
- -
PricerCache
-
- -
Airdrop
-
- -
BrandedToken
-
- -
ContractInteractHelper
-
- -
OpsManagedContract
-
- -
OwnedContract
-
- -
MockToken
-
- -
Pricer
-
- -
Workers
-
- -
Deploy
-
- -
MySQLQueryBuilderKlass
-
- -
SetWorkerOps
-
- -
TransactionHelper
-
- -
userAirdropDetailCache
-
-
- - - - - -

Namespaces

- -
-
web3EventsDecoder
-
- -
web3EventsFormatter
-
-
- - - - - - - - - -
- -
- - - - -
-
- -
- - -
- -
- - -
-
- - - - - -
- - - - - - OpenST Foundation Ltd. - - - - Documentation generated by JSDoc 3.5.5 - - using the DocStrap template. - -
- - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/fonts/glyphicons-halflings-regular.eot b/docs/fonts/glyphicons-halflings-regular.eot deleted file mode 100644 index b93a4953fff68df523aa7656497ee339d6026d64..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 20127 zcma%hV{j!vx9y2-`@~L8?1^pLwlPU2wr$&<*tR|KBoo`2;LUg6eW-eW-tKDb)vH%` z^`A!Vd<6hNSRMcX|Cb;E|1qflDggj6Kmr)xA10^t-vIc3*Z+F{r%|K(GyE^?|I{=9 zNq`(c8=wS`0!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76@BT(bjsjwS+r) zvx=lGNLv1?SzZ;P)Gnn>04fO7Culg*?LmbEF0fATG8S@)oJ>NT3pYAXa*vX!eUTDF ziBrp(QyDqr0ZMTr?4uG_Nqs6f%S0g?h`1vO5fo=5S&u#wI2d4+3hWiolEU!=3_oFo zfie?+4W#`;1dd#X@g9Yj<53S<6OB!TM8w8})7k-$&q5(smc%;r z(BlXkTp`C47+%4JA{2X}MIaPbVF!35P#p;u7+fR*46{T+LR8+j25oduCfDzDv6R-hU{TVVo9fz?^N3ShMt!t0NsH)pB zRK8-S{Dn*y3b|k^*?_B70<2gHt==l7c&cT>r`C#{S}J2;s#d{M)ncW(#Y$C*lByLQ z&?+{dR7*gpdT~(1;M(FfF==3z`^eW)=5a9RqvF-)2?S-(G zhS;p(u~_qBum*q}On@$#08}ynd0+spzyVco0%G6;<-i5&016cV5UKzhQ~)fX03|>L z8ej+HzzgVr6_5ZUpa4HW0Ca!=r1%*}Oo;2no&Zz8DfR)L!@r<5 z2viSZpmvo5XqXyAz{Ms7`7kX>fnr1gi4X~7KpznRT0{Xc5Cfz@43PjBMBoH@z_{~( z(Wd}IPJ9hH+%)Fc)0!hrV+(A;76rhtI|YHbEDeERV~Ya>SQg^IvlazFkSK(KG9&{q zkPIR~EeQaaBmwA<20}mBO?)N$(z1@p)5?%}rM| zGF()~Z&Kx@OIDRI$d0T8;JX@vj3^2%pd_+@l9~a4lntZ;AvUIjqIZbuNTR6@hNJoV zk4F;ut)LN4ARuyn2M6F~eg-e#UH%2P;8uPGFW^vq1vj8mdIayFOZo(tphk8C7hpT~ z1Fv8?b_LNR3QD9J+!v=p%}# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/fonts/glyphicons-halflings-regular.ttf b/docs/fonts/glyphicons-halflings-regular.ttf deleted file mode 100644 index 1413fc609ab6f21774de0cb7e01360095584f65b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 45404 zcmd?Sd0-pWwLh*qi$?oCk~i6sWlOeWJC3|4juU5JNSu9hSVACzERcmjLV&P^utNzg zIE4Kr1=5g!SxTX#Ern9_%4&01rlrW`Z!56xXTGQR4C z3vR~wXq>NDx$c~e?;ia3YjJ*$!C>69a?2$lLyhpI!CFfJsP=|`8@K0|bbMpWwVUEygg0=0x_)HeHpGSJagJNLA3c!$EuOV>j$wi! zbo{vZ(s8tl>@!?}dmNHXo)ABy7ohD7_1G-P@SdJWT8*oeyBVYVW9*vn}&VI4q++W;Z+uz=QTK}^C75!`aFYCX# zf7fC2;o`%!huaTNJAB&VWrx=szU=VLhwnbT`vc<#<`4WI6n_x@AofA~2d90o?1L3w z9!I|#P*NQ)$#9aASijuw>JRld^-t)Zhmy|i-`Iam|IWkguaMR%lhi4p~cX-9& zjfbx}yz}s`4-6>D^+6FzihR)Y!GsUy=_MWi_v7y#KmYi-{iZ+s@ekkq!@Wxz!~BQwiI&ti z>hC&iBe2m(dpNVvSbZe3DVgl(dxHt-k@{xv;&`^c8GJY%&^LpM;}7)B;5Qg5J^E${ z7z~k8eWOucjX6)7q1a%EVtmnND8cclz8R1=X4W@D8IDeUGXxEWe&p>Z*voO0u_2!! zj3dT(Ki+4E;uykKi*yr?w6!BW2FD55PD6SMj`OfBLwXL5EA-9KjpMo4*5Eqs^>4&> z8PezAcn!9jk-h-Oo!E9EjX8W6@EkTHeI<@AY{f|5fMW<-Ez-z)xCvW3()Z#x0oydB zzm4MzY^NdpIF9qMp-jU;99LjlgY@@s+=z`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azRQEqWDKT2zIEbjSYdCPi1ZOGz80Nsl}gxO^DWMY0AV<2K&OL{&^6#@L1?lXu#6xSMh%3^5c*}oM6DQGY#(a^@z<&D zF(43I9e&5`h|A$5!+UFuOH0>F3$shBV4`0#M4RSB8=6F0ZgIbq<2LQ$Hh^(kAJu=! zt8ZGXTacD{(3W{V1$j_{Jc)Ka7t6u}ho`4kF+4@t_0!mCBn z)}o%eA}L)_L?=jw6BIfll7tb3n}?*yLt&XADa=rW>qz=_6s9ziOd5sXjil>FVFx3r zf>Feewk0v#W9>Gp4GacTRr>Sd2T6dWi-{YX`v!D)kCWzG5xQB=?es5ON(%nkwUhNl zV>@xkWWWv*N+{e$(SrExvN6BXzU(Hxlx27{VYHf+LpIbTO+Yu(ltMk<;)3A(LU@ytVYFkYvTa79idMtUFhfxx?P!)2F`prNWW#Fub#l>N2s@nh&n_ zA4{#}|AIs9|A4P0ZF%fy=hDN!t#ifH<)4u2kirK~JUpjQ-J+~cXOZI&dIts;P}UeXslP6zKvpEKSN-$y>kJ^nw2tC9bv zo(|lT@?vZ!{_l|d^8Yh)eEBh*5ABh+Lzjw+?V)o z#P-W7361>E(Y4;@`sv;VKn G`u_lkUM?>H diff --git a/docs/fonts/glyphicons-halflings-regular.woff2 b/docs/fonts/glyphicons-halflings-regular.woff2 deleted file mode 100644 index 64539b54c3751a6d9adb44c8e3a45ba5a73b77f0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 18028 zcmV(~K+nH-Pew8T0RR9107h&84*&oF0I^&E07eM_0Rl|`00000000000000000000 z0000#Mn+Uk92y`7U;vDA2m}!b3WBL5f#qcZHUcCAhI9*rFaQJ~1&1OBl~F%;WnyLq z8)b|&?3j;$^FW}&KmNW53flIFARDZ7_Wz%hpoWaWlgHTHEHf()GI0&dMi#DFPaEt6 zCO)z0v0~C~q&0zBj^;=tv8q{$8JxX)>_`b}WQGgXi46R*CHJ}6r+;}OrvwA{_SY+o zK)H-vy{l!P`+NG*`*x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zI1=qo#zjy#2{hLT_*aj<618qQ7mD#k2ZFGou&69;=2 z1j7=Su8k}{L*h&mfs7jg^PN&9C1Z@U!p6gXk&-7xM~{X`nqH#aGO`;Xy_zbz^rYacIq0AH%4!Oh93TzJ820%ur)8OyeS@K?sF1V(iFO z37Nnqj1z#1{|v7=_CX`lQA|$<1gtuNMHGNJYp1D_k;WQk-b+T6VmUK(x=bWviOZ~T z|4e%SpuaWLWD?qN2%`S*`P;BQBw(B__wTD6epvGdJ+>DBq2oVlf&F*lz+#avb4)3P1c^Mf#olQheVvZ|Z5 z>xXfgmv!5Z^SYn+_x}K5B%G^sRwiez&z9|f!E!#oJlT2kCOV0000$L_|bHBqAarB4TD{W@grX1CUr72@caw0faEd7-K|4L_|cawbojjHdpd6 zI6~Iv5J?-Q4*&oF000000FV;^004t70Z6Qk1Xl{X9oJ{sRC2(cs?- diff --git a/docs/global.html b/docs/global.html deleted file mode 100644 index 7a82c15..0000000 --- a/docs/global.html +++ /dev/null @@ -1,375 +0,0 @@ - - - - - - - OpenST Payments Global - - - - - - - - - - - - - -
-
- - -
- -
- - -

Global

-
- -
- -

- -

- - -
- - -
-
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - - - - - - - -

Members

- -
- -
-
-

<constant> rootPrefix

- - -
-
- -
- List of all addresses and there respective abi, bin, passphrase -required for platform. - -And helper methods to access this information using human readable -names. -
- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
- -
- - - - - - - -
- -
- - - - -
-
- -
- - -
- -
- - -
-
- - - - - -
- - - - - - OpenST Foundation Ltd. - - - - Documentation generated by JSDoc 3.5.5 - - using the DocStrap template. - -
- - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/img/glyphicons-halflings-white.png b/docs/img/glyphicons-halflings-white.png deleted file mode 100644 index 3bf6484a29d8da269f9bc874b25493a45fae3bae..0000000000000000000000000000000000000000 GIT binary patch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YZ3uqkk2C(E7@A|3YI`ozP~9Lexx#*1(r8luq+YPk z{J}c$s` zPM35Fx(YWB3Z5IYnN+L_4|jaR(5iWJi2~l&xy}aU7kW?o-V*6Av2wyZTG!E2KSW2* zGRLQkQU;Oz##ie-Z4fI)WSRxn$(ZcD;TL+;^r=a4(G~H3ZhK$lSXZj?cvyY8%d9JM zzc3#pD^W_QnWy#rx#;c&N@sqHhrnHRmj#i;s%zLm6SE(n&BWpd&f7>XnjV}OlZntI70fq%8~9<7 zMYaw`E-rp49-oC1N_uZTo)Cu%RR2QWdHpzQIcNsoDp`3xfP+`gI?tVQZ4X={qU?(n zV>0ASES^Xuc;9JBji{)RnFL(Lez;8XbB1uWaMp@p?7xhXk6V#!6B@aP4Rz7-K%a>i z?fvf}va_DGUXlI#4--`A3qK7J?-HwnG7O~H2;zR~RLW)_^#La!=}+>KW#anZ{|^D3 B7G?kd diff --git a/docs/img/glyphicons-halflings.png b/docs/img/glyphicons-halflings.png deleted file mode 100644 index a9969993201f9cee63cf9f49217646347297b643..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12799 zcma*OWmH^Ivn@*S;K3nSf_t!#;0f+&pm7Po8`nk}2q8f5;M%x$SdAkd9FAvlc$ zx660V9e3Ox@4WZ^?7jZ%QFGU-T~%||Ug4iK6bbQY@zBuF2$hxOw9wF=A)nUSxR_5@ zEX>HBryGrjyuOFFv$Y4<+|3H@gQfEqD<)+}a~mryD|1U9*I_FOG&F%+Ww{SJ-V2BR zjt<81Ek$}Yb*95D4RS0HCps|uLyovt;P05hchQb-u2bzLtmog&f2}1VlNhxXV);S9 zM2buBg~!q9PtF)&KGRgf3#z7B(hm5WlNClaCWFs!-P!4-u*u5+=+D|ZE9e`KvhTHT zJBnLwGM%!u&vlE%1ytJ=!xt~y_YkFLQb6bS!E+s8l7PiPGSt9xrmg?LV&&SL?J~cI zS(e9TF1?SGyh+M_p@o1dyWu7o7_6p;N6hO!;4~ z2B`I;y`;$ZdtB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CQk9zV(?C9+i*>w z21+KYt1gXX&0`x3E)hS7I5}snbBzox9C@Xzcr|{B8Hw;SY1$}&BoYKXH^hpjW-RgJ z-Fb}tannKCv>y~^`r|(1Q9;+sZlYf3XPSX|^gR01UFtu$B*R;$sPZdIZShRr>|b@J z;#G{EdoY+O;REEjQ}X7_YzWLO+Ey3>a_KDe1CjSe| z6arqcEZ)CX!8r(si`dqbF$uu&pnf^Np{1f*TdJ`r2;@SaZ z#hb4xlaCA@Pwqj#LlUEe5L{I$k(Zj$d3(~)u(F%&xb8={N9hKxlZIO1ABsM{Mt|)2 zJ^t9Id;?%4PfR4&Ph9B9cFK~@tG3wlFW-0fXZS_L4U*EiAA%+`h%q2^6BCC;t0iO4V=s4Qug{M|iDV@s zC7|ef-dxiR7T&Mpre!%hiUhHM%3Qxi$Lzw6&(Tvlx9QA_7LhYq<(o~=Y>3ka-zrQa zhGpfFK@)#)rtfz61w35^sN1=IFw&Oc!Nah+8@qhJ0UEGr;JplaxOGI82OVqZHsqfX ze1}r{jy;G?&}Da}a7>SCDsFDuzuseeCKof|Dz2BPsP8? zY;a)Tkr2P~0^2BeO?wnzF_Ul-ekY=-w26VnU%U3f19Z-pj&2 z4J_a|o4Dci+MO)mPQIM>kdPG1xydiR9@#8m zh27D7GF{p|a{8({Q-Pr-;#jV{2zHR>lGoFtIfIpoMo?exuQyX_A;;l0AP4!)JEM$EwMInZkj+8*IHP4vKRd zKx_l-i*>A*C@{u%ct`y~s6MWAfO{@FPIX&sg8H{GMDc{4M3%$@c8&RAlw0-R<4DO3 trJqdc$mBpWeznn?E0M$F`|3v=`3%T2A17h;rxP7$%JLd=6(2u;`(N3pt&so# diff --git a/docs/index.html b/docs/index.html deleted file mode 100644 index 7df5100..0000000 --- a/docs/index.html +++ /dev/null @@ -1,304 +0,0 @@ - - - - - - - OpenST Payments Index - - - - - - - - - - - - - -
-
- - -
- -
- - - - - - - - - - - - - - - - - - - - - - -
-

OpenST Payments - Advance Payment infrastructure on top of the OpenST network

Latest version -Travis -Downloads per month -Gitter: JOIN CHAT

-

While OpenST 0.9 is available as-is for anyone to use, we caution that this is early stage software and under heavy ongoing development and improvement. Please report bugs and suggested improvements.

-

Install OpenST Payments

npm install @openstfoundation/openst-payments --save

Run Test Chain

cd mocha_test/scripts/
-sh start_test_chain.sh

Set EVN Variables

Setup Initial Setup Variables:

export OST_UTILITY_GETH_RPC_PROVIDER=''
-export OST_UTILITY_DEPLOYER_ADDR=''
-export OST_UTILITY_DEPLOYER_PASSPHRASE=''
-export OST_UTILITY_OPS_ADDR=''
-export OST_UTILITY_OPS_PASSPHRASE=''

Deploy Branded Token Contract:

node tools/deploy/EIP20TokenMock.js conversionRate symbol name decimals gasPrice

Deploy Workers Contract:

node tools/deploy/workers.js gasPrice chainId

Deploy Airdrop Contract:

node tools/deploy/airdrop.js brandedTokenContractAddress baseCurrency workerContractAddress airdropBudgetHolder gasPrice chainId

Set Caching Engine:

export OST_CACHING_ENGINE='none'
-For using redis/memcache as cache engine refer - [OpenSTFoundation/ost-price-oracle](https://github.com/OpenSTFoundation/ost-price-oracle)

Set DB Details For Payments/Airdrop:

export OP_MYSQL_HOST=''
-export OP_MYSQL_USER=''
-export OP_MYSQL_PASSWORD=''
-export OP_MYSQL_DATABASE=''
-export OP_MYSQL_CONNECTION_POOL_SIZE='5'

Create Airdrop Tables:

node migrations/create_tables.js 

Example:

const OpenSTPayment = require('@openstfoundation/openst-payments')
-  , deployer = new OpenSTPayment.deployer()
-  , opsManaged = new OpenSTPayment.opsManaged(contractAddress, gasPrice, chainId)
-  , workers = new OpenSTPayment.worker(workerContractAddress, chainId)
-  , airdrop = new OpenSTPayment.airdrop(airdropContractAddress, chainId)
-  , airdropManager = OpenSTPayment.airdropManager
-;  
-  // Deploy Contract
-  deployer.deploy( contractName, constructorArgs, gasPrice, options);
-  // Register Airdrop
-  airdropManager.registerAirdrop(airdropContractAddress, chainId);
-  // Set Ops Address
-  opsManaged.setOpsAddress(deployerAddress, deployerPassphrase, opsAddress, options);
-  // Set Worker
-  workers.setWorker(senderAddress, senderPassphrase, workerAddress, deactivationHeight, gasPrice, options);
-  // Set Price Oracle
-  airdrop.setPriceOracle(senderAddress, senderPassphrase, currency, address, gasPrice, options);
-  // Set Accepted Margin
-  airdrop.setAcceptedMargin(senderAddress, senderPassphrase, currency, acceptedMargin, gasPrice, options);
-  // Transfer Amount to airdrop budget holder
-  airdropManager.transfer(senderAddress, senderPassphrase, airdropContractAddress, amount, gasPrice, chainId, options);
-  // Approve airdrop budget holder
-  airdropManager.approve(airdropContractAddress, airdropBudgetHolderPassphrase, gasPrice, chainId, options);
-  // Allocate airdrop amount to users in batch
-  airdropManager.batchAllocate(airdropContractAddress, transactionHash, airdropUsers, chainId);
-  // Get Users Airdrop Balance
-  airdropManager.getAirdropBalance(chainId, airdropContractAddress, userAddresses);
-  // Call Pay method
-  airdrop.pay(workerAddress,
-              WorkerPassphrase,
-              beneficiaryAddress,
-              transferAmount,
-              commissionBeneficiaryAddress,
-              commissionAmount,
-              currency,
-              intendedPricePoint,
-              spender,
-              gasPrice,
-              {tag:'airdrop.pay', returnType: 'txHash'});

For further implementation details, please refer to the API documentation.

-
- - - - - - - -
-
- -
- - -
- -
- - -
-
- - - - - -
- - - - - - OpenST Foundation Ltd. - - - - Documentation generated by JSDoc 3.5.5 - - using the DocStrap template. - -
- - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/module-helpers_basic_helper-BasicHelperKlass.html b/docs/module-helpers_basic_helper-BasicHelperKlass.html deleted file mode 100644 index bdc1135..0000000 --- a/docs/module-helpers_basic_helper-BasicHelperKlass.html +++ /dev/null @@ -1,2419 +0,0 @@ - - - - - - - OpenST Payments Class: BasicHelperKlass - - - - - - - - - - - - - -
-
- - -
- -
- - -

Class: BasicHelperKlass

-
- -
- -

- helpers/basic_helper~ - - BasicHelperKlass -

- - -
- - -
-
- - -
-
-

new BasicHelperKlass()

- - -
-
- - -
- Basic helper methods constructor -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- - -
- - - - - - - - - - - - - - -

Methods

- -
- -
-
-

convertToBigNumber(amountInWei)

- - -
-
- - -
- Convert number to big number. Make sure it's a valid number -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
amountInWei - - -number - - - - - amount in wei to be formatted
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -BigNumber - - - -
-
- - - - - -
- - - -
-
-

formatWeiToString(amountInWei)

- - -
-
- - -
- Convert wei to proper string. Make sure it's a valid number -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
amountInWei - - -number - - - - - amount in wei to be formatted
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -string - - - -
-
- - - - - -
- - - -
-
-

getReturnType(returnType)

- - -
-
- - -
- get return type for transaction -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
returnType - - -string - - - - - return from geth transactions when following event is received
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -string - - - -
-
- - - - - -
- - - -
-
-

isAddressValid(address)

- - -
-
- - -
- Check if address is valid or not -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
address - - -string - - - - - Address
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -boolean - - - -
-
- - - - - -
- - - -
-
-

isBTConversionRateValid(conversionRate)

- - -
-
- - -
- Check if branded token conversion rate is valid or not -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
conversionRate - - -number - - - - - Branded token conversion rate
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -boolean - - - -
-
- - - - - -
- - - -
-
-

isBTNameValid(name)

- - -
-
- - -
- Check if branded token name is valid or not -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
name - - -string - - - - - Branded token name
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -boolean - - - -
-
- - - - - -
- - - -
-
-

isBTSymbolValid(symbol)

- - -
-
- - -
- Check if branded token symbol is valid or not -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
symbol - - -string - - - - - Branded token symbol
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -boolean - - - -
-
- - - - - -
- - - -
-
-

isNonZeroWeiValid(amountInWei)

- - -
-
- - -
- Check if amount is valid wei number and not zero -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
amountInWei - - -number - - - - - amount in wei
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -boolean - - - -
-
- - - - - -
- - - -
-
-

isReturnTypeTxHash(returnType)

- - -
-
- - -
- check if return type is txHash or not -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
returnType - - -string - - - - - return type
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -boolean - - - -
-
- - - - - -
- - - -
-
-

isReturnTypeTxReceipt(returnType)

- - -
-
- - -
- check if return type is txReceipt or not -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
returnType - - -string - - - - - return type
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -boolean - - - -
-
- - - - - -
- - - -
-
-

isReturnTypeUUID(returnType)

- - -
-
- - -
- check if return type is uuid or not -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
returnType - - -string - - - - - return type
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -boolean - - - -
-
- - - - - -
- - - -
-
-

isTxHashValid(transactionHash)

- - -
-
- - -
- Check if transaction hash is valid or not -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
transactionHash - - -string - - - - - Transaction hash
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -boolean - - - -
-
- - - - - -
- - - -
-
-

isUuidValid(uuid)

- - -
-
- - -
- Check if uuid is valid or not -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
uuid - - -string - - - - - Branded Token UUID
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -boolean - - - -
-
- - - - - -
- - - -
-
-

isValidChainId(chainId)

- - -
-
- - -
- Check if chainId is valid -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chainId - - -Number - - - - - chainId
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -Bool - - - -
-
- - - - - -
- -
- - - - - -
- -
- - - - -
-
- -
- - -
- -
- - -
-
- - - - - -
- - - - - - OpenST Foundation Ltd. - - - - Documentation generated by JSDoc 3.5.5 - - using the DocStrap template. - -
- - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/module-helpers_basic_helper.html b/docs/module-helpers_basic_helper.html deleted file mode 100644 index f06aca7..0000000 --- a/docs/module-helpers_basic_helper.html +++ /dev/null @@ -1,311 +0,0 @@ - - - - - - - OpenST Payments Module: helpers/basic_helper - - - - - - - - - - - - - -
-
- - -
- -
- - -

Module: helpers/basic_helper

-
- -
- -
- - -
-
- - -
Perform basic validations
- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - -

Classes

- -
-
BasicHelperKlass
-
-
- - - - - - - - - - - - - -
- -
- - - - -
-
- -
- - -
- -
- - -
-
- - - - - -
- - - - - - OpenST Foundation Ltd. - - - - Documentation generated by JSDoc 3.5.5 - - using the DocStrap template. - -
- - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/module-lib_airdrop_management_approve-approve.html b/docs/module-lib_airdrop_management_approve-approve.html deleted file mode 100644 index bc91d23..0000000 --- a/docs/module-lib_airdrop_management_approve-approve.html +++ /dev/null @@ -1,807 +0,0 @@ - - - - - - - OpenST Payments Class: approve - - - - - - - - - - - - - -
-
- - -
- -
- - -

Class: approve

-
- -
- -

- lib/airdrop_management/approve~ - - approve -

- - -
- - -
-
- - -
-
-

new approve(airdropContractAddress, airdropBudgetHolderPassphrase, gasPrice, chainId, options)

- - -
-
- - -
- Constructor to create object of approve -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
airdropContractAddress - - -Hex - - - - - airdrop contract address
airdropBudgetHolderPassphrase - - -String - - - - - airdropBudgetHolder Passphrase
gasPrice - - -String - - - - - gas price
chainId - - -Number - - - - - chain Id
options - - -Object - - - - - chain Id
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -Object - - - -
-
- - - - - -
- - -
- - - - - - - - - - - - - - -

Methods

- -
- -
-
-

doApprove()

- - -
-
- - -
- Perform Approve to airdrop budget holder -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -Promise - - - -
-
- - - - - -
- - - -
-
-

perform()

- - -
-
- - -
- Perform approve by airdrop budget holder to contract -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -Promise - - - -
-
- - - - - -
- - - -
-
-

validateParams()

- - -
-
- - -
- Validate params -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -Promise - - - -
-
- - - - - -
- -
- - - - - -
- -
- - - - -
-
- -
- - -
- -
- - -
-
- - - - - -
- - - - - - OpenST Foundation Ltd. - - - - Documentation generated by JSDoc 3.5.5 - - using the DocStrap template. - -
- - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/module-lib_airdrop_management_approve.html b/docs/module-lib_airdrop_management_approve.html deleted file mode 100644 index a8a2ad2..0000000 --- a/docs/module-lib_airdrop_management_approve.html +++ /dev/null @@ -1,311 +0,0 @@ - - - - - - - OpenST Payments Module: lib/airdrop_management/approve - - - - - - - - - - - - - -
-
- - -
- -
- - -

Module: lib/airdrop_management/approve

-
- -
- -
- - -
-
- - -
This is a utility file which would be used for executing approve by airdrop budget holder.

- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - -

Classes

- -
-
approve
-
-
- - - - - - - - - - - - - -
- -
- - - - -
-
- -
- - -
- -
- - -
-
- - - - - -
- - - - - - OpenST Foundation Ltd. - - - - Documentation generated by JSDoc 3.5.5 - - using the DocStrap template. - -
- - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/module-lib_airdrop_management_base-base.html b/docs/module-lib_airdrop_management_base-base.html deleted file mode 100644 index 3539446..0000000 --- a/docs/module-lib_airdrop_management_base-base.html +++ /dev/null @@ -1,1478 +0,0 @@ - - - - - - - OpenST Payments Class: base - - - - - - - - - - - - - -
-
- - -
- -
- - -

Class: base

-
- -
- -

- lib/airdrop_management/base~ - - base -

- - -
- - -
-
- - -
-
-

new base()

- - -
-
- - -
- Constructor to create object of base -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- - -
- - - - - - - - - - - - - - -

Methods

- -
- -
-
-

approve(airdropContractAddress, airdropBudgetHolderPassphrase, gasPrice, chainId, options)

- - -
-
- - -
- approve airdrop amount to airdrop contract address -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
airdropContractAddress - - -Hex - - - - - airdrop contract address
airdropBudgetHolderPassphrase - - -string - - - - - passphrase
gasPrice - - -Hex - - - - - gasPrice
chainId - - -Number - - - - - chainId
options - - -Object - - - - - options e.g. {returnType: '', tag: ''}
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -Promise - - - -
-
- - - - - -
- - - -
-
-

batchAllocate(airdropContractAddress, transactionHash, airdropUsers, chainId)

- - -
-
- - -
- batch allocate to users -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
airdropContractAddress - - -Hex - - - - - airdrop contract address
transactionHash - - -Hex - - - - - transfer transaction hash
airdropUsers - - -Object - - - - - airdropUsers => {address: {airdropAmount:2, expiryTimestamp: timestamp}}
chainId - - -Number - - - - - chainId
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -response - - - -
-
- - - - - -
- - - -
-
-

getAirdropBalance(chainId, airdropContractAddress, userAddresses)

- - -
-
- - -
- Get user airdrop balance -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chainId - - -Integer - - - - - chain Id
airdropContractAddress - - -Hex - - - - - airdrop contract address
userAddresses - - -Array - - - - - array of user addresses
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
- - { - '0x934ebd34b2a4f16d4de16256df36a6013785557d': {totalAirdropAmount: '10000000000000000', totalAirdropUsedAmount: '10000000000000000', balanceAirdropAmount: '10000000000000000'}, - '0x934ebd34b2a4f16d4de16256df36a6013785557e': {totalAirdropAmount: '20000000000000000', totalAirdropUsedAmount: '20000000000000000', balanceAirdropAmount: '10000000000000000'} -} -
- - - -
-
- Type -
-
- -response - - - -
-
- - - - - -
- - - -
-
-

registerAirdrop(airdropContractAddress, chainId)

- - -
-
- - -
- Register Airdrop -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
airdropContractAddress - - -Hex - - - - - airdrop contract address
chainId - - -Number - - - - - chain Id
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -Promise - - - -
-
- - - - - -
- - - -
-
-

transfer(senderAddress, senderPassphrase, airdropContractAddress, amount, gasPrice, chainId, options)

- - -
-
- - -
- Transfer airdrop amount to airdrop budget holder -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
senderAddress - - -Hex - - - - - Sender Address
senderPassphrase - - -string - - - - - passphrase
airdropContractAddress - - -Hex - - - - - airdrop contract address
amount - - -BigNumber - - - - - amount to transfer
gasPrice - - -Hex - - - - - gasPrice
chainId - - -Number - - - - - chainId
options - - -Object - - - - - options e.g. {returnType: '', tag: ''}
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -Promise - - - -
-
- - - - - -
- -
- - - - - -
- -
- - - - -
-
- -
- - -
- -
- - -
-
- - - - - -
- - - - - - OpenST Foundation Ltd. - - - - Documentation generated by JSDoc 3.5.5 - - using the DocStrap template. - -
- - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/module-lib_airdrop_management_base.html b/docs/module-lib_airdrop_management_base.html deleted file mode 100644 index c16fc3a..0000000 --- a/docs/module-lib_airdrop_management_base.html +++ /dev/null @@ -1,311 +0,0 @@ - - - - - - - OpenST Payments Module: lib/airdrop_management/base - - - - - - - - - - - - - -
-
- - -
- -
- - -

Module: lib/airdrop_management/base

-
- -
- -
- - -
-
- - -
This is a utility file which would be used for executing all methods related to airdrop.

- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - -

Classes

- -
-
base
-
-
- - - - - - - - - - - - - -
- -
- - - - -
-
- -
- - -
- -
- - -
-
- - - - - -
- - - - - - OpenST Foundation Ltd. - - - - Documentation generated by JSDoc 3.5.5 - - using the DocStrap template. - -
- - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/module-lib_airdrop_management_batch_allocator-batchAllocator.html b/docs/module-lib_airdrop_management_batch_allocator-batchAllocator.html deleted file mode 100644 index 8c5e4eb..0000000 --- a/docs/module-lib_airdrop_management_batch_allocator-batchAllocator.html +++ /dev/null @@ -1,881 +0,0 @@ - - - - - - - OpenST Payments Class: batchAllocator - - - - - - - - - - - - - -
-
- - -
- -
- - -

Class: batchAllocator

-
- -
- -

- lib/airdrop_management/batch_allocator~ - - batchAllocator -

- - -
- - -
-
- - -
-
-

new batchAllocator(airdropContractAddress, transactionHash, airdropUsers, chainId)

- - -
-
- - -
- Constructor to create object of batch allocator -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
airdropContractAddress - - -Hex - - - - - airdrop contract address
transactionHash - - -Hex - - - - - airdrop transfer transactio hash
airdropUsers - - -Object - - - - - {userAddress: {airdropAmount: inwei, expiryTimestamp: 0}}
chainId - - -Number - - - - - chain ID
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -Object - - - -
-
- - - - - -
- - -
- - - - - - - - - - - - - - -

Methods

- -
- -
-
-

allocateAirdropAmountToUsers()

- - -
-
- - -
- Allocate airdrop amount to users -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -Promise - - - -
-
- - - - - -
- - - -
-
-

clearCache()

- - -
-
- - -
- Clear all users cache -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -nil - - - -
-
- - - - - -
- - - -
-
-

perform()

- - -
-
- - -
- Perform batch allocation to airdrop users -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -Promise - - - -
-
- - - - - -
- - - -
-
-

validateParams()

- - -
-
- - -
- Validate params -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -Promise - - - -
-
- - - - - -
- -
- - - - - -
- -
- - - - -
-
- -
- - -
- -
- - -
-
- - - - - -
- - - - - - OpenST Foundation Ltd. - - - - Documentation generated by JSDoc 3.5.5 - - using the DocStrap template. - -
- - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/module-lib_airdrop_management_batch_allocator.html b/docs/module-lib_airdrop_management_batch_allocator.html deleted file mode 100644 index 306ca28..0000000 --- a/docs/module-lib_airdrop_management_batch_allocator.html +++ /dev/null @@ -1,311 +0,0 @@ - - - - - - - OpenST Payments Module: lib/airdrop_management/batch_allocator - - - - - - - - - - - - - -
-
- - -
- -
- - -

Module: lib/airdrop_management/batch_allocator

-
- -
- -
- - -
-
- - -
This is a utility file which would be used for allocating amount to airdrop users.

- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - -

Classes

- -
-
batchAllocator
-
-
- - - - - - - - - - - - - -
- -
- - - - -
-
- -
- - -
- -
- - -
-
- - - - - -
- - - - - - OpenST Foundation Ltd. - - - - Documentation generated by JSDoc 3.5.5 - - using the DocStrap template. - -
- - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/module-lib_airdrop_management_register-register.html b/docs/module-lib_airdrop_management_register-register.html deleted file mode 100644 index 8b27abf..0000000 --- a/docs/module-lib_airdrop_management_register-register.html +++ /dev/null @@ -1,735 +0,0 @@ - - - - - - - OpenST Payments Class: register - - - - - - - - - - - - - -
-
- - -
- -
- - -

Class: register

-
- -
- -

- lib/airdrop_management/register~ - - register -

- - -
- - -
-
- - -
-
-

new register(airdropContractAddress, chainId)

- - -
-
- - -
- Constructor to create object of register -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
airdropContractAddress - - -Hex - - - - - airdrop contract address
chainId - - -Number - - - - - chain Id
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -Object - - - -
-
- - - - - -
- - -
- - - - - - - - - - - - - - -

Methods

- -
- -
-
-

perform()

- - -
-
- - -
- Perform method -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -responseHelper - - - -
-
- - - - - -
- - - -
-
-

runRegister()

- - -
-
- - -
- Run the register -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

validateParams()

- - -
-
- - -
- Validation of params -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- -
- - - - - -
- -
- - - - -
-
- -
- - -
- -
- - -
-
- - - - - -
- - - - - - OpenST Foundation Ltd. - - - - Documentation generated by JSDoc 3.5.5 - - using the DocStrap template. - -
- - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/module-lib_airdrop_management_register.html b/docs/module-lib_airdrop_management_register.html deleted file mode 100644 index 3cf66b5..0000000 --- a/docs/module-lib_airdrop_management_register.html +++ /dev/null @@ -1,311 +0,0 @@ - - - - - - - OpenST Payments Module: lib/airdrop_management/register - - - - - - - - - - - - - -
-
- - -
- -
- - -

Module: lib/airdrop_management/register

-
- -
- -
- - -
-
- - -
This class would be used for executing airdrop register.

- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - -

Classes

- -
-
register
-
-
- - - - - - - - - - - - - -
- -
- - - - -
-
- -
- - -
- -
- - -
-
- - - - - -
- - - - - - OpenST Foundation Ltd. - - - - Documentation generated by JSDoc 3.5.5 - - using the DocStrap template. - -
- - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/module-lib_airdrop_management_transfer-transfer.html b/docs/module-lib_airdrop_management_transfer-transfer.html deleted file mode 100644 index 5b04245..0000000 --- a/docs/module-lib_airdrop_management_transfer-transfer.html +++ /dev/null @@ -1,855 +0,0 @@ - - - - - - - OpenST Payments Class: transfer - - - - - - - - - - - - - -
-
- - -
- -
- - -

Class: transfer

-
- -
- -

- lib/airdrop_management/transfer~ - - transfer -

- - -
- - -
-
- - -
-
-

new transfer(senderAddress, senderPassphrase, airdropContractAddress, amount, gasPrice, chainId, options)

- - -
-
- - -
- Constructor to create object of transfer -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
senderAddress - - -Hex - - - - - sender address
senderPassphrase - - -String - - - - - sender Passphrase
airdropContractAddress - - -Hex - - - - - airdrop contract address
amount - - -String - - - - - amount in wei
gasPrice - - -String - - - - - gas price
chainId - - -Number - - - - - chain Id
options - - -Object - - - - - chain Id
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -Object - - - -
-
- - - - - -
- - -
- - - - - - - - - - - - - - -

Methods

- -
- -
-
-

doTransfer()

- - -
-
- - -
- Transfer amount to airdrop budget holder -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -Promise - - - -
-
- - - - - -
- - - -
-
-

perform()

- - -
-
- - -
- Perform method -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -Promise - - - -
-
- - - - - -
- - - -
-
-

validateParams()

- - -
-
- - -
- validation of params -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -Promise - - - -
-
- - - - - -
- -
- - - - - -
- -
- - - - -
-
- -
- - -
- -
- - -
-
- - - - - -
- - - - - - OpenST Foundation Ltd. - - - - Documentation generated by JSDoc 3.5.5 - - using the DocStrap template. - -
- - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/module-lib_airdrop_management_transfer.html b/docs/module-lib_airdrop_management_transfer.html deleted file mode 100644 index dd6ef9a..0000000 --- a/docs/module-lib_airdrop_management_transfer.html +++ /dev/null @@ -1,311 +0,0 @@ - - - - - - - OpenST Payments Module: lib/airdrop_management/transfer - - - - - - - - - - - - - -
-
- - -
- -
- - -

Module: lib/airdrop_management/transfer

-
- -
- -
- - -
-
- - -
This is a utility file which would be used for executing transfer amount to airdrop budget holder.

- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - -

Classes

- -
-
transfer
-
-
- - - - - - - - - - - - - -
- -
- - - - -
-
- -
- - -
- -
- - -
-
- - - - - -
- - - - - - OpenST Foundation Ltd. - - - - Documentation generated by JSDoc 3.5.5 - - using the DocStrap template. - -
- - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/module-lib_airdrop_management_user_balance-AdjustAirdropAmountKlass.html b/docs/module-lib_airdrop_management_user_balance-AdjustAirdropAmountKlass.html deleted file mode 100644 index 9435744..0000000 --- a/docs/module-lib_airdrop_management_user_balance-AdjustAirdropAmountKlass.html +++ /dev/null @@ -1,831 +0,0 @@ - - - - - - - OpenST Payments Class: AdjustAirdropAmountKlass - - - - - - - - - - - - - -
-
- - -
- -
- - -

Class: AdjustAirdropAmountKlass

-
- -
- -

- lib/airdrop_management/user_balance~ - - AdjustAirdropAmountKlass -

- - -
- - -
-
- - -
-
-

new AdjustAirdropAmountKlass(airdropContractAddress, userAddress, airdropAmountUsed)

- - -
-
- - -
- Constructor to create object of userBalance -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
airdropContractAddress - - -Hex - - - - - airdrop contract address
userAddress - - -Array - - - - - Array of user addressed
airdropAmountUsed - - -BigNumber - - - - - used airdrop amount
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -Object - - - -
-
- - - - - -
- - -
- - - - - - - - - - - - - - -

Methods

- -
- -
-
-

creditAirdropUsedAmount()

- - -
-
- - -
- Credit airdrop used amount. decreases airdrop_used_amount of user_airdrop_details table -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -Promise - - - -
-
- - - - - -
- - - -
-
-

debitAirdropUsedAmount()

- - -
-
- - -
- Debit airdrop used amount -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -Promise - - - -
-
- - - - - -
- - - -
-
-

rollbackCreditAirdropAdjustedAmount()

- - -
-
- - -
- Rollback credit airdrop used amount -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - - - - - -
- - - -
-
-

rollbackDebitAirdropAdjustedAmount()

- - -
-
- - -
- Rollback debit airdrop used amount -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - - - - - -
- -
- - - - - -
- -
- - - - -
-
- -
- - -
- -
- - -
-
- - - - - -
- - - - - - OpenST Foundation Ltd. - - - - Documentation generated by JSDoc 3.5.5 - - using the DocStrap template. - -
- - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/module-lib_airdrop_management_user_balance-AirdropUserBalanceKlass.html b/docs/module-lib_airdrop_management_user_balance-AirdropUserBalanceKlass.html deleted file mode 100644 index d15a2a1..0000000 --- a/docs/module-lib_airdrop_management_user_balance-AirdropUserBalanceKlass.html +++ /dev/null @@ -1,759 +0,0 @@ - - - - - - - OpenST Payments Class: AirdropUserBalanceKlass - - - - - - - - - - - - - -
-
- - -
- -
- - -

Class: AirdropUserBalanceKlass

-
- -
- -

- lib/airdrop_management/user_balance~ - - AirdropUserBalanceKlass -

- - -
- - -
-
- - -
-
-

new AirdropUserBalanceKlass(chainId, airdropContractAddress, userAddresses)

- - -
-
- - -
- Constructor to create object of userBalance -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chainId - - -Number - - - - - chain Id
airdropContractAddress - - -Hex - - - - - airdrop contract address
userAddresses - - -Array - - - - - Array of user addressed
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -Object - - - -
-
- - - - - -
- - -
- - - - - - - - - - - - - - -

Methods

- -
- -
-
-

getUserAirdropBalance()

- - -
-
- - -
- Run the register -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -Promise - - - -
-
- - - - - -
- - - -
-
-

perform()

- - -
-
- - -
- Perform method -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -responseHelper - - - -
-
- - - - - -
- - - -
-
-

validateParams()

- - -
-
- - -
- Validation of params -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -Promise - - - -
-
- - - - - -
- -
- - - - - -
- -
- - - - -
-
- -
- - -
- -
- - -
-
- - - - - -
- - - - - - OpenST Foundation Ltd. - - - - Documentation generated by JSDoc 3.5.5 - - using the DocStrap template. - -
- - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/module-lib_airdrop_management_user_balance.html b/docs/module-lib_airdrop_management_user_balance.html deleted file mode 100644 index 22b8b0f..0000000 --- a/docs/module-lib_airdrop_management_user_balance.html +++ /dev/null @@ -1,407 +0,0 @@ - - - - - - - OpenST Payments Module: lib/airdrop_management/user_balance - - - - - - - - - - - - - -
-
- - -
- -
- - -

Module: lib/airdrop_management/user_balance

-
- -
- -
- - -
-
- - -
This class would be used for calculating user airdrop balance.

- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - -

Classes

- -
-
AdjustAirdropAmountKlass
-
- -
AirdropUserBalanceKlass
-
-
- - - - - - - - - - - - - -
- -
- - - - -

Module: lib/airdrop_management/user_balance

-
- -
- -
- - -
-
- - -
This class would be used for calculating user airdrop balance.

- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - -

Classes

- -
-
AdjustAirdropAmountKlass
-
- -
AirdropUserBalanceKlass
-
-
- - - - - - - - - - - - - -
- -
- - - - -
-
- -
- - -
- -
- - -
-
- - - - - -
- - - - - - OpenST Foundation Ltd. - - - - Documentation generated by JSDoc 3.5.5 - - using the DocStrap template. - -
- - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/module-lib_cache_management_airdrop_cache-AirdropBalanceCache.html b/docs/module-lib_cache_management_airdrop_cache-AirdropBalanceCache.html deleted file mode 100644 index 9d21a17..0000000 --- a/docs/module-lib_cache_management_airdrop_cache-AirdropBalanceCache.html +++ /dev/null @@ -1,428 +0,0 @@ - - - - - - - OpenST Payments Class: AirdropBalanceCache - - - - - - - - - - - - - -
-
- - -
- -
- - -

Class: AirdropBalanceCache

-
- -
- -

- lib/cache_management/airdrop_cache~ - - AirdropBalanceCache -

- - -
- - -
-
- - -
-
-

new AirdropBalanceCache(chainId, airdropAddress)

- - -
-
- - -
- constructor -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chainId - - -string - - - - - Chain id
airdropAddress - - -string - - - - - address of airdrop contract
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- - -
- - -

Extends

- - - - -
    -
  • PricerCacheKlass
  • -
- - - - - - - - - - - - - - - - - - - -
- -
- - - - -
-
- -
- - -
- -
- - -
-
- - - - - -
- - - - - - OpenST Foundation Ltd. - - - - Documentation generated by JSDoc 3.5.5 - - using the DocStrap template. - -
- - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/module-lib_cache_management_airdrop_cache.html b/docs/module-lib_cache_management_airdrop_cache.html deleted file mode 100644 index 27af12a..0000000 --- a/docs/module-lib_cache_management_airdrop_cache.html +++ /dev/null @@ -1,311 +0,0 @@ - - - - - - - OpenST Payments Module: lib/cache_management/airdrop_cache - - - - - - - - - - - - - -
-
- - -
- -
- - -

Module: lib/cache_management/airdrop_cache

-
- -
- -
- - -
-
- - -
This is cache layer for airdrop balance related caching

- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - -

Classes

- -
-
AirdropBalanceCache
-
-
- - - - - - - - - - - - - -
- -
- - - - -
-
- -
- - -
- -
- - -
-
- - - - - -
- - - - - - OpenST Foundation Ltd. - - - - Documentation generated by JSDoc 3.5.5 - - using the DocStrap template. - -
- - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/module-lib_cache_management_balance_cache-BalanceCache.html b/docs/module-lib_cache_management_balance_cache-BalanceCache.html deleted file mode 100644 index 91fc800..0000000 --- a/docs/module-lib_cache_management_balance_cache-BalanceCache.html +++ /dev/null @@ -1,889 +0,0 @@ - - - - - - - OpenST Payments Class: BalanceCache - - - - - - - - - - - - - -
-
- - -
- -
- - -

Class: BalanceCache

-
- -
- -

- lib/cache_management/balance_cache~ - - BalanceCache -

- - -
- - -
-
- - -
-
-

new BalanceCache(chainId, brandedTokenAddress)

- - -
-
- - -
- constructor -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chainId - - -string - - - - - Chain id
brandedTokenAddress - - -string - - - - - address of branded token contract
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- - -
- - - - - - - - - - - - - - -

Methods

- -
- -
-
-

clearBalance(owner)

- - -
-
- - -
- Clear balance from cache -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
owner - - -string - - - - - address of user whose balance is to be set
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

getBalance(owner)

- - -
-
- - -
- Get balance from cache -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
owner - - -string - - - - - address of user whose balance is to be found
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

setBalance(owner, balance)

- - -
-
- - -
- Set balance to cache -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
owner - - -string - - - - - address of user whose balance is to be set
balance - - -BigNumber - - - - - balance of the user
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- -
- - - - - -
- -
- - - - -
-
- -
- - -
- -
- - -
-
- - - - - -
- - - - - - OpenST Foundation Ltd. - - - - Documentation generated by JSDoc 3.5.5 - - using the DocStrap template. - -
- - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/module-lib_cache_management_balance_cache.html b/docs/module-lib_cache_management_balance_cache.html deleted file mode 100644 index 0ea4d9c..0000000 --- a/docs/module-lib_cache_management_balance_cache.html +++ /dev/null @@ -1,311 +0,0 @@ - - - - - - - OpenST Payments Module: lib/cache_management/balance_cache - - - - - - - - - - - - - -
-
- - -
- -
- - -

Module: lib/cache_management/balance_cache

-
- -
- -
- - -
-
- - -
This is cache layer for balance related caching

- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - -

Classes

- -
-
BalanceCache
-
-
- - - - - - - - - - - - - -
- -
- - - - -
-
- -
- - -
- -
- - -
-
- - - - - -
- - - - - - OpenST Foundation Ltd. - - - - Documentation generated by JSDoc 3.5.5 - - using the DocStrap template. - -
- - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/module-lib_cache_management_pricer_cache-PricerCache.html b/docs/module-lib_cache_management_pricer_cache-PricerCache.html deleted file mode 100644 index 14a3808..0000000 --- a/docs/module-lib_cache_management_pricer_cache-PricerCache.html +++ /dev/null @@ -1,3891 +0,0 @@ - - - - - - - OpenST Payments Class: PricerCache - - - - - - - - - - - - - -
-
- - -
- -
- - -

Class: PricerCache

-
- -
- -

- lib/cache_management/pricer_cache~ - - PricerCache -

- - -
- - -
-
- - -
-
-

new PricerCache(chainId, contractAddress)

- - -
-
- - -
- constructor -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chainId - - -string - - - - - Chain id
contractAddress - - -string - - - - - address of pricer/airdrop contract
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- - -
- - - - - - - - - - - - - - -

Methods

- -
- -
-
-

clearAcceptedMargins(currency)

- - -
-
- - -
- reset accepted margin cache -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
currency - - -string - - - - - currency
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

clearBrandedTokenAddress(brandedTokenAddress)

- - -
-
- - -
- clear branded token address cache -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
brandedTokenAddress - - -string - - - - - branded token address
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

clearCache(key)

- - -
-
- - -
- Clear cache for given key -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
key - - -string - - - - - cache key
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

clearConversionRate()

- - -
-
- - -
- Clear conversion rate from cache -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

clearConversionRateDecimals()

- - -
-
- - -
- Clear conversion rate decimals from cache -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

clearDecimals()

- - -
-
- - -
- clear decimals from cache -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

clearPriceOracles(currency, address)

- - -
-
- - -
- Clear price oracle address for given currency in cache -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
currency - - -string - - - - - currency
address - - -string - - - - - price oracle address
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

clearPricePoint(address)

- - -
-
- - -
- Clear price point of price oracle from cache -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
address - - -string - - - - - price oracle address
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

getAcceptedMargins(currency)

- - -
-
- - -
- Get accepted margin -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
currency - - -string - - - - - currency
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

getBrandedTokenAddress()

- - -
-
- - -
- Get branded token address for pricer -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

getCacheKey(owner)

- - -
-
- - -
- Get conversion rate for pricer -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
owner - - -string - - - - - address of user whose balance is to be found
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

getCacheValue(key)

- - -
-
- - -
- Get cached value -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
key - - -string - - - - - key
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

getConversionRate()

- - -
-
- - -
- Get conversion rate for pricer -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

getConversionRateDecimals()

- - -
-
- - -
- Get conversion rate decimals for pricer -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

getDecimals()

- - -
-
- - -
- Get decimals for pricer -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

getPriceOracles(currency)

- - -
-
- - -
- Get price oracle address for given currency from cache -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
currency - - -string - - - - - currency
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

getPricePoint(address)

- - -
-
- - -
- Get price point of price oracle from cache -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
address - - -string - - - - - price oracle address
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

setAcceptedMargins(currency, margin)

- - -
-
- - -
- Set accepted margin -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
currency - - -string - - - - - currency
margin - - -BigNumber - - - - - accepted margin value
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

setBrandedTokenAddress(brandedTokenAddress)

- - -
-
- - -
- Set branded token address for pricer -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
brandedTokenAddress - - -string - - - - - branded token address
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

setCacheValue(key, value)

- - -
-
- - -
- Set value in cache -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
key - - -string - - - - - key
value - - -string - - - - - value
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

setConversionRate(conversionRate)

- - -
-
- - -
- Set conversion rate to cache -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
conversionRate - - -BigNumber - - - - - conversion rate of pricer/airdrop
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

setConversionRateDecimals(conversionRateDecimals)

- - -
-
- - -
- Set conversion rate decimals to cache -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
conversionRateDecimals - - -BigNumber - - - - - conversion rate of pricer/airdrop
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

setDecimals(conversionRateDecimals)

- - -
-
- - -
- Set decimals to cache -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
conversionRateDecimals - - -BigNumber - - - - - conversion rate of pricer/airdrop
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

setPriceOracles(currency, address)

- - -
-
- - -
- Set price oracle address for given currency in cache -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
currency - - -string - - - - - currency
address - - -string - - - - - price oracle address
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

setPricePoint(pricePoint, address)

- - -
-
- - -
- Set price point of price oracle from cache -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
pricePoint - - -string - - - - - price oracle price point
address - - -string - - - - - price oracle address
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- -
- - - - - -
- -
- - - - -
-
- -
- - -
- -
- - -
-
- - - - - -
- - - - - - OpenST Foundation Ltd. - - - - Documentation generated by JSDoc 3.5.5 - - using the DocStrap template. - -
- - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/module-lib_cache_management_pricer_cache.html b/docs/module-lib_cache_management_pricer_cache.html deleted file mode 100644 index d7ca325..0000000 --- a/docs/module-lib_cache_management_pricer_cache.html +++ /dev/null @@ -1,311 +0,0 @@ - - - - - - - OpenST Payments Module: lib/cache_management/pricer_cache - - - - - - - - - - - - - -
-
- - -
- -
- - -

Module: lib/cache_management/pricer_cache

-
- -
- -
- - -
-
- - -
This is cache layer for pricer balance related caching

- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - -

Classes

- -
-
PricerCache
-
-
- - - - - - - - - - - - - -
- -
- - - - -
-
- -
- - -
- -
- - -
-
- - - - - -
- - - - - - OpenST Foundation Ltd. - - - - Documentation generated by JSDoc 3.5.5 - - using the DocStrap template. - -
- - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/module-lib_contract_interact_airdrop-Airdrop.html b/docs/module-lib_contract_interact_airdrop-Airdrop.html deleted file mode 100644 index fa5ff26..0000000 --- a/docs/module-lib_contract_interact_airdrop-Airdrop.html +++ /dev/null @@ -1,1075 +0,0 @@ - - - - - - - OpenST Payments Class: Airdrop - - - - - - - - - - - - - -
-
- - -
- -
- - -

Class: Airdrop

-
- -
- -

- lib/contract_interact/airdrop~ - - Airdrop -

- - -
- - -
-
- - -
-
-

new Airdrop(airdropContractAddress, chainId)

- - -
-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
airdropContractAddress - - -string - - - - - airdrop contract address
chainId - - -string - - - - - chain ID
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- - -
- - - - - - - - - - - - - - -

Methods

- -
- -
-
-

airdropBudgetHolder()

- - -
-
- - -
- Get airdrop budget holder address of airdrop -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

getAirdropBudgetHolderFromContract()

- - -
-
- - -
- Get airdrop budget holder address of airdrop from contract -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

getWorkers()

- - -
-
- - -
- Get worker contract address -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

pay(senderWorkerAddress, senderWorkerPassphrase, beneficiaryAddress, transferAmount, commissionBeneficiaryAddress, commissionAmount, currency, intendedPricePoint, spender, options)

- - -
-
- - -
- Pay -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
senderWorkerAddress - - -string - - - - - address of worker
senderWorkerPassphrase - - -string - - - - - passphrase of worker
beneficiaryAddress - - -string - - - - - address of beneficiary account
transferAmount - - -BigNumber - - - - - transfer amount (in wei)
commissionBeneficiaryAddress - - -string - - - - - address of commision beneficiary account
commissionAmount - - -BigNumber - - - - - commission amount (in wei)
currency - - -string - - - - - quote currency
intendedPricePoint - - -BigNumber - - - - - price point at which the pay is intended (in wei)
spender - - -string - - - - - User address
options - - -object - - - - - for params like returnType, tag.
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- -
- - - - - -
- -
- - - - -
-
- -
- - -
- -
- - -
-
- - - - - -
- - - - - - OpenST Foundation Ltd. - - - - Documentation generated by JSDoc 3.5.5 - - using the DocStrap template. - -
- - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/module-lib_contract_interact_airdrop.html b/docs/module-lib_contract_interact_airdrop.html deleted file mode 100644 index caa9b54..0000000 --- a/docs/module-lib_contract_interact_airdrop.html +++ /dev/null @@ -1,311 +0,0 @@ - - - - - - - OpenST Payments Module: lib/contract_interact/airdrop - - - - - - - - - - - - - -
-
- - -
- -
- - -

Module: lib/contract_interact/airdrop

-
- -
- -
- - -
-
- - -
This is a utility file which would be used for executing all methods on Pricer.sol contract.

- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - -

Classes

- -
-
Airdrop
-
-
- - - - - - - - - - - - - -
- -
- - - - -
-
- -
- - -
- -
- - -
-
- - - - - -
- - - - - - OpenST Foundation Ltd. - - - - Documentation generated by JSDoc 3.5.5 - - using the DocStrap template. - -
- - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/module-lib_contract_interact_branded_token-BrandedToken.html b/docs/module-lib_contract_interact_branded_token-BrandedToken.html deleted file mode 100644 index c54bcb8..0000000 --- a/docs/module-lib_contract_interact_branded_token-BrandedToken.html +++ /dev/null @@ -1,1953 +0,0 @@ - - - - - - - OpenST Payments Class: BrandedToken - - - - - - - - - - - - - -
-
- - -
- -
- - -

Class: BrandedToken

-
- -
- -

- lib/contract_interact/branded_token~ - - BrandedToken -

- - -
- - -
-
- - -
-
-

new BrandedToken(brandedTokenAddress, chainId)

- - -
-
- - -
- Constructor to create object of BrandedToken -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
brandedTokenAddress - - -string - - - - - Branded token address
chainId - - -number - - - - - chainId
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- - -
- - - - - - - - - - - - -

Members

- -
- -
-
-

balanceCache

- - -
-
- -
- balance cache -
- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
- - - -
-
-

brandedTokenAddress

- - -
-
- -
- branded token address -
- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
- - - -
-
-

chainId

- - -
-
- -
- chain id -
- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
- -
- - - -

Methods

- -
- -
-
-

approveByBudgetHolder(airdropBudgetHolderAddress, airdropBudgetHolderPassphrase, airdropContractAddress, amount, gasPrice, options)

- - -
-
- - -
- Approve amount to budget holder -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
airdropBudgetHolderAddress - - -string - - - - - address of airdropBudgetHolder
airdropBudgetHolderPassphrase - - -string - - - - - Passphrase of airdropBudgetHolder
airdropContractAddress - - -string - - - - - airdrop contract address
amount - - -BigNumber - - - - - amount in wei
gasPrice - - -BigNumber - - - - - gas price
options - - -object - - - - - for params like returnType, tag.
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

creditBalance(owner, bigAmount)

- - -
-
- - -
- Credit balance in cache -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
owner - - -string - - - - - Account address
bigAmount - - -BigNumber - - - - - amount to be credited
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

debitBalance(owner, bigAmount)

- - -
-
- - -
- Debit balance in cache -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
owner - - -string - - - - - Account address
bigAmount - - -BigNumber - - - - - amount to be debited
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

getBalanceFromContract(owner)

- - -
-
- - -
- Fetch Balance For a given address from contract -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
owner - - -string - - - - - address for which balance is to be fetched
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

getBalanceOf(owner)

- - -
-
- - -
- Fetch Balance For a given address -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
owner - - -string - - - - - address for which balance is to be fetched
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

setBalanceInCache(owner, bigAmount)

- - -
-
- - -
- Set balance in cache -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
owner - - -string - - - - - Account address
bigAmount - - -BigNumber - - - - - amount to be set
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

transferToAirdropBudgetHolder(senderAddress, senderPassphrase, airdropBudgetHolderAddress, amount, gasPrice, options)

- - -
-
- - -
- Transfer amount to budget holder -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
senderAddress - - -string - - - - - address of sender
senderPassphrase - - -string - - - - - passphrase of sender
airdropBudgetHolderAddress - - -string - - - - - recipient address
amount - - -BigNumber - - - - - amount in wei
gasPrice - - -BigNumber - - - - - gas price
options - - -object - - - - - for params like returnType, tag.
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- -
- - - - - -
- -
- - - - -
-
- -
- - -
- -
- - -
-
- - - - - -
- - - - - - OpenST Foundation Ltd. - - - - Documentation generated by JSDoc 3.5.5 - - using the DocStrap template. - -
- - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/module-lib_contract_interact_branded_token.html b/docs/module-lib_contract_interact_branded_token.html deleted file mode 100644 index dfe6183..0000000 --- a/docs/module-lib_contract_interact_branded_token.html +++ /dev/null @@ -1,311 +0,0 @@ - - - - - - - OpenST Payments Module: lib/contract_interact/branded_token - - - - - - - - - - - - - -
-
- - -
- -
- - -

Module: lib/contract_interact/branded_token

-
- -
- -
- - -
-
- - -
This is a utility file which would be used for executing all methods on EIP20Token contract.

- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - -

Classes

- -
-
BrandedToken
-
-
- - - - - - - - - - - - - -
- -
- - - - -
-
- -
- - -
- -
- - -
-
- - - - - -
- - - - - - OpenST Foundation Ltd. - - - - Documentation generated by JSDoc 3.5.5 - - using the DocStrap template. - -
- - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/module-lib_contract_interact_helper-ContractInteractHelper.html b/docs/module-lib_contract_interact_helper-ContractInteractHelper.html deleted file mode 100644 index fa1ed72..0000000 --- a/docs/module-lib_contract_interact_helper-ContractInteractHelper.html +++ /dev/null @@ -1,4009 +0,0 @@ - - - - - - - OpenST Payments Class: ContractInteractHelper - - - - - - - - - - - - - -
-
- - -
- -
- - -

Class: ContractInteractHelper

-
- -
- -

- lib/contract_interact/helper~ - - ContractInteractHelper -

- - -
- - -
-
- - -
-
-

new ContractInteractHelper()

- - -
-
- - -
- contract interact helper constructor -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- - -
- - - - - - - - - - - - - - -

Methods

- -
- -
-
-

call(web3RpcProvider, currContractAddr, encodeABI [, options] [, transactionOutputs])

- - -
-
- - -
- Call methods (execute methods which DO NOT modify state of contracts) -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeArgumentDescription
web3RpcProvider - - -object - - - - - - - - - - - It could be value chain or utility chain provider
currContractAddr - - -String - - - - - - - - - - - current contract address
encodeABI - - -Object - - - - - - - - - - - encoded method ABI data
options - - -Object - - - - - - - <optional>
- - - - - -
optional params
transactionOutputs - - -Object - - - - - - - <optional>
- - - - - -
optional transactionOutputs
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise - - - -
-
- - - - - -
- - - -
-
-

generateManagedKeyPassphrase()

- - -
-
- - -
- Stub method to generate managed key passphrase -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -String - - - -
-
- - - - - -
- - - -
-
-

getNotificationData(topics, publisher, method, contractName, contractAddress, web3RpcProvider, options)

- - -
-
- - -
- get notification event formatted data -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
topics - - -array - - - - - topics where the event will be published
publisher - - -String - - - - - publisher name
method - - -String - - - - - method name
contractName - - -String - - - - - name of contract
contractAddress - - -String - - - - - address of contract
web3RpcProvider - - -Object - - - - - address of contract
options - - -Object - - - - - options
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -Promise - - - -
-
- - - - - -
- - - -
-
-

getTransactionOutputs(transactionObject)

- - -
-
- - -
- get outputs of a given transaction -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
transactionObject - - -object - - - - - transactionObject is returned from call method.
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -array - - - -
-
- - - - - -
- - - -
-
-

getTransactionReceiptFromTrasactionHash(web3RpcProvider, transactionHash)

- - -
-
- - -
- Get transaction receipt -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
web3RpcProvider - - -Web3 - - - - - It could be value chain or utility chain provider
transactionHash - - -String - - - - - transaction hash
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -Promise - - - -
-
- - - - - -
- - - -
-
-

isDecimal(num)

- - -
-
- - -
- check if return type is true/false -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
num - - -Number - - - - - Number
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
- Note - Don't use for BigNumbers -
- - - -
-
- Type -
-
- -boolean - - - -
-
- - - - - -
- - - -
-
-

isValidCurrency(currency, allow_blank)

- - -
-
- - -
- valid currency -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
currency - - -string - - - - - currency
allow_blank - - -bool - - - - - true / false, '' if allow_blank is true
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
- - true / false -
- - - -
-
- Type -
-
- -Bool - - - -
-
- - - - - -
- - - -
-
-

performSend(Object, string, senderAddr)

- - -
-
- - -
- Perform send -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
Object - - -params - - - - - parmaters
string - - -returnType - - - - - return type
senderAddr - - -String - - - - - address of transaction's sender senderAddr
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -Promise - - - -
-
- - - - - -
- - - -
-
-

safeSend(web3RpcProvider, currContractAddr, senderName, encodeABI [, txOptions] [, addressToNameMap])

- - -
-
- - -
- Safe Send a transaction (this internally waits for transaction to be mined) -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeArgumentDescription
web3RpcProvider - - -Web3 - - - - - - - - - - - It could be value chain or utility chain provider
currContractAddr - - -String - - - - - - - - - - - current contract address
senderName - - -String - - - - - - - - - - - name of transaction's sender
encodeABI - - -Object - - - - - - - - - - - encoded method ABI data
txOptions - - -Object - - - - - - - <optional>
- - - - - -
optional txOptions
addressToNameMap - - -Object - - - - - - - <optional>
- - - - - -
optional addressToNameMap
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -Promise - - - -
-
- - - - - -
- - - -
-
-

safeSendFromAddr(web3RpcProvider, currContractAddr, senderAddr, senderPassphrase, encodeABI [, txOptions] [, addressToNameMap])

- - -
-
- - -
- Safe Send a transaction (this internally waits for transaction to be mined) -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeArgumentDescription
web3RpcProvider - - -Web3 - - - - - - - - - - - It could be value chain or utility chain provider
currContractAddr - - -String - - - - - - - - - - - current contract address
senderAddr - - -String - - - - - - - - - - - address of transaction's sender senderAddr
senderPassphrase - - -String - - - - - - - - - - - passphrase of
encodeABI - - -Object - - - - - - - - - - - encoded method ABI data
txOptions - - -Object - - - - - - - <optional>
- - - - - -
optional txOptions
addressToNameMap - - -Object - - - - - - - <optional>
- - - - - -
optional addressToNameMap
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -Promise - - - -
-
- - - - - -
- - - -
-
-

send(web3RpcProvider, currContractAddr, encodeABI [, options] [, transactionOutputs])

- - -
-
- - -
- Send methods (execute methods which modify state of a contracts) -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeArgumentDescription
web3RpcProvider - - -Web3 - - - - - - - - - - - It could be value chain or utility chain provider
currContractAddr - - -String - - - - - - - - - - - current contract address
encodeABI - - -Object - - - - - - - - - - - encoded method ABI data
options - - -Object - - - - - - - <optional>
- - - - - -
optional params
transactionOutputs - - -Object - - - - - - - <optional>
- - - - - -
optional transactionOutputs
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise - - - -
-
- - - - - -
- - - -
-
-

toAddress(web3RpcProvider, result)

- - -
-
- - -
- Decode result and typecast it to an Address -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
web3RpcProvider - - -Web3 - - - - - It could be value chain or utility chain provider
result - - -String - - - - - current contract address
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -Promise - - - -
-
- - - - - -
- - - -
-
-

toNumber(web3RpcProvider, result)

- - -
-
- - -
- Decode result and typecast it to a Number -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
web3RpcProvider - - -Web3 - - - - - It could be value chain or utility chain provider
result - - -String - - - - - current contract address
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -Promise - - - -
-
- - - - - -
- - - -
-
-

toString(web3RpcProvider, result)

- - -
-
- - -
- Decode result and typecast it to a String -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
web3RpcProvider - - -Web3 - - - - - It could be value chain or utility chain provider
result - - -String - - - - - current contract address
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -Promise - - - -
-
- - - - - -
- - - -
-
-

validateAirdropPayParams(senderAddress, beneficiaryAddress, transferAmount, commissionBeneficiaryAddress, commissionAmount, currency, intendedPricePoint, gasPrice, user)

- - -
-
- - -
- Validate Airdrop pay params -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
senderAddress - - -string - - - - - address of sender
beneficiaryAddress - - -string - - - - - address of beneficiary account
transferAmount - - -BigNumber - - - - - transfer amount (in wei)
commissionBeneficiaryAddress - - -string - - - - - address of commision beneficiary account
commissionAmount - - -BigNumber - - - - - commission amount (in wei)
currency - - -string - - - - - quote currency
intendedPricePoint - - -BigNumber - - - - - price point at which the pay is intended (in wei)
gasPrice - - -BigNumber - - - - - gas price
user - - -Hex - - - - - User address
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -Promise - - - -
-
- - - - - -
- - - -
-
-

validatePayParams(senderAddress, beneficiaryAddress, transferAmount, commissionBeneficiaryAddress, commissionAmount, currency, intendedPricePoint, gasPrice)

- - -
-
- - -
- Validate Airdrop params -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
senderAddress - - -string - - - - - address of sender
beneficiaryAddress - - -string - - - - - address of beneficiary account
transferAmount - - -BigNumber - - - - - transfer amount (in wei)
commissionBeneficiaryAddress - - -string - - - - - address of commision beneficiary account
commissionAmount - - -BigNumber - - - - - commission amount (in wei)
currency - - -string - - - - - quote currency
intendedPricePoint - - -BigNumber - - - - - price point at which the pay is intended (in wei)
gasPrice - - -BigNumber - - - - - gas price
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -Promise - - - -
-
- - - - - -
- -
- - - - - -
- -
- - - - -
-
- -
- - -
- -
- - -
-
- - - - - -
- - - - - - OpenST Foundation Ltd. - - - - Documentation generated by JSDoc 3.5.5 - - using the DocStrap template. - -
- - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/module-lib_contract_interact_helper.html b/docs/module-lib_contract_interact_helper.html deleted file mode 100644 index 036f913..0000000 --- a/docs/module-lib_contract_interact_helper.html +++ /dev/null @@ -1,311 +0,0 @@ - - - - - - - OpenST Payments Module: lib/contract_interact/helper - - - - - - - - - - - - - -
-
- - -
- -
- - -

Module: lib/contract_interact/helper

-
- -
- -
- - -
-
- - -
This is utility class for contract interacts

- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - -

Classes

- -
-
ContractInteractHelper
-
-
- - - - - - - - - - - - - -
- -
- - - - -
-
- -
- - -
- -
- - -
-
- - - - - -
- - - - - - OpenST Foundation Ltd. - - - - Documentation generated by JSDoc 3.5.5 - - using the DocStrap template. - -
- - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/module-lib_contract_interact_ops_managed_contract-OpsManagedContract.html b/docs/module-lib_contract_interact_ops_managed_contract-OpsManagedContract.html deleted file mode 100644 index 8c2f0cb..0000000 --- a/docs/module-lib_contract_interact_ops_managed_contract-OpsManagedContract.html +++ /dev/null @@ -1,774 +0,0 @@ - - - - - - - OpenST Payments Class: OpsManagedContract - - - - - - - - - - - - - -
-
- - -
- -
- - -

Class: OpsManagedContract

-
- -
- -

- lib/contract_interact/ops_managed_contract~ - - OpsManagedContract -

- - -
- - -
-
- - -
-
-

new OpsManagedContract(contractAddress, defaultGasPrice, chainId)

- - -
-
- - -
- Ops managed contract interact constructor -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
contractAddress - - -string - - - - - address where Contract has been deployed
defaultGasPrice - - -string - - - - - default Gas Price
chainId - - -number - - - - - chain id
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- - -
- - -

Extends

- - - - -
    -
  • OwnedContract
  • -
- - - - - - - - - - - - - - - -

Methods

- -
- -
-
-

getOpsAddress()

- - -
-
- - -
- Get currContract's Ops Address -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

setOpsAddress(senderAddress, senderPassphrase, opsAddress, options)

- - -
-
- - -
- Set currContract's Ops Address -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
senderAddress - - -string - - - - - Sender Address
senderPassphrase - - -String - - - - - Sender Passphrase
opsAddress - - -String - - - - - address which is to be made Ops Address of currContract
options - - -Object - - - - - options for this transaction
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- -
- - - - - -
- -
- - - - -
-
- -
- - -
- -
- - -
-
- - - - - -
- - - - - - OpenST Foundation Ltd. - - - - Documentation generated by JSDoc 3.5.5 - - using the DocStrap template. - -
- - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/module-lib_contract_interact_ops_managed_contract.html b/docs/module-lib_contract_interact_ops_managed_contract.html deleted file mode 100644 index 9c789ed..0000000 --- a/docs/module-lib_contract_interact_ops_managed_contract.html +++ /dev/null @@ -1,311 +0,0 @@ - - - - - - - OpenST Payments Module: lib/contract_interact/ops_managed_contract - - - - - - - - - - - - - -
-
- - -
- -
- - -

Module: lib/contract_interact/ops_managed_contract

-
- -
- -
- - -
-
- - -
This is a utility file which would be used for executing all methods on OpsManaged Contract.

- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - -

Classes

- -
-
OpsManagedContract
-
-
- - - - - - - - - - - - - -
- -
- - - - -
-
- -
- - -
- -
- - -
-
- - - - - -
- - - - - - OpenST Foundation Ltd. - - - - Documentation generated by JSDoc 3.5.5 - - using the DocStrap template. - -
- - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/module-lib_contract_interact_owned_contract-OwnedContract.html b/docs/module-lib_contract_interact_owned_contract-OwnedContract.html deleted file mode 100644 index 0d90df6..0000000 --- a/docs/module-lib_contract_interact_owned_contract-OwnedContract.html +++ /dev/null @@ -1,763 +0,0 @@ - - - - - - - OpenST Payments Class: OwnedContract - - - - - - - - - - - - - -
-
- - -
- -
- - -

Class: OwnedContract

-
- -
- -

- lib/contract_interact/owned_contract~ - - OwnedContract -

- - -
- - -
-
- - -
-
-

new OwnedContract(contractAddress, web3RpcProvider, currContract, defaultGasPrice)

- - -
-
- - -
- Owned contract interact constructor -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
contractAddress - - -String - - - - - address where Contract has been deployed
web3RpcProvider - - -String - - - - - webRpc provider of network where currContract has been deployed
currContract - - -String - - - - - Contract Instance
defaultGasPrice - - -String - - - - - default Gas Price
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- - -
- - - - - - - - - - - - - - -

Methods

- -
- -
-
-

getOwner()

- - -
-
- - -
- Get address of Owner of currContract -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<string> - - - -
-
- - - - - -
- - - -
-
-

initiateOwnerShipTransfer(senderName, proposedOwner, customOptions)

- - -
-
- - -
- Initiate Ownership of currContract -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
senderName - - -string - - - - - Sender of this Transaction
proposedOwner - - -string - - - - - address to which ownership needs to be transferred
customOptions - - -object - - - - - custom params of this transaction
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- -
- - - - - -
- -
- - - - -
-
- -
- - -
- -
- - -
-
- - - - - -
- - - - - - OpenST Foundation Ltd. - - - - Documentation generated by JSDoc 3.5.5 - - using the DocStrap template. - -
- - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/module-lib_contract_interact_owned_contract.html b/docs/module-lib_contract_interact_owned_contract.html deleted file mode 100644 index 29efa5c..0000000 --- a/docs/module-lib_contract_interact_owned_contract.html +++ /dev/null @@ -1,311 +0,0 @@ - - - - - - - OpenST Payments Module: lib/contract_interact/owned_contract - - - - - - - - - - - - - -
-
- - -
- -
- - -

Module: lib/contract_interact/owned_contract

-
- -
- -
- - -
-
- - -
This is a utility file which would be used for executing all methods on Owned Contract.

- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - -

Classes

- -
-
OwnedContract
-
-
- - - - - - - - - - - - - -
- -
- - - - -
-
- -
- - -
- -
- - -
-
- - - - - -
- - - - - - OpenST Foundation Ltd. - - - - Documentation generated by JSDoc 3.5.5 - - using the DocStrap template. - -
- - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/module-lib_contract_interact_pricer-MockToken.html b/docs/module-lib_contract_interact_pricer-MockToken.html deleted file mode 100644 index 9cc8086..0000000 --- a/docs/module-lib_contract_interact_pricer-MockToken.html +++ /dev/null @@ -1,1199 +0,0 @@ - - - - - - - OpenST Payments Class: MockToken - - - - - - - - - - - - - -
-
- - -
- -
- - -

Class: MockToken

-
- -
- -

- lib/contract_interact/pricer~ - - MockToken -

- - -
- - -
-
- - -
-
-

new MockToken()

- - -
-
- - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- - -
- - - - - - - - - - - - - - -

Methods

- -
- -
-
-

approve(senderAddr, senderPassphrase, spenderAddress, value, gasPrice)

- - -
-
- - -
- Approve -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
senderAddr - - -string - - - - - address of sender
senderPassphrase - - -string - - - - - passphrase of sender
spenderAddress - - -string - - - - - address which will be approved for spending
value - - -BigNumber - - - - - amount which is being approved (in wei)
gasPrice - - -BigNumber - - - - - gas price
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -Promise - - - -
-
- - - - - -
- - - -
-
-

balanceOf(ownerAddress)

- - -
-
- - -
- Get balance of address -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
ownerAddress - - -String - - - - - address for which balance is to be fetched
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -Promise - - - -
-
- - - - - -
- - - -
-
-

setBalance(senderAddr, senderPassphrase, ownerAddress, value, gasPrice)

- - -
-
- - -
- Set balance -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
senderAddr - - -string - - - - - address of user who is sending amount
senderPassphrase - - -string - - - - - sender address passphrase
ownerAddress - - -string - - - - - address for which balance is to be set
value - - -BigNumber - - - - - amount which is being transferred (in wei)
gasPrice - - -BigNumber - - - - - gas price
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -Promise - - - -
-
- - - - - -
- - - -
-
-

setConversionRate(senderAddr, senderPassphrase, conversionRate, gasPrice)

- - -
-
- - -
- Set conversion rate -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
senderAddr - - -string - - - - - address of sender
senderPassphrase - - -string - - - - - passphrase of sender
conversionRate - - -number - - - - - conversion rate of branded token
gasPrice - - -BigNumber - - - - - gas price
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -Promise - - - -
-
- - - - - -
- -
- - - - - -
- -
- - - - -
-
- -
- - -
- -
- - -
-
- - - - - -
- - - - - - OpenST Foundation Ltd. - - - - Documentation generated by JSDoc 3.5.5 - - using the DocStrap template. - -
- - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/module-lib_contract_interact_pricer-Pricer.html b/docs/module-lib_contract_interact_pricer-Pricer.html deleted file mode 100644 index 77e33ed..0000000 --- a/docs/module-lib_contract_interact_pricer-Pricer.html +++ /dev/null @@ -1,5207 +0,0 @@ - - - - - - - OpenST Payments Class: Pricer - - - - - - - - - - - - - -
-
- - -
- -
- - -

Class: Pricer

-
- -
- -

- lib/contract_interact/pricer~ - - Pricer -

- - -
- - -
-
- - -
-
-

new Pricer(pricerAddress, chainId)

- - -
-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
pricerAddress - - -string - - - - - Pricer contract address
chainId - - -string - - - - - chain ID
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- - -
- - - - - - - - - - - - - - -

Methods

- -
- -
-
-

acceptedMargins(currency)

- - -
-
- - -
- Get acceptable margin for the given currency -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
currency - - -string - - - - - quote currency
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

baseCurrency()

- - -
-
- - -
- Get base currency of pricer -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

brandedToken()

- - -
-
- - -
- Get branded token address of pricer from cache, if not found in cache get from contract -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

conversionRate()

- - -
-
- - -
- Get conversion rate of pricer -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

conversionRateDecimals()

- - -
-
- - -
- Get conversion rate decimals of pricer -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

decimals()

- - -
-
- - -
- Get decimal of pricer -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

getAcceptedMarginsFromContract(currency)

- - -
-
- - -
- Get acceptable margin for the given currency from contract -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
currency - - -string - - - - - quote currency
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

getBalanceOf(owner)

- - -
-
- - -
- Get balance of the account -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
owner - - -string - - - - - account address
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
- 10^18 -
- - - -
-
- Type -
-
- -BigNumer - - - -
-
- - - - - -
- - - -
-
-

getBrandedTokenAddressFromContract()

- - -
-
- - -
- Get branded token address of pricer from contract -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

getConversionRateDecimalsFromContract()

- - -
-
- - -
- Get conversion rate decimals of pricer from contract -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

getConversionRateFromContract()

- - -
-
- - -
- Get conversion rate of pricer from contract -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

getDecimalsFromContract()

- - -
-
- - -
- Get decimal of pricer from contract -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

getEstimatedTotalAmount(transferAmount, commissionAmount, intendedPricePoint)

- - -
-
- - -
- Get estimated total amount -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
transferAmount - - -BigNumber - - - - - Transfer amount
commissionAmount - - -BigNumber - - - - - Commission amount
intendedPricePoint - - -BigNumber - - - - - Intended price point
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -BigNumber - - - -
-
- - - - - -
- - - -
-
-

getPriceOraclesFromContract(currency)

- - -
-
- - -
- Get address of price oracle for the given currency from contract -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
currency - - -string - - - - - quote currency
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

getPricePoint(currency)

- - -
-
- - -
- Get current price point from the price oracle for the give currency -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
currency - - -string - - - - - quote currency
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

getPricePointAndCalculatedAmounts(transferAmount, commissionAmount, currency)

- - -
-
- - -
- Get current price point and calculated token amounts -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
transferAmount - - -BigNumber - - - - - transfer amount (in wei)
commissionAmount - - -BigNumber - - - - - commision amount (in wei)
currency - - -string - - - - - quote currency
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

getPricePointFromContract(currency)

- - -
-
- - -
- Get current price point from the price oracle for the give currency from contract -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
currency - - -string - - - - - quote currency
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

getTxReceipt(transactionHash)

- - -
-
- - -
- Get transaction receipt from transaction hash -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
transactionHash - - -string - - - - - transaction hash
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
- 10^18 -
- - - -
-
- Type -
-
- -BigNumer - - - -
-
- - - - - -
- - - -
-
-

pay(senderAddress, senderPassphrase, beneficiaryAddress, transferAmount, commissionBeneficiaryAddress, commissionAmount, currency, intendedPricePoint, gasPrice, options)

- - -
-
- - -
- Pay -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
senderAddress - - -string - - - - - address of sender
senderPassphrase - - -string - - - - - passphrase of sender
beneficiaryAddress - - -string - - - - - address of beneficiary account
transferAmount - - -BigNumber - - - - - transfer amount (in wei)
commissionBeneficiaryAddress - - -string - - - - - address of commision beneficiary account
commissionAmount - - -BigNumber - - - - - commission amount (in wei)
currency - - -string - - - - - quote currency
intendedPricePoint - - -BigNumber - - - - - price point at which the pay is intended (in wei)
gasPrice - - -BigNumber - - - - - gas price
options - - -object - - - - - for params like returnType, tag.
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

priceOracles(currency)

- - -
-
- - -
- Get address of price oracle for the given currency -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
currency - - -string - - - - - quote currency
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

setAcceptedMargin(senderAddress, senderPassphrase, currency, acceptedMargin, gasPrice, options)

- - -
-
- - -
- Set or update the acceptable margin range for a given currency -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
senderAddress - - -string - - - - - address of sender
senderPassphrase - - -string - - - - - passphrase of sender
currency - - -string - - - - - quote currency
acceptedMargin - - -BigNumber - - - - - accepted margin for the given currency (in wei)
gasPrice - - -BigNumber - - - - - gas price
options - - -object - - - - - for params like returnType, tag.
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

setAddressToNameMap()

- - -
-
- - -
- set address to name map -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

setPriceOracle(senderAddress, senderPassphrase, currency, address, gasPrice, options)

- - -
-
- - -
- Set or updates the price oracle address for a given currency -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
senderAddress - - -string - - - - - address of sender
senderPassphrase - - -string - - - - - passphrase of sender
currency - - -string - - - - - quote currency
address - - -string - - - - - address of price pracle
gasPrice - - -BigNumber - - - - - gas price
options - - -object - - - - - for params like returnType, tag.
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

setTokenObj()

- - -
-
- - -
- set token object -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

toWei(value)

- - -
-
- - -
- Convert value in wei -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
value - - -BigNumber - - - - - amount in decimal
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
- 10^18 -
- - - -
-
- Type -
-
- -BigNumer - - - -
-
- - - - - -
- - - -
-
-

unsetPriceOracle(senderAddress, senderPassphrase, currency, gasPrice, options)

- - -
-
- - -
- Remove the price oracle address for a given currency -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
senderAddress - - -string - - - - - address of sender
senderPassphrase - - -string - - - - - passphrase of sender
currency - - -string - - - - - quote currency
gasPrice - - -BigNumber - - - - - gas price
options - - -object - - - - - for params like returnType, tag.
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

validateSetAcceptedMarginParams(senderAddress, currency, acceptedMargin, gasPrice)

- - -
-
- - -
- Validate set accepted margin params parameters -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
senderAddress - - -string - - - - - address of sender
currency - - -string - - - - - quote currency
acceptedMargin - - -BigNumber - - - - - accepted margin for the given currency (in wei)
gasPrice - - -BigNumber - - - - - gas price
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -result - - - -
-
- - - - - -
- - - -
-
-

validateSetPriceOracleParams(senderAddress, currency, address, gasPrice)

- - -
-
- - -
- Validate set price oracle parameters -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
senderAddress - - -string - - - - - address of sender
currency - - -string - - - - - quote currency
address - - -string - - - - - address of price pracle
gasPrice - - -BigNumber - - - - - gas price
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -result - - - -
-
- - - - - -
- - - -
-
-

validateUnsetPriceOracleParams(senderAddress, currency, gasPrice)

- - -
-
- - -
- Validate unset price oracle parameters -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
senderAddress - - -string - - - - - address of sender
currency - - -string - - - - - quote currency
gasPrice - - -BigNumber - - - - - gas price
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

verifyReceiptAndUpdateAcceptedMarginCache(acceptedMargin, currency, receipt)

- - -
-
- - -
- Verify receipt and update accepted margin in cache -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
acceptedMargin - - -BigNumber - - - - - accepted margin for the given currency (in wei)
currency - - -string - - - - - quote currency
receipt - - -Object - - - - - transaction receipt
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- -
- - - - - -
- -
- - - - -
-
- -
- - -
- -
- - -
-
- - - - - -
- - - - - - OpenST Foundation Ltd. - - - - Documentation generated by JSDoc 3.5.5 - - using the DocStrap template. - -
- - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/module-lib_contract_interact_pricer.html b/docs/module-lib_contract_interact_pricer.html deleted file mode 100644 index a4199a3..0000000 --- a/docs/module-lib_contract_interact_pricer.html +++ /dev/null @@ -1,407 +0,0 @@ - - - - - - - OpenST Payments Module: lib/contract_interact/pricer - - - - - - - - - - - - - -
-
- - -
- -
- - -

Module: lib/contract_interact/pricer

-
- -
- -
- - -
-
- - -
This is a utility file which would be used for executing all methods on Pricer contract.

- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - -

Classes

- -
-
MockToken
-
- -
Pricer
-
-
- - - - - - - - - - - - - -
- -
- - - - -

Module: lib/contract_interact/pricer

-
- -
- -
- - -
-
- - -
This is a utility file which would be used for executing all methods on Pricer contract.

- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - -

Classes

- -
-
MockToken
-
- -
Pricer
-
-
- - - - - - - - - - - - - -
- -
- - - - -
-
- -
- - -
- -
- - -
-
- - - - - -
- - - - - - OpenST Foundation Ltd. - - - - Documentation generated by JSDoc 3.5.5 - - using the DocStrap template. - -
- - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/module-lib_contract_interact_workers-Workers.html b/docs/module-lib_contract_interact_workers-Workers.html deleted file mode 100644 index 7655d48..0000000 --- a/docs/module-lib_contract_interact_workers-Workers.html +++ /dev/null @@ -1,2038 +0,0 @@ - - - - - - - OpenST Payments Class: Workers - - - - - - - - - - - - - -
-
- - -
- -
- - -

Class: Workers

-
- -
- -

- lib/contract_interact/workers~ - - Workers -

- - -
- - -
-
- - -
-
-

new Workers(workerAddress, chainId)

- - -
-
- - -
- Workers contract interact class constructor -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
workerAddress - - -string - - - - - address of worker (external address)
chainId - - -number - - - - - chain id
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- - -
- - - - - - - - - - - - - - -

Methods

- -
- -
-
-

_validateRemoveParams(senderAddress, gasPrice)

- - -
-
- - -
- Validate Remove (selfdestruct) params -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
senderAddress - - -string - - - - - address of sender
gasPrice - - -BigNumber - - - - - gas price
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -result - - - -
-
- - - - - -
- - - -
-
-

_validateRemoveWorkerParams(senderAddress, workerAddress, gasPrice)

- - -
-
- - -
- Validate remove worker params -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
senderAddress - - -string - - - - - address of sender
workerAddress - - -string - - - - - worker address
gasPrice - - -BigNumber - - - - - gas price
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -result - - - -
-
- - - - - -
- - - -
-
-

_validateSetWorkersParams(senderAddress, workerAddress, deactivationHeight, gasPrice)

- - -
-
- - -
- Validate set workers params -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
senderAddress - - -string - - - - - address of sender
workerAddress - - -string - - - - - worker address
deactivationHeight - - -number - - - - - block number till which the worker is valid
gasPrice - - -BigNumber - - - - - gas price
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -result - - - -
-
- - - - - -
- - - -
-
-

getTxReceipt(transactionHash)

- - -
-
- - -
- Get transaction receipt from transaction hash -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
transactionHash - - -string - - - - - transaction hash -TODO - this can be moved to a util class
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

isWorker(workerAddress)

- - -
-
- - -
- Check if the given worker address is valid or not -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
workerAddress - - -string - - - - - worker address
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -Promise - - - -
-
- - - - - -
- - - -
-
-

remove(senderAddr, senderPassphrase, gasPrice, object)

- - -
-
- - -
- Remove (selfdestruct) -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
senderAddr - - -string - - - - - address of sender
senderPassphrase - - -string - - - - - passphrase of sender
gasPrice - - -BigNumber - - - - - gas price
object - - -options - - - - - for params like returnType, tag.
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -Promise - - - -
-
- - - - - -
- - - -
-
-

removeWorker(senderAddress, senderPassphrase, workerAddress, gasPrice, options)

- - -
-
- - -
- Remove worker -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
senderAddress - - -string - - - - - address of sender
senderPassphrase - - -string - - - - - passphrase of sender
workerAddress - - -string - - - - - worker address
gasPrice - - -BigNumber - - - - - gas price
options - - -object - - - - - for params like returnType, tag.
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

setWorker(senderAddress, senderPassphrase, workerAddress, deactivationHeight, gasPrice, options)

- - -
-
- - -
- Set or update the worker -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
senderAddress - - -string - - - - - address of sender
senderPassphrase - - -string - - - - - passphrase of sender
workerAddress - - -string - - - - - worker address
deactivationHeight - - -number - - - - - block number till which the worker is valid
gasPrice - - -BigNumber - - - - - gas price
options - - -object - - - - - for params like returnType, tag.
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- -
- - - - - -
- -
- - - - -
-
- -
- - -
- -
- - -
-
- - - - - -
- - - - - - OpenST Foundation Ltd. - - - - Documentation generated by JSDoc 3.5.5 - - using the DocStrap template. - -
- - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/module-lib_contract_interact_workers.html b/docs/module-lib_contract_interact_workers.html deleted file mode 100644 index 3aec85a..0000000 --- a/docs/module-lib_contract_interact_workers.html +++ /dev/null @@ -1,311 +0,0 @@ - - - - - - - OpenST Payments Module: lib/contract_interact/workers - - - - - - - - - - - - - -
-
- - -
- -
- - -

Module: lib/contract_interact/workers

-
- -
- -
- - -
-
- - -
This is a utility file which would be used for executing all methods on Workers contract.

- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - -

Classes

- -
-
Workers
-
-
- - - - - - - - - - - - - -
- -
- - - - -
-
- -
- - -
- -
- - -
-
- - - - - -
- - - - - - OpenST Foundation Ltd. - - - - Documentation generated by JSDoc 3.5.5 - - using the DocStrap template. - -
- - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/module-lib_deployer-Deploy.html b/docs/module-lib_deployer-Deploy.html deleted file mode 100644 index 99eda48..0000000 --- a/docs/module-lib_deployer-Deploy.html +++ /dev/null @@ -1,894 +0,0 @@ - - - - - - - OpenST Payments Class: Deploy - - - - - - - - - - - - - -
-
- - -
- -
- - -

Class: Deploy

-
- -
- -

- lib/deployer~ - - Deploy -

- - -
- - -
-
- - -
-
-

new Deploy()

- - -
-
- - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- - -
- - - - - - - - - - - - - - -

Methods

- -
- -
-
-

deploy(contractName, constructorArgs, gasPrice, options)

- - -
-
- - -
- Deploy contract -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
contractName - - -string - - - - - Contract name - pricer / airdrop / workers
constructorArgs - - -Array - - - - - Contract constructor params
gasPrice - - -BigNumber - - - - - Gas price
options - - -object - - - - - for params like returnType, tag.
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -response - - - -
-
- - - - - -
- - - -
-
-

validateDeployParams(contractName, gasPrice)

- - -
-
- - -
- Validate deploy parameters -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
contractName - - -string - - - - - Contract name
gasPrice - - -BigNumber - - - - - Gas price
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -response - - - -
-
- - - - - -
- - - -
-
-

writeContractAddressToFile(fileName, contractAddress)

- - -
-
- - -
- Write contract address to file based on parameter -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
fileName - - -String - - - - - file name
contractAddress - - -Hex - - - - - contract Address
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - - - - - -
- -
- - - - - -
- -
- - - - -
-
- -
- - -
- -
- - -
-
- - - - - -
- - - - - - OpenST Foundation Ltd. - - - - Documentation generated by JSDoc 3.5.5 - - using the DocStrap template. - -
- - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/module-lib_deployer.html b/docs/module-lib_deployer.html deleted file mode 100644 index 919e3b6..0000000 --- a/docs/module-lib_deployer.html +++ /dev/null @@ -1,316 +0,0 @@ - - - - - - - OpenST Payments Module: lib/deployer - - - - - - - - - - - - - -
-
- - -
- -
- - -

Module: lib/deployer

-
- -
- -
- - -
-
- - -
This is script for deploying any contract.

- - Prerequisite: -
    -
  1. Deployer Address
  2. -
- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - -

Classes

- -
-
Deploy
-
-
- - - - - - - - - - - - - -
- -
- - - - -
-
- -
- - -
- -
- - -
-
- - - - - -
- - - - - - OpenST Foundation Ltd. - - - - Documentation generated by JSDoc 3.5.5 - - using the DocStrap template. - -
- - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/module-lib_query_builder_mysql-MySQLQueryBuilderKlass.html b/docs/module-lib_query_builder_mysql-MySQLQueryBuilderKlass.html deleted file mode 100644 index d06f573..0000000 --- a/docs/module-lib_query_builder_mysql-MySQLQueryBuilderKlass.html +++ /dev/null @@ -1,2662 +0,0 @@ - - - - - - - OpenST Payments Class: MySQLQueryBuilderKlass - - - - - - - - - - - - - -
-
- - -
- -
- - -

Class: MySQLQueryBuilderKlass

-
- -
- -

- lib/query_builder/mysql~ - - MySQLQueryBuilderKlass -

- - -
- - -
-
- - -
-
-

new MySQLQueryBuilderKlass(params)

- - -
-
- - -
- MySQL query builder constructor -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
params - - -Object - - - - - - -
Properties
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeArgumentDescription
table_name - - -String - - - - - - - <optional>
- - - - - -
MySQL table name for which query need to be build
- -
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- - -
- - - - - - - - - - - - - - -

Methods

- -
- -
-
-

<private> _generateDelete()

- - -
-
- - -
- Generate the final DELETE statement -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- - - -
-
-

<private> _generateInsert()

- - -
-
- - -
- Generate the final INSERT statement -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- - - -
-
-

<private> _generateSelect()

- - -
-
- - -
- Generate the final SELECT statement -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- - - -
-
-

<private> _generateUpdate()

- - -
-
- - -
- Generate the final UPDATE statement -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- - - -
-
-

delete()

- - -
-
- - -
- Delete row from table - -Example 1: -delete() -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
- oThis -
- - - -
-
- Type -
-
- -object.<self> - - - -
-
- - - - - -
- - - -
-
-

generate()

- - -
-
- - -
- Generate final query supported by mysql node module -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -object.<response> - - - -
-
- - - - - -
- - - -
-
-

group_by()

- - -
-
- - -
- List of fields to be grouped by from table. If called multiple times, group by conditions will be joined by COMMA. - -Possible data types: -* Array - list of field names will be joined by comma -* String - list of field names will be used as it is - -Example 1: -group_by(['name', 'created_at']) - -Example 2: -group_by('name, created_at') -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
- oThis -
- - - -
-
- Type -
-
- -object.<self> - - - -
-
- - - - - -
- - - -
-
-

having()

- - -
-
- - -
- List of fields for having clause. If called multiple times, having conditions will be joined by AND. - -Possible data types: -* Array - index 0 should have the having sub query and other indexes should have the valued to be replaced in sub query -* String - where sub query, used as it is. - -Example 1: Where in array format -having(['MIN(`salary`) < ?', 10]) - -Example 2: condition in string. Will be used as it is -having('MIN(`salary`) < 10') -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
- oThis -
- - - -
-
- Type -
-
- -object.<self> - - - -
-
- - - - - -
- - - -
-
-

insert((object), (object), (object))

- - -
-
- - -
- Insert single record in table. Method can't be called twice on same object - -Example 1: Insert in object format. -insert({name: 'ACMA', id: 10}) -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
(object) - - insertFields - key and value pairs of columns and values to be inserted
(object) - - insertOptions -
(object) - - [insertOptions.touch] - if true, auto insert created_at and updated_at values. Default is true.
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
- oThis -
- - - -
-
- Type -
-
- -object.<self> - - - -
-
- - - - - -
- - - -
-
-

insertMultiple(insertColumns, insertValues, insertOptions)

- - -
-
- - -
- Insert multiple records in table. Method can't be called twice on same object - -Example 1: -insertMultiple(['name', 'symbol'], [['ABC', '123'], ['ABD', '456']]) -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
insertColumns - - -array - - - - - list of columns. also columns are mandatory
insertValues - - -array - - - - - array of array with values
insertOptions - - -object - - - - - - -
Properties
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeArgumentDescription
touch - - -object - - - - - - - <optional>
- - - - - -
if true, auto insert created_at and updated_at values. Default is true.
- -
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
- oThis -
- - - -
-
- Type -
-
- -object.<self> - - - -
-
- - - - - -
- - - -
-
-

limit((number))

- - -
-
- - -
- Limit of records to be fetched. If called multiple times, it will overwrite the previous value - -Example 1: -limit(100) -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
(number) - - recordsLimit - limit for select query
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
- oThis -
- - - -
-
- Type -
-
- -object.<self> - - - -
-
- - - - - -
- - - -
-
-

offset((number))

- - -
-
- - -
- Offset for records to be fetched. If called multiple times, it will overwrite the previous value. limit is mandatory for offset - -Example 1: -offset(10) -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
(number) - - recordsOffset - offset for select query
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
- oThis -
- - - -
-
- Type -
-
- -object.<self> - - - -
-
- - - - - -
- - - -
-
-

onDuplicate()

- - -
-
- - -
- On Duplicate conditions to be applied to the INSERT query. If called multiple times, conditions will be joined by COMMA. - -Possible data types: -* Array - index 0 should have the On Duplicate sub query and other indexes should have the valued to be replaced in sub query -* Object - key and value pairs of columns and values to be joined by COMMA to form On Duplicate sub query -* String - sub query, used as it is. - -Example 1: ON DUPLICATE in array format -onDuplicate(['name=? , id=?', 'ACMA', 10]) - -Example 2: ON DUPLICATE in object format. Conditions will be joined by , -onDuplicate({name: 'ACMA', id: 10}) - -Example 3: ON DUPLICATE in string. Will be used as it is -onDuplicate('id=10') -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
- oThis -
- - - -
-
- Type -
-
- -object.<self> - - - -
-
- - - - - -
- - - -
-
-

order_by()

- - -
-
- - -
- List of fields to be ordered by from table. If called multiple times, order by conditions will be joined by COMMA. - -Possible data types: -* Object - where keys are column names and value is order -* String - order will be used as it is - -Example 1: -order_by({'name': 'ASC', 'created_at': 'DESC'}) - -Example 2: -order_by('name ASC, created_at DESC') - -Example 3: -order_by([1, 2, 3]) -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
- oThis -
- - - -
-
- Type -
-
- -object.<self> - - - -
-
- - - - - -
- - - -
-
-

select()

- - -
-
- - -
- List of fields to be selected from table. If called multiple times, select columns will be joined by COMMA. - -Possible data types: -* blank/undefined - '*' will be used to fetch all columns -* Array - list of field names will be joined by comma -* String - list of field names will be used as it is - -Example 1: '*' will be used to fetch all columns -select() - -Example 2: list of field names in array. Will be joined by comma -select(['name', 'created_at']) - -Example 3: list of field names in string. Will be used as it is -select('name, created_at') -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
- oThis -
- - - -
-
- Type -
-
- -object.<self> - - - -
-
- - - - - -
- - - -
-
-

update(updateFields, insertOptions)

- - -
-
- - -
- Update columns to be applied to the query. If called multiple times, update fields will be joined by COMMA. - -Possible data types: -* Array - index 0 should have the update sub query and other indexes should have the valued to be replaced in sub query -* Object - key and value pairs of columns and values to be joined by COMMA to form update sub query -* String - update sub query, used as it is. -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
updateFields - - -* - - - - - refer possible data types
insertOptions - - -object - - - - - - -
Properties
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeArgumentDescription
touch - - -object - - - - - - - <optional>
- - - - - -
if true, auto insert created_at and updated_at values. Default is true. - -Example 1: update in array format -update(['name=?, id=?', 'ACMA', 10]) - -Example 2: Update in object format. Fields will be joined by {,} -update({name: 'ACMA', id: 10}) - -Example 3: Update in string. Will be used as it is -update('id=10')
- -
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
- oThis -
- - - -
-
- Type -
-
- -object.<self> - - - -
-
- - - - - -
- - - -
-
-

where()

- - -
-
- - -
- Where conditions to be applied to the query. If called multiple times, where conditions will be joined by AND. - -Possible data types: -* Array - index 0 should have the where sub query and other indexes should have the valued to be replaced in sub query -* Object - key and value pairs of columns and values to be joined by AND to form where sub query -* String - where sub query, used as it is. - -Example 1: Where in array format -where(['name=? AND id=?', 'ACMA', 10]) - -Example 2: Where in object format. Conditions will be joined by AND -where({name: 'ACMA', id: 10}) -where({name: [1,2,3], id: 10}) - -Example 3: condition in string. Will be used as it is -where('id=10') -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
- oThis -
- - - -
-
- Type -
-
- -object.<self> - - - -
-
- - - - - -
- -
- - - - - -
- -
- - - - -
-
- -
- - -
- -
- - -
-
- - - - - -
- - - - - - OpenST Foundation Ltd. - - - - Documentation generated by JSDoc 3.5.5 - - using the DocStrap template. - -
- - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/module-lib_query_builder_mysql.html b/docs/module-lib_query_builder_mysql.html deleted file mode 100644 index 0fd7ba0..0000000 --- a/docs/module-lib_query_builder_mysql.html +++ /dev/null @@ -1,339 +0,0 @@ - - - - - - - OpenST Payments Module: lib/query_builder/mysql - - - - - - - - - - - - - -
-
- - -
- -
- - -

Module: lib/query_builder/mysql

-
- -
- -
- - -
-
- - -
Form mysql query

- - -Max supported SELECT query: -SELECT [columns] - FROM [table] - WHERE [where conditions] - GROUP BY [columns] - ORDER BY [order by columns] - HAVING [having condition] - LIMIT [limit and offset]; - -Max supported INSERT query: -INSERT INTO [table] ([columns]) - VALUES ([values]), ([values]) - ON DUPLICATE KEY UPDATE [conditions]; - -Max supported UPDATE query: -UPDATE [table] - SET [column=value], [column=value] - WHERE [where conditions] - ORDER BY [order by columns] - LIMIT [limit]; - -Max supported DELETE query: -DELETE FROM [table] - WHERE [where conditions] - ORDER BY [order by columns] - LIMIT [limit];
- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - -

Classes

- -
-
MySQLQueryBuilderKlass
-
-
- - - - - - - - - - - - - -
- -
- - - - -
-
- -
- - -
- -
- - -
-
- - - - - -
- - - - - - OpenST Foundation Ltd. - - - - Documentation generated by JSDoc 3.5.5 - - using the DocStrap template. - -
- - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/module-lib_set_worker_and_ops-SetWorkerOps.html b/docs/module-lib_set_worker_and_ops-SetWorkerOps.html deleted file mode 100644 index 4e4ced0..0000000 --- a/docs/module-lib_set_worker_and_ops-SetWorkerOps.html +++ /dev/null @@ -1,603 +0,0 @@ - - - - - - - OpenST Payments Class: SetWorkerOps - - - - - - - - - - - - - -
-
- - -
- -
- - -

Class: SetWorkerOps

-
- -
- -

- lib/set_worker_and_ops~ - - SetWorkerOps -

- - -
- - -
-
- - -
-
-

new SetWorkerOps()

- - -
-
- - -
- Set Worker Contract and OPS Address -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- - -
- - - - - - - - - - - - - - -

Methods

- -
- -
-
-

perform( [options])

- - -
-
- - -
- Set Worker and Ops for a contract. -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeArgumentDescription
options - - -object - - - - - - - <optional>
- - - - - -
-
Properties
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeArgumentDescription
gasPrice - - -number - - - - - - - <optional>
- - - - - -
Gas Price to use
chainId - - -number - - - - - - - <optional>
- - - - - -
Chain Id where contract need to be deployed
- -
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -Promise.<result> - - - -
-
- - - - - -
- -
- - - - - -
- -
- - - - -
-
- -
- - -
- -
- - -
-
- - - - - -
- - - - - - OpenST Foundation Ltd. - - - - Documentation generated by JSDoc 3.5.5 - - using the DocStrap template. - -
- - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/module-lib_set_worker_and_ops.html b/docs/module-lib_set_worker_and_ops.html deleted file mode 100644 index 934c5d1..0000000 --- a/docs/module-lib_set_worker_and_ops.html +++ /dev/null @@ -1,311 +0,0 @@ - - - - - - - OpenST Payments Module: lib/set_worker_and_ops - - - - - - - - - - - - - -
-
- - -
- -
- - -

Module: lib/set_worker_and_ops

-
- -
- -
- - -
-
- - -
Set Worker Contract and OPS Address
- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - -

Classes

- -
-
SetWorkerOps
-
-
- - - - - - - - - - - - - -
- -
- - - - -
-
- -
- - -
- -
- - -
-
- - - - - -
- - - - - - OpenST Foundation Ltd. - - - - Documentation generated by JSDoc 3.5.5 - - using the DocStrap template. - -
- - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/module-lib_transaction_helper-TransactionHelper.html b/docs/module-lib_transaction_helper-TransactionHelper.html deleted file mode 100644 index 6f7a7b2..0000000 --- a/docs/module-lib_transaction_helper-TransactionHelper.html +++ /dev/null @@ -1,4093 +0,0 @@ - - - - - - - OpenST Payments Class: TransactionHelper - - - - - - - - - - - - - -
-
- - -
- -
- - -

Class: TransactionHelper

-
- -
- -

- lib/transaction_helper~ - - TransactionHelper -

- - -
- - -
-
- - -
-
-

new TransactionHelper(chainId)

- - -
-
- - -
- constructor -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chainId - - -string - - - - - chain id
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- - -
- - - - - - - - - - - - - - -

Methods

- -
- -
-
-

_getPromiseArrayForBalanceChange(brandedTokenAddress, airdropAddress, addressToBalanceChangeMap, addressToAirdropBalanceChangeMap)

- - -
-
- - -
- Get promise array for balance change -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
brandedTokenAddress - - -string - - - - - branded token address
airdropAddress - - -string - - - - - airdrop contract address
addressToBalanceChangeMap - - -string - - - - - address to balance change map
addressToAirdropBalanceChangeMap - - -BigNumber - - - - - address to airdrop balance change map
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -array.<promise> - - - -
-
- - - - - -
- - - -
-
-

afterAirdropPayFailure(brandedTokenAddress, airdropAddress, spender, estimatedPayAmount, estimatedAirdropAmount, airdropBugdetAddress)

- - -
-
- - -
- After airdrop pay function, this is called after the pay is failed -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
brandedTokenAddress - - -string - - - - - branded token address
airdropAddress - - -string - - - - - airdrop contract address
spender - - -string - - - - - spender address
estimatedPayAmount - - -BigNumber - - - - - estimated pay amount in weis
estimatedAirdropAmount - - -BigNumber - - - - - estimated airdrop amount
airdropBugdetAddress - - -string - - - - - airdrop budget holder address
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

afterAirdropPaySuccess(brandedTokenAddress, airdropAddress, spender, estimatedPayAmount, estimatedAirdropAmount, beneficiaryAddress, actualBeneficiaryAmount, commissionBeneficiaryAddress, actualCommissionBeneficiaryAmount, actualAirdropAmount, airdropBugdetAddress)

- - -
-
- - -
- After airdrop pay function, this is called after the pay is successfull -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
brandedTokenAddress - - -string - - - - - branded token address
airdropAddress - - -string - - - - - airdrop contract address
spender - - -string - - - - - spender address
estimatedPayAmount - - -BigNumber - - - - - estimated pay amount in weis
estimatedAirdropAmount - - -BigNumber - - - - - estimated airdrop amount
beneficiaryAddress - - -string - - - - - beneficiary address
actualBeneficiaryAmount - - -BigNumber - - - - - actual beneficiary amount in weis
commissionBeneficiaryAddress - - -string - - - - - commission beneficiary address
actualCommissionBeneficiaryAmount - - -BigNumber - - - - - actual commission beneficiary amount
actualAirdropAmount - - -BigNumber - - - - - actual airdrop amount
airdropBugdetAddress - - -string - - - - - airdrop budget holder address
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

afterPayFailure(brandedTokenAddress, spender, estimatedPayAmount)

- - -
-
- - -
- After pay function, this is called after the pay is failed -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
brandedTokenAddress - - -string - - - - - branded token address
spender - - -string - - - - - spender address
estimatedPayAmount - - -BigNumber - - - - - estimated pay amount in weis
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

afterPaySuccess(brandedTokenAddress, spender, estimatedPayAmount, beneficiaryAddress, actualBeneficiaryAmount, commissionBeneficiaryAddress, actualCommissionBeneficiaryAmount)

- - -
-
- - -
- After pay function, this is called after the pay is successfull -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
brandedTokenAddress - - -string - - - - - branded token address
spender - - -string - - - - - spender address
estimatedPayAmount - - -BigNumber - - - - - estimated pay amount in weis
beneficiaryAddress - - -string - - - - - beneficiary address
actualBeneficiaryAmount - - -BigNumber - - - - - actual beneficiary amount in weis
commissionBeneficiaryAddress - - -string - - - - - commission beneficiary address
actualCommissionBeneficiaryAmount - - -BigNumber - - - - - actual commission beneficiary amount
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

beforeAirdropPay(brandedTokenAddress, airdropAddress, spender, estimatedPayAmount, estimatedAirdropAmount, airdropBugdetAddress)

- - -
-
- - -
- Before airdrop pay function, this is called before the pay is called -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
brandedTokenAddress - - -string - - - - - branded token address
airdropAddress - - -string - - - - - airdrop contract address
spender - - -string - - - - - spender address
estimatedPayAmount - - -BigNumber - - - - - estimated pay amount in weis
estimatedAirdropAmount - - -BigNumber - - - - - estimated airdrop amount
airdropBugdetAddress - - -string - - - - - airdrop budget holder address
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

beforePay(brandedTokenAddress, spender, estimatedPayAmount)

- - -
-
- - -
- Before pay function, this is called before the pay is called -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
brandedTokenAddress - - -string - - - - - branded token address
spender - - -string - - - - - spender address
estimatedPayAmount - - -BigNumber - - - - - estimated pay amount in weis
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

clearUserDetailCache(airdropContractAddress, owner)

- - -
-
- - -
- Clear user detail cache for the user addressess -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
airdropContractAddress - - -string - - - - - airdrop contract address
owner - - -string - - - - - Account address
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

creditAirdropBalance(airdropContractAddress, owner, bigAmount)

- - -
-
- - -
- Credit airdrop balance in db and clear cache -It decreases airdrop_used_amount for user in user_airdrop_details table -Clears the cache -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
airdropContractAddress - - -string - - - - - airdrop contract address
owner - - -string - - - - - Account address
bigAmount - - -BigNumber - - - - - amount to be credited
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

creditBalance(brandedTokenAddress, owner, bigAmount)

- - -
-
- - -
- Credit balance in cache -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
brandedTokenAddress - - -string - - - - - branded token address
owner - - -string - - - - - Account address
bigAmount - - -BigNumber - - - - - amount to be credited
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

debitAirdropBalance(airdropContractAddress, owner, bigAmount)

- - -
-
- - -
- Debit airdrop balance in db and clear cache -It increases airdrop_used_amount for user in user_airdrop_details table -Clears the cache -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
airdropContractAddress - - -string - - - - - airdrop contract address
owner - - -string - - - - - Account address
bigAmount - - -BigNumber - - - - - amount to be debited
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

debitBalance(brandedTokenAddress, owner, bigAmount)

- - -
-
- - -
- Debit balance in cache -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
brandedTokenAddress - - -string - - - - - branded token address
owner - - -string - - - - - Account address
bigAmount - - -BigNumber - - - - - amount to be debited
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

getActualAmountsFromReceipt(transactionReceipt, addressToNameMap)

- - -
-
- - -
- Get actual beneficiary amount, actual commission amount and actual airdrop amount from transaction receipt -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
transactionReceipt - - -Object - - - - - transaction receipt
addressToNameMap - - -Object - - - - - address to name map object
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -result - - - -
-
- - - - - -
- - - -
-
-

isAllResponseSuccessful(results)

- - -
-
- - -
- Check if all response is success -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
results - - -array - - - - - response array
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -boolean - - - -
-
- - - - - -
- - - -
-
-

setBalanceInCache(brandedTokenAddress, owner, bigAmount)

- - -
-
- - -
- Set balance in cache -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
brandedTokenAddress - - -string - - - - - branded token address
owner - - -string - - - - - Account address
bigAmount - - -BigNumber - - - - - amount to be set
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

updateAirdropBalance(airdropContractAddress, owner, toCreditBigAmount)

- - -
-
- - -
- Update airdrop balance -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
airdropContractAddress - - -string - - - - - airdrop contract address
owner - - -string - - - - - Account address
toCreditBigAmount - - -BigNumber - - - - - to credit amount - this can be negative also
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- - - -
-
-

updateBalance(brandedTokenAddress, owner, toCreditBigAmount)

- - -
-
- - -
- Update balance to cache -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
brandedTokenAddress - - -string - - - - - branded token address
owner - - -string - - - - - Account address
toCreditBigAmount - - -BigNumber - - - - - to credit amount - this can be negative also
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -promise.<result> - - - -
-
- - - - - -
- -
- - - - - -
- -
- - - - -
-
- -
- - -
- -
- - -
-
- - - - - -
- - - - - - OpenST Foundation Ltd. - - - - Documentation generated by JSDoc 3.5.5 - - using the DocStrap template. - -
- - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/module-lib_transaction_helper.html b/docs/module-lib_transaction_helper.html deleted file mode 100644 index 5f1a819..0000000 --- a/docs/module-lib_transaction_helper.html +++ /dev/null @@ -1,311 +0,0 @@ - - - - - - - OpenST Payments Module: lib/transaction_helper - - - - - - - - - - - - - -
-
- - -
- -
- - -

Module: lib/transaction_helper

-
- -
- -
- - -
-
- - -
This is transaction helper that manages the cache updation

- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - -

Classes

- -
-
TransactionHelper
-
-
- - - - - - - - - - - - - -
- -
- - - - -
-
- -
- - -
- -
- - -
-
- - - - - -
- - - - - - OpenST Foundation Ltd. - - - - Documentation generated by JSDoc 3.5.5 - - using the DocStrap template. - -
- - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/module-lib_web3_events_formatter-web3EventsDecoder.html b/docs/module-lib_web3_events_formatter-web3EventsDecoder.html deleted file mode 100644 index d03956b..0000000 --- a/docs/module-lib_web3_events_formatter-web3EventsDecoder.html +++ /dev/null @@ -1,491 +0,0 @@ - - - - - - - OpenST Payments Namespace: web3EventsDecoder - - - - - - - - - - - - - -
-
- - -
- -
- - -

Namespace: web3EventsDecoder

-
- -
- -

- lib/web3/events/formatter~ - - web3EventsDecoder -

- - -
- - -
-
- - -
Ivent Decoder.
- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - - - - - - - - - -

Methods

- -
- -
-
-

perform(txReceipt, addressToNameMap)

- - -
-
- - -
- performer -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
txReceipt - - -Object - - - - -
addressToNameMap - - -Hash - - - - - Map of the address(key) to name(value)
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
- object of resulthelpwe\\er -
- - - -
-
- Type -
-
- -result - - - -
-
- - - - - -
- -
- - - - - -
- -
- - - - -
-
- -
- - -
- -
- - -
-
- - - - - -
- - - - - - OpenST Foundation Ltd. - - - - Documentation generated by JSDoc 3.5.5 - - using the DocStrap template. - -
- - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/module-lib_web3_events_formatter-web3EventsFormatter.html b/docs/module-lib_web3_events_formatter-web3EventsFormatter.html deleted file mode 100644 index e940659..0000000 --- a/docs/module-lib_web3_events_formatter-web3EventsFormatter.html +++ /dev/null @@ -1,457 +0,0 @@ - - - - - - - OpenST Payments Namespace: web3EventsFormatter - - - - - - - - - - - - - -
-
- - -
- -
- - -

Namespace: web3EventsFormatter

-
- -
- -

- lib/web3/events/formatter~ - - web3EventsFormatter -

- - -
- - -
-
- - -
Event Formatter.
- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - - - - - - - - - -

Methods

- -
- -
-
-

perform(formattedTransactionReceipt)

- - -
-
- - -
- performer -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
formattedTransactionReceipt - -
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -Promise.<{}> - - - -
-
- - - - - -
- -
- - - - - -
- -
- - - - -
-
- -
- - -
- -
- - -
-
- - - - - -
- - - - - - OpenST Foundation Ltd. - - - - Documentation generated by JSDoc 3.5.5 - - using the DocStrap template. - -
- - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/module-lib_web3_events_formatter.html b/docs/module-lib_web3_events_formatter.html deleted file mode 100644 index 48a3719..0000000 --- a/docs/module-lib_web3_events_formatter.html +++ /dev/null @@ -1,407 +0,0 @@ - - - - - - - OpenST Payments Module: lib/web3/events/formatter - - - - - - - - - - - - - -
-
- - -
- -
- - -

Module: lib/web3/events/formatter

-
- -
- -
- - -
-
- - -
Format decoded event into Hash with all the events received into it.
- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - - - - - -

Namespaces

- -
-
web3EventsDecoder
-
- -
web3EventsFormatter
-
-
- - - - - - - - - -
- -
- - - - -

Module: lib/web3/events/formatter

-
- -
- -
- - -
-
- - -
Decode logs from a transaction receipt
- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - - - - - -

Namespaces

- -
-
web3EventsDecoder
-
- -
web3EventsFormatter
-
-
- - - - - - - - - -
- -
- - - - -
-
- -
- - -
- -
- - -
-
- - - - - -
- - - - - - OpenST Foundation Ltd. - - - - Documentation generated by JSDoc 3.5.5 - - using the DocStrap template. - -
- - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/module-tools_deploy_DeployHelper.html b/docs/module-tools_deploy_DeployHelper.html deleted file mode 100644 index 655db06..0000000 --- a/docs/module-tools_deploy_DeployHelper.html +++ /dev/null @@ -1,821 +0,0 @@ - - - - - - - OpenST Payments Module: tools/deploy/DeployHelper - - - - - - - - - - - - - -
-
- - -
- -
- - -

Module: tools/deploy/DeployHelper

-
- -
- -
- - -
-
- - -
Deploy Helper class to perform deploy
- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - - - - - - - - - -

Methods

- -
- -
-
-

<static> writeContractAddressToFile(fileName, contractAddress)

- - -
-
- - -
- Write contract address to file based on parameter -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
fileName - - -String - - - - - file name
contractAddress - - -Hex - - - - - contract Address
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - - - - - -
- - - -
-
-

<async, inner> perform(contractName, web3Provider, contractAbi, contractBin, deployerName [, customOptions] [, constructorArgs])

- - -
-
- - -
- Method deploys contract -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeArgumentDescription
contractName - - -String - - - - - - - - - - - Contract Name to be deployed
web3Provider - - -Web3 - - - - - - - - - - - Web3 Provider object
contractAbi - - -String - - - - - - - - - - - Contract Abi to be deployed
contractBin - - -String - - - - - - - - - - - Contract Bin file to be deployed
deployerName - - -String - - - - - - - - - - - Deployer name
customOptions - - -Object - - - - - - - <optional>
- - - - - -
Custom options for value/utility chain
constructorArgs - - -Object - - - - - - - <optional>
- - - - - -
Arguments to be passed while deploying contract
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -Promise.<Object> - - - -
-
- - - - - -
- -
- - - - - -
- -
- - - - -
-
- -
- - -
- -
- - -
-
- - - - - -
- - - - - - OpenST Foundation Ltd. - - - - Documentation generated by JSDoc 3.5.5 - - using the DocStrap template. - -
- - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/module-tools_deploy_EIP20TokenMock.html b/docs/module-tools_deploy_EIP20TokenMock.html deleted file mode 100644 index dafd63c..0000000 --- a/docs/module-tools_deploy_EIP20TokenMock.html +++ /dev/null @@ -1,448 +0,0 @@ - - - - - - - OpenST Payments Module: tools/deploy/EIP20TokenMock - - - - - - - - - - - - - -
-
- - -
- -
- - -

Module: tools/deploy/EIP20TokenMock

-
- -
- -
- - -
-
- - -
This is script for deploying Pricer contract on any chain.

- - Prerequisite: -
    -
  1. Deployer Address
  2. -
- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - - - - - - - - - -

Methods

- -
- -
-
-

<async, inner> performer(arguments)

- - -
-
- - -
- It is the main performer method of this deployment script -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
arguments - - -Array - - - - -
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - - - - - -
- -
- - - - - -
- -
- - - - -
-
- -
- - -
- -
- - -
-
- - - - - -
- - - - - - OpenST Foundation Ltd. - - - - Documentation generated by JSDoc 3.5.5 - - using the DocStrap template. - -
- - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/module-tools_deploy_helper.html b/docs/module-tools_deploy_helper.html deleted file mode 100644 index 86c008d..0000000 --- a/docs/module-tools_deploy_helper.html +++ /dev/null @@ -1,306 +0,0 @@ - - - - - - - OpenST Payments Module: tools/deploy/helper - - - - - - - - - - - - - -
-
- - -
- -
- - -

Module: tools/deploy/helper

-
- -
- -
- - -
-
- - -
This is utility class for deploying contract

- -Ref: module:tools/deploy/DeployHelper
- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - - - - - - - - - - - - - -
- -
- - - - -
-
- -
- - -
- -
- - -
-
- - - - - -
- - - - - - OpenST Foundation Ltd. - - - - Documentation generated by JSDoc 3.5.5 - - using the DocStrap template. - -
- - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/module-tools_deploy_pricer.html b/docs/module-tools_deploy_pricer.html deleted file mode 100644 index 996ef44..0000000 --- a/docs/module-tools_deploy_pricer.html +++ /dev/null @@ -1,1495 +0,0 @@ - - - - - - - OpenST Payments Module: tools/deploy/pricer - - - - - - - - - - - - - -
-
- - -
- -
- - -

Module: tools/deploy/pricer

-
- -
- -
- - -
-
- - -
This is script for deploying Pricer contract on any chain.

- - Prerequisite: -
    -
  1. Deployer Address
  2. -
- - These are the following steps:
-
    -
  1. Deploy Pricer contract
  2. -
- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - - - - - - - - - -

Methods

- -
- -
-
-

<async, inner> performer(arguments)

- - -
-
- - -
- It is the main performer method of this deployment script -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
arguments - - -Array - - - - -
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - - - - - -
- - - -
-
-

<async, inner> performer(arguments)

- - -
-
- - -
- It is the main performer method of this deployment script -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
arguments - - -Array - - - - -
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - - - - - -
- - - -
-
-

<inner> validate(arguments)

- - -
-
- - -
- Validation Method -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
arguments - - -Array - - - - -
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - - - - - -
- - - -
-
-

<inner> validate(arguments)

- - -
-
- - -
- Validation Method -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
arguments - - -Array - - - - -
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - - - - - -
- -
- - - - - -
- -
- - - - -

Module: tools/deploy/pricer

-
- -
- -
- - -
-
- - -
This is script for deploying Pricer contract on any chain.

- - Prerequisite: -
    -
  1. Deployer Address
  2. -
- - These are the following steps:
-
    -
  1. Deploy Airdrop contract
  2. -
- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - - - - - - - - - -

Methods

- -
- -
-
-

<async, inner> performer(arguments)

- - -
-
- - -
- It is the main performer method of this deployment script -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
arguments - - -Array - - - - -
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - - - - - -
- - - -
-
-

<async, inner> performer(arguments)

- - -
-
- - -
- It is the main performer method of this deployment script -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
arguments - - -Array - - - - -
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - - - - - -
- - - -
-
-

<inner> validate(arguments)

- - -
-
- - -
- Validation Method -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
arguments - - -Array - - - - -
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - - - - - -
- - - -
-
-

<inner> validate(arguments)

- - -
-
- - -
- Validation Method -
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
arguments - - -Array - - - - -
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - - - - - -
- -
- - - - - -
- -
- - - - -
-
- -
- - -
- -
- - -
-
- - - - - -
- - - - - - OpenST Foundation Ltd. - - - - Documentation generated by JSDoc 3.5.5 - - using the DocStrap template. - -
- - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/module-tools_deploy_workers.html b/docs/module-tools_deploy_workers.html deleted file mode 100644 index fdda390..0000000 --- a/docs/module-tools_deploy_workers.html +++ /dev/null @@ -1,406 +0,0 @@ - - - - - - - OpenST Payments Module: tools/deploy/workers - - - - - - - - - - - - - -
-
- - -
- -
- - -

Module: tools/deploy/workers

-
- -
- -
- - -
-
- - -
This is script for deploying Workers contract on any chain.

- - Prerequisite: -
    -
  1. Deployer Address
  2. -
- - These are the following steps:
-
    -
  1. Deploy Workers contract
  2. -
- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - - - - - - - - - -

Methods

- -
- -
-
-

<async, inner> performer()

- - -
-
- - -
- It is the main performer method of this deployment script - -Example: -node tools/deploy/worker.js gasPrice chainId -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - - - - - - - -
- -
- - - - - -
- -
- - - - -
-
- -
- - -
- -
- - -
-
- - - - - -
- - - - - - OpenST Foundation Ltd. - - - - Documentation generated by JSDoc 3.5.5 - - using the DocStrap template. - -
- - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/modules.list.html b/docs/modules.list.html deleted file mode 100644 index 08dfae7..0000000 --- a/docs/modules.list.html +++ /dev/null @@ -1,396 +0,0 @@ - - - - - - - OpenST Payments Modules - - - - - - - - - - - - - -
-
- - -
- -
- - -

Modules

-
- -
- -

- -

- - -
- - -
-
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - -

Classes

- -
-
baseCacheMultiManagementKlass
-
- -
BasicHelperKlass
-
- -
approve
-
- -
base
-
- -
batchAllocator
-
- -
register
-
- -
transfer
-
- -
AdjustAirdropAmountKlass
-
- -
AirdropUserBalanceKlass
-
- -
AirdropBalanceCache
-
- -
BalanceCache
-
- -
PricerCache
-
- -
Airdrop
-
- -
BrandedToken
-
- -
ContractInteractHelper
-
- -
OpsManagedContract
-
- -
OwnedContract
-
- -
MockToken
-
- -
Pricer
-
- -
Workers
-
- -
Deploy
-
- -
MySQLQueryBuilderKlass
-
- -
SetWorkerOps
-
- -
TransactionHelper
-
- -
userAirdropDetailCache
-
-
- - - - - -

Namespaces

- -
-
web3EventsDecoder
-
- -
web3EventsFormatter
-
-
- - - - - - - - - -
- -
- - - - -
-
- -
- - -
- -
- - -
-
- - - - - -
- - - - - - OpenST Foundation Ltd. - - - - Documentation generated by JSDoc 3.5.5 - - using the DocStrap template. - -
- - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/namespaces.list.html b/docs/namespaces.list.html deleted file mode 100644 index 05e55e7..0000000 --- a/docs/namespaces.list.html +++ /dev/null @@ -1,396 +0,0 @@ - - - - - - - OpenST Payments Namespaces - - - - - - - - - - - - - -
-
- - -
- -
- - -

Namespaces

-
- -
- -

- -

- - -
- - -
-
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - -

Classes

- -
-
baseCacheMultiManagementKlass
-
- -
BasicHelperKlass
-
- -
approve
-
- -
base
-
- -
batchAllocator
-
- -
register
-
- -
transfer
-
- -
AdjustAirdropAmountKlass
-
- -
AirdropUserBalanceKlass
-
- -
AirdropBalanceCache
-
- -
BalanceCache
-
- -
PricerCache
-
- -
Airdrop
-
- -
BrandedToken
-
- -
ContractInteractHelper
-
- -
OpsManagedContract
-
- -
OwnedContract
-
- -
MockToken
-
- -
Pricer
-
- -
Workers
-
- -
Deploy
-
- -
MySQLQueryBuilderKlass
-
- -
SetWorkerOps
-
- -
TransactionHelper
-
- -
userAirdropDetailCache
-
-
- - - - - -

Namespaces

- -
-
web3EventsDecoder
-
- -
web3EventsFormatter
-
-
- - - - - - - - - -
- -
- - - - -
-
- -
- - -
- -
- - -
-
- - - - - -
- - - - - - OpenST Foundation Ltd. - - - - Documentation generated by JSDoc 3.5.5 - - using the DocStrap template. - -
- - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/quicksearch.html b/docs/quicksearch.html deleted file mode 100644 index a57571d..0000000 --- a/docs/quicksearch.html +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - diff --git a/docs/scripts/docstrap.lib.js b/docs/scripts/docstrap.lib.js deleted file mode 100644 index 09d9272..0000000 --- a/docs/scripts/docstrap.lib.js +++ /dev/null @@ -1,11 +0,0 @@ -if(!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){function c(a){var b="length"in a&&a.length,c=_.type(a);return"function"!==c&&!_.isWindow(a)&&(!(1!==a.nodeType||!b)||("array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a))}function d(a,b,c){if(_.isFunction(b))return _.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return _.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(ha.test(b))return _.filter(b,a,c);b=_.filter(b,a)}return _.grep(a,function(a){return U.call(b,a)>=0!==c})}function e(a,b){for(;(a=a[b])&&1!==a.nodeType;);return a}function f(a){var b=oa[a]={};return _.each(a.match(na)||[],function(a,c){b[c]=!0}),b}function g(){Z.removeEventListener("DOMContentLoaded",g,!1),a.removeEventListener("load",g,!1),_.ready()}function h(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=_.expando+h.uid++}function i(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(ua,"-$1").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c||"false"!==c&&("null"===c?null:+c+""===c?+c:ta.test(c)?_.parseJSON(c):c)}catch(a){}sa.set(a,b,c)}else c=void 0;return c}function j(){return!0}function k(){return!1}function l(){try{return Z.activeElement}catch(a){}}function m(a,b){return _.nodeName(a,"table")&&_.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function n(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function o(a){var b=Ka.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function p(a,b){for(var c=0,d=a.length;d>c;c++)ra.set(a[c],"globalEval",!b||ra.get(b[c],"globalEval"))}function q(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(ra.hasData(a)&&(f=ra.access(a),g=ra.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)_.event.add(b,e,j[e][c])}sa.hasData(a)&&(h=sa.access(a),i=_.extend({},h),sa.set(b,i))}}function r(a,b){var c=a.getElementsByTagName?a.getElementsByTagName(b||"*"):a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&_.nodeName(a,b)?_.merge([a],c):c}function s(a,b){var c=b.nodeName.toLowerCase();"input"===c&&ya.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}function t(b,c){var d,e=_(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:_.css(e[0],"display");return e.detach(),f}function u(a){var b=Z,c=Oa[a];return c||(c=t(a,b),"none"!==c&&c||(Na=(Na||_("