Commit fa8a090e authored by Chuck LeDuc Díaz's avatar Chuck LeDuc Díaz
Browse files

merge from master

parents 05a5afa7 652eb264
Pipeline #65182014 passed with stage
in 2 minutes and 44 seconds
......@@ -9,6 +9,9 @@ lerna-debug.log*
# Vim
**/*.swp
# Vscode
.vscode
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
......
......@@ -4,4 +4,5 @@ all_tests:
script:
- npm install
- npm run lint
- npm test-solidity
- npm run build
- npm run coverage
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"name": "caelum-identity",
"version": "1.0.0",
"name": "@caelum-tech/identity",
"version": "0.1.0",
"description": "Caelum Identity library",
"main": "index.js",
"scripts": {
"build": "node src/build",
"codecov": "nyc report --report=text-lcov > coverage.lcov ; codecov",
"coverage": "npm run coverage-js; npm run coverage-solidity",
"coverage-js": "nyc npm test",
"coverage-solidity": "./node_modules/.bin/solidity-coverage",
"coverage": "nyc npm test",
"coverage:report": "nyc report --reporter=html",
"eslint": "./node_modules/eslint/bin/eslint.js .",
"lint": "npm run eslint; npm run solium",
"mocha": "mocha --timeout 30000 test",
"npm:publish": "npm publish --access public",
"solium": "solium --dir contracts",
"start": "./node_modules/@caelum-tech/parity/scripts/startParity.sh",
"stop": "./node_modules/@caelum-tech/parity/scripts/stopParity.sh",
"test": "npm run start; npm run mocha; npm run stop;"
"test": "npm run start; npm run mocha; npm run stop"
},
"repository": {
"type": "git",
......@@ -29,9 +29,9 @@
"author": "Alex Puig",
"license": "Apache-2.0",
"bugs": {
"url": "https://gitlab.com/caelum-tech/caelum-parity/issues"
"url": "https://gitlab.com/caelum-tech/caelum-identity/issues"
},
"homepage": "https://gitlab.com/caelum-tech/caelum-parity#readme",
"homepage": "https://gitlab.com/caelum-tech/caelum-identity#readme",
"dependencies": {
"@caelum-tech/parity": "^0.1.2",
"ethers": "^4.0.27",
......@@ -53,7 +53,10 @@
"nyc": "^14.1.1",
"path": "^0.12.7",
"solc": "^0.5.9",
"solidity-coverage": "sc-forks/solidity-coverage#leapdao",
"solidity-coverage": "github:sc-forks/solidity-coverage#leapdao",
"solium": "^1.2.4"
},
"directories": {
"test": "test"
}
}
......@@ -88,10 +88,10 @@ function writeOutput (compiled, buildPath) {
for (let contractFileName in compiled.contracts) {
const contractName = contractFileName.replace('.sol', '')
let contractJson = {
abi: compiled.contracts[contractFileName][contractName].abi,
bytecode: '0x'+compiled.contracts[contractFileName][contractName].evm.bytecode.object
abi: compiled.contracts[contractFileName][contractName].abi,
bytecode: '0x' + compiled.contracts[contractFileName][contractName].evm.bytecode.object
}
fs.outputJsonSync(
path.resolve(buildPath, contractName + '.json'),
......
......@@ -6,20 +6,19 @@ let Parity = require('@caelum-tech/parity')
const ethers = require('ethers')
let parity, wallet, identityAddr, identityContract, IdentityContract
const KEY_OWNER = '0x0000000000000000000000000000000000000000000000000000000000000000'
// const KEY_OWNER = '0x0000000000000000000000000000000000000000000000000000000000000000'
const OPERATION_CALL = 0
const key0 =ethers.utils.formatBytes32String(0)
// const key0 = ethers.utils.formatBytes32String(0)
const key = ethers.utils.formatBytes32String('test')
const value = ethers.utils.formatBytes32String('Hello World')
describe('1.1. Identity', function () {
before(async () => {
parity = new Parity()
wallet = await parity.loadWallet('0x8ad0ba67f8088d1f990f878815173f1dafda0a55', '59Ta_ad6_]k<PWPp')
})
it ('Blockchain should be running', () => {
it('Blockchain should be running', () => {
expect(parity.isBlockchainRunning()).to.not.be.equal(null)
})
......@@ -33,15 +32,15 @@ describe('1.1. Identity', function () {
it('Should Deploy the Identity Contract', (done) => {
IdentityContract = require('../src/contracts/Identity.json')
parity.deployContract(wallet, IdentityContract, [wallet.address])
.then( async (testId) => {
identityAddr = testId.address
expect(identityAddr).to.not.be.equal(null)
.then(async (testId) => {
identityAddr = testId.address
expect(identityAddr).to.not.be.equal(null)
identityContract = parity.getContract(identityAddr, IdentityContract.abi, wallet)
let owner = await identityContract.owner()
expect(owner).to.be.equal(wallet.address)
done()
})
identityContract = parity.getContract(identityAddr, IdentityContract.abi, wallet)
let owner = await identityContract.owner()
expect(owner).to.be.equal(wallet.address)
done()
})
})
it('Should work as expected : setData and getData', (done) => {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment