Skip to content

Commit

Permalink
Add travis, remove unused files, restructure others
Browse files Browse the repository at this point in the history
  • Loading branch information
gamalielhere committed Aug 21, 2018
1 parent ae21113 commit 29361ff
Show file tree
Hide file tree
Showing 1,023 changed files with 90,496 additions and 62,217 deletions.
4 changes: 0 additions & 4 deletions .ci/kontinuum.json

This file was deleted.

16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.DS_Store
node_modules/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
/test/unit/coverage/
/test/e2e/reports/
selenium-debug.log

# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
30 changes: 30 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,33 @@ script:
echo "No errors";
exit 0;
fi
stages:
- name: check contract format
- name: check token format

jobs:
fast_finish: true
include:
- stage: check contract format
script:
- |
val=$(node checkContract.js);
if [[ $val != 0 ]]; then
echo "Formatting errors! Please check your object keys spellings, commas and or other things that might invalidate your JSON and try again";
exit 1;
else
echo "No errors";
exit 0;
fi
- stage: check token format
script:
- |
val=$(node checkToken.js);
if [[ $val != 0 ]]; then
echo "Formatting errors! Please check your object keys spellings, commas and or other things that might invalidate your JSON and try again";
exit 1;
else
echo "No errors";
exit 0;
fi
28 changes: 0 additions & 28 deletions build.gradle

This file was deleted.

68 changes: 68 additions & 0 deletions checkContract.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
const fs = require("fs");
const contractsDirectory = "./src/contracts/";
const Schema = require("validate");
const contract = new Schema({
name: {
type: String,
required: true
},
address: {
type: String,
required: true
},
abi: {
type: Array,
required: true
}
});

let errors = 0;

// function createFiles() {
// if (!fs.existsSync("./dist/contracts")) {
// fs.mkdirSync("./dist/contracts");
// }
// fs.readdirSync(contractsDirectory).forEach(folder => {
// let newArr = [];
// if (!fs.existsSync(`./dist/contracts/${folder}`)) {
// fs.mkdirSync(`./dist/contracts/${folder}`);
// }
// fs.readdirSync(`${contractsDirectory}/${folder}`).forEach(file => {
// const obj = JSON.parse(
// fs.readFileSync(`${contractsDirectory}/${folder}/${file}`, "utf8")
// );
// newArr.push(obj);
// });
// const writeArray = newArr.sort(function(a, b) {
// let aSym = a.name.toUpperCase();
// let bSym = b.name.toUpperCase();
// return aSym < bSym ? -1 : aSym > bSym ? 1 : 0;
// });
//
// fs.writeFileSync(
// `./dist/contracts/${folder}/contract-abi-${folder}.min.json`,
// JSON.stringify(writeArray)
// );
// fs.writeFileSync(
// `./dist/contracts/${folder}/contract-abi-${folder}.json`,
// JSON.stringify(writeArray)
// );
// });
// }

function run() {
fs.readdirSync(contractsDirectory).forEach(folder => {
fs.readdirSync(`${contractsDirectory}/${folder}`).forEach(file => {
const obj = JSON.parse(
fs.readFileSync(`${contractsDirectory}/${folder}/${file}`, "utf8")
);
if (contract.validate(obj) === false) {
errors++;
}
});
});
// createFiles();
return errors;
}

run();
99 changes: 0 additions & 99 deletions checkFormat.js

This file was deleted.

Loading

0 comments on commit 29361ff

Please sign in to comment.