Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Procedural SafeCast.sol generation #3245

Merged
merged 23 commits into from
May 21, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix lint
  • Loading branch information
Amxx committed May 13, 2022
commit 69c65e0ed856bb199851492f38d424cbe06d5101
1 change: 0 additions & 1 deletion contracts/mocks/SafeCastMock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -255,5 +255,4 @@ contract SafeCastMock {
function toInt8(int256 a) public pure returns (int8) {
return a.toInt8();
}

}
2 changes: 1 addition & 1 deletion scripts/generate/format-lines.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function *indentEach (indent, lines) {
} else if (Array.isArray(line)) {
yield * indentEach(indent + 1, line);
frangio marked this conversation as resolved.
Show resolved Hide resolved
} else {
yield ' '.repeat(indent) + line;
yield ' '.repeat(indent) + line;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/generate/templates/SafeCast.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,6 @@ module.exports = format(
toUint(256),
...LENGTHS.map(size => toIntDownCast(size)),
toInt(256).trimEnd(),
].map(fn => fn.split('\n')),
].flatMap(fn => fn.split('\n')),
frangio marked this conversation as resolved.
Show resolved Hide resolved
'}',
);
2 changes: 1 addition & 1 deletion scripts/generate/templates/SafeCastMock.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ module.exports = format(
...LENGTHS.map(size => toUintDownCast(size)),
toInt(256),
...LENGTHS.map(size => toIntDownCast(size)),
].map(fn => fn.split('\n')),
].flatMap(fn => fn.split('\n')).slice(0, -1),
'}',
);