Skip to content

Commit 2c14fc0

Browse files
Merge pull request #730 from protofire/fix-remove-test-folder-from-publish
fix: remove test folder from npm publish
2 parents bb8a9f2 + 4e98a5b commit 2c14fc0

File tree

79 files changed

+149
-122
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+149
-122
lines changed

lib/common/contract-builder.js

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
const { times } = require('lodash')
2+
3+
function contractWith(code) {
4+
return `
5+
pragma solidity 0.4.4;
6+
7+
8+
contract A {
9+
${code}
10+
}
11+
`
12+
}
13+
14+
function libraryWith(code) {
15+
return `
16+
pragma solidity 0.4.4;
17+
18+
19+
library A {
20+
${code}
21+
}
22+
`
23+
}
24+
25+
function funcWith(statements) {
26+
return contractWith(`
27+
function b() public {
28+
${statements}
29+
}
30+
`)
31+
}
32+
33+
function modifierWith(statements) {
34+
return contractWith(`
35+
modifier b() {
36+
${statements}
37+
}
38+
`)
39+
}
40+
41+
function multiLine(...args) {
42+
return args.join('\n')
43+
}
44+
45+
function contractWithPrettier(code) {
46+
return `pragma solidity 0.4.4;
47+
48+
contract A {
49+
${code}
50+
}
51+
`
52+
}
53+
54+
function stateDef(count) {
55+
return repeatLines(' uint private a;', count)
56+
}
57+
58+
function constantDef(count) {
59+
return repeatLines(' uint private constant TEST = 1;', count)
60+
}
61+
62+
function repeatLines(line, count) {
63+
return times(count)
64+
.map(() => line)
65+
.join('\n')
66+
}
67+
68+
module.exports = {
69+
contractWith,
70+
libraryWith,
71+
funcWith,
72+
modifierWith,
73+
multiLine,
74+
contractWithPrettier,
75+
stateDef,
76+
constantDef,
77+
repeatLines,
78+
}
File renamed without changes.

test/fixtures/align/array_declaration_with_spaces.js renamed to lib/fixtureCases/align/array_declaration_with_spaces.js

File renamed without changes.

test/fixtures/align/correctly_aligned_function_brackets.js renamed to lib/fixtureCases/align/correctly_aligned_function_brackets.js

File renamed without changes.
File renamed without changes.

test/fixtures/align/expression_with_mixed_tabs_and_spaces.js renamed to lib/fixtureCases/align/expression_with_mixed_tabs_and_spaces.js

File renamed without changes.

test/fixtures/align/expressions_with_correct_comma_align.js renamed to lib/fixtureCases/align/expressions_with_correct_comma_align.js

File renamed without changes.

test/fixtures/align/expressions_with_correct_indents.js renamed to lib/fixtureCases/align/expressions_with_correct_indents.js

File renamed without changes.

test/fixtures/align/expressions_with_correct_semicolon_align.js renamed to lib/fixtureCases/align/expressions_with_correct_semicolon_align.js

File renamed without changes.

test/fixtures/align/expressions_with_incorrect_comma_align.js renamed to lib/fixtureCases/align/expressions_with_incorrect_comma_align.js

File renamed without changes.

0 commit comments

Comments
 (0)