From 8ca217cfa3ed64634fbc6a96cac7298b49b961d6 Mon Sep 17 00:00:00 2001 From: RJ Ewing Date: Mon, 11 Feb 2019 08:02:35 -0800 Subject: [PATCH] fix contract exports --- index.js | 56 ++++++++++++++++++++++++++++++++++++++++++++--- js/contracts.js | 58 ------------------------------------------------- package.json | 2 +- 3 files changed, 54 insertions(+), 62 deletions(-) delete mode 100644 js/contracts.js diff --git a/index.js b/index.js index bb0cdde..33fffe9 100644 --- a/index.js +++ b/index.js @@ -1,13 +1,63 @@ -const contracts = require('./js/contracts'); +const generateClass = require('eth-contract-class').default; + +const LPFactoryArtifact = require('../dist/contracts/LPFactory.json'); +const LiquidPledgingArtifact = require('../dist/contracts/LiquidPledging.json'); +const LPVaultArtifact = require('../dist/contracts/LPVault.json'); +const KernelArtifact = require('../dist/contracts/Kernel.json'); +const DAOFactoryArtifact = require('../dist/contracts/DAOFactory.json'); +const ACLArtifact = require('../dist/contracts/ACL.json'); +const AppProxyUpgradeableArtifact = require('../dist/contracts/AppProxyUpgradeable.json'); +const StandardTokenTestAtifact = require('../dist/contracts/StandardToken.json'); +const LiquidPledgingMockArtifact = require('../dist/contracts/LiquidPledgingMock.json'); +const RecoveryVaultArtifact = require('../dist/contracts/RecoveryVault.json'); const assertFail = require('./test/helpers/assertFail'); const { embarkConfig, deploy: deployLP } = require('./test/helpers/deployLP'); module.exports = { - ...contracts, + LiquidPledging: generateClass( + LiquidPledgingArtifact.abiDefinition, + LiquidPledgingArtifact.code, + ), + LPFactory: generateClass( + LPFactoryArtifact.abiDefinition, + LPFactoryArtifact.code, + ), + LiquidPledgingState: require('../js/liquidPledgingState.js'), + LPVault: generateClass( + LPVaultArtifact.abiDefinition, + LPVaultArtifact.code, + ), + DAOFactory: generateClass( + DAOFactoryArtifact.abiDefinition, + DAOFactoryArtifact.code, + ), + Kernel: generateClass( + KernelArtifact.abiDefinition, + KernelArtifact.code, + ), + ACL: generateClass( + ACLArtifact.abiDefinition, + ACLArtifact.code, + ), + AppProxyUpgradeable: generateClass( + AppProxyUpgradeableArtifact.abiDefinition, + AppProxyUpgradeableArtifact.code, + ), test: { + RecoveryVault: generateClass( + RecoveryVaultArtifact.abiDefinition, + RecoveryVaultArtifact.code, + ), + StandardTokenTest: generateClass( + StandardTokenTestAtifact.abiDefinition, + StandardTokenTestAtifact.code, + ), + LiquidPledgingMock: generateClass( + LiquidPledgingMockArtifact.abiDefinition, + LiquidPledgingMockArtifact.code, + ), assertFail, embarkConfig, deployLP, - ...contracts.test, }, }; diff --git a/js/contracts.js b/js/contracts.js deleted file mode 100644 index 92944d6..0000000 --- a/js/contracts.js +++ /dev/null @@ -1,58 +0,0 @@ -const generateClass = require('eth-contract-class').default; - -const LPFactoryArtifact = require('../dist/contracts/LPFactory.json'); -const LiquidPledgingArtifact = require('../dist/contracts/LiquidPledging.json'); -const LPVaultArtifact = require('../dist/contracts/LPVault.json'); -const KernelArtifact = require('../dist/contracts/Kernel.json'); -const DAOFactoryArtifact = require('../dist/contracts/DAOFactory.json'); -const ACLArtifact = require('../dist/contracts/ACL.json'); -const AppProxyUpgradeableArtifact = require('../dist/contracts/AppProxyUpgradeable.json'); -const StandardTokenTestAtifact = require('../dist/contracts/StandardToken.json'); -const LiquidPledgingMockArtifact = require('../dist/contracts/LiquidPledgingMock.json'); -const RecoveryVaultArtifact = require('../dist/contracts/RecoveryVault.json'); - -module.exports = { - LiquidPledging: generateClass( - LiquidPledgingArtifact.abiDefinition, - LiquidPledgingArtifact.code, - ), - LPFactory: generateClass( - LPFactoryArtifact.abiDefinition, - LPFactoryArtifact.code, - ), - LiquidPledgingState: require('../js/liquidPledgingState.js'), - LPVault: generateClass( - LPVaultArtifact.abiDefinition, - LPVaultArtifact.code, - ), - DAOFactory: generateClass ( - DAOFactoryArtifact.abiDefinition, - DAOFactoryArtifact.code, - ), - Kernel: generateClass( - KernelArtifact.abiDefinition, - KernelArtifact.code, - ), - ACL: generateClass( - ACLArtifact.abiDefinition, - ACLArtifact.code, - ), - AppProxyUpgradeable: generateClass( - AppProxyUpgradeableArtifact.abiDefinition, - AppProxyUpgradeableArtifact.code, - ), - test: { - RecoveryVault: generateClass( - RecoveryVaultArtifact.abiDefinition, - RecoveryVaultArtifact.code, - ), - StandardTokenTest: generateClass( - StandardTokenTestAtifact.abiDefinition, - StandardTokenTestAtifact.code, - ), - LiquidPledgingMock: generateClass( - LiquidPledgingMockArtifact.abiDefinition, - LiquidPledgingMockArtifact.code, - ), - }, -}; diff --git a/package.json b/package.json index cb8cb42..3460eb5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "giveth-liquidpledging", - "version": "2.0.0-beta.2", + "version": "2.0.0-beta.3", "description": "Liquid Pledging Smart Contract", "main": "index.js", "directories": {