Skip to content

Commit 55a43f0

Browse files
committed
Move scripts to /scripts/ and reformat codebase
1 parent bea1810 commit 55a43f0

12 files changed

+32
-29
lines changed

.editorconfig

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ indent_size = 4
99
trim_trailing_whitespace = true
1010

1111
[*.js]
12-
indent_size = 2
12+
indent_size = 2

.gitattributes

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
*.sol linguist-language=Solidity
1+
*.sol linguist-language=Solidity

.solcover.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ module.exports = {
33
compileCommand: '../node_modules/.bin/truffle compile',
44
testCommand: 'node --max-old-space-size=4096 ../node_modules/.bin/truffle test --network coverage',
55
skipFiles: ['interfaces','libs']
6-
}
6+
}

.solhint.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
{
2-
"rules": {
3-
"code-complexity": false,
4-
"function-max-lines": false,
5-
"separate-by-one-line-in-contract": false
6-
}
7-
}
1+
{
2+
"rules": {
3+
"code-complexity": false,
4+
"function-max-lines": false,
5+
"separate-by-one-line-in-contract": false
6+
}
7+
}

cleanup-file.sh

-13
This file was deleted.

contracts/ValidatorSetAuRa.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ contract ValidatorSetAuRa is IValidatorSetAuRa, ValidatorSetBase {
8383

8484
function reportMalicious(address _maliciousValidator, uint256 _blockNumber, bytes calldata) external {
8585
address reportingValidator = msg.sender;
86-
uint256 currentBlock = _getCurrentBlockNumber();
86+
uint256 currentBlock = _getCurrentBlockNumber();
8787

8888
require(isReportValidatorValid(_maliciousValidator));
8989
require(_blockNumber <= currentBlock); // avoid reporting about future blocks

scripts/check_for_clashing.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,4 +112,4 @@ async function getHashes(dir, contractName) {
112112
return compiled.contracts[''][contractName].evm.methodIdentifiers;
113113
}
114114

115-
// node check_for_clashing.js
115+
// node check_for_clashing.js

scripts/cleanup-file.sh

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/sh --
2+
set -eu
3+
unset dir || :
4+
printf %s\\n "$0"
5+
case $0 in
6+
(/*) dir=${0%/*}/;;
7+
(*/*) dir=./${0%/*};;
8+
(*) dir=.;;
9+
esac
10+
printf %s\\n "$dir"
11+
cd -L "$dir/.." && {
12+
git ls-files -z |
13+
xargs -0 vim -T dumb -N -u NONE -n -es -S scripts/script.vim --
14+
}

make_flat.sh scripts/make_flat.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ mkdir -p $FLAT$ABSTRACTS;
2222
iterate_sources $ABSTRACTS_FULL $FLAT$ABSTRACTS
2323

2424
mkdir -p $FLAT$STORAGE;
25-
iterate_sources $STORAGE_FULL $FLAT$STORAGE
25+
iterate_sources $STORAGE_FULL $FLAT$STORAGE

scripts/make_spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -208,4 +208,4 @@ async function compile(dir, contractName) {
208208
return {abi: result.abi, bytecode: result.evm.bytecode.object};
209209
}
210210

211-
// NETWORK_NAME=DPoSChain NETWORK_ID=101 OWNER=0x1092a1E3A3F2FB2024830Dd12064a4B33fF8EbAe INITIAL_VALIDATORS=0xeE385a1df869A468883107B0C06fA8791b28A04f,0x71385ae87c4b93db96f02f952be1f7a63f6057a6,0x190ec582090ae24284989af812f6b2c93f768ecd STAKING_EPOCH_DURATION=120960 COLLECT_ROUND_LENGTH=200 node scripts/make_spec.js
211+
// NETWORK_NAME=DPoSChain NETWORK_ID=101 OWNER=0x1092a1E3A3F2FB2024830Dd12064a4B33fF8EbAe INITIAL_VALIDATORS=0xeE385a1df869A468883107B0C06fA8791b28A04f,0x71385ae87c4b93db96f02f952be1f7a63f6057a6,0x190ec582090ae24284989af812f6b2c93f768ecd STAKING_EPOCH_DURATION=120960 COLLECT_ROUND_LENGTH=200 node scripts/make_spec.js

script.vim scripts/script.vim

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
function s:A()
22
set ff=unix eol fenc=UTF-8 nomore
3-
if &ft ==# 'diff'
3+
if &bin
4+
return
5+
elseif &ft ==# 'diff'
46
g/\v^\+/ %s/\v\s+$//e
57
else
68
%s/\v\s+$//e

scripts/test.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,4 @@ if [ "$SOLIDITY_COVERAGE" = true ]; then
6262
fi
6363
else
6464
node_modules/.bin/truffle test "$@" --network test
65-
fi
65+
fi

0 commit comments

Comments
 (0)