Skip to content

Commit

Permalink
Fix CI and nits
Browse files Browse the repository at this point in the history
  • Loading branch information
ernestognw committed Nov 23, 2023
1 parent cb599b3 commit 3494dcc
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 14 deletions.
7 changes: 0 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@
"hardhat-gas-reporter": "^1.0.9",
"hardhat-ignore-warnings": "^0.2.0",
"lodash.startcase": "^4.4.0",
"lodash.zip": "^4.2.0",
"micromatch": "^4.0.2",
"p-limit": "^3.1.0",
"prettier": "^3.0.0",
Expand Down
6 changes: 4 additions & 2 deletions test/utils/structs/Checkpoints.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ const { loadFixture } = require('@nomicfoundation/hardhat-network-helpers');

const { VALUE_SIZES } = require('../../../scripts/generate/templates/Checkpoints.opts.js');

const last = array => (array.length ? array[array.length - 1] : undefined);

describe('Checkpoints', function () {
for (const length of VALUE_SIZES) {
describe(`Trace${length}`, function () {
Expand Down Expand Up @@ -113,7 +115,7 @@ describe('Checkpoints', function () {

it('upper lookup & upperLookupRecent', async function () {
for (let i = 0; i < 14; ++i) {
const value = this.checkpoints.findLast(x => i >= x.key)?.value || 0n;
const value = last(this.checkpoints.filter(x => i >= x.key))?.value || 0n;

expect(await this.methods.upperLookup(i)).to.equal(value);
expect(await this.methods.upperLookupRecent(i)).to.equal(value);
Expand All @@ -135,7 +137,7 @@ describe('Checkpoints', function () {
}

for (let i = 0; i < 25; ++i) {
const value = allCheckpoints.findLast(x => i >= x.key)?.value || 0n;
const value = last(allCheckpoints.filter(x => i >= x.key))?.value || 0n;
expect(await this.methods.upperLookup(i)).to.equal(value);
expect(await this.methods.upperLookupRecent(i)).to.equal(value);
}
Expand Down
9 changes: 5 additions & 4 deletions test/utils/structs/DoubleEndedQueue.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ async function fixture() {
}

describe('DoubleEndedQueue', function () {
const bytesA = ethers.AbiCoder.defaultAbiCoder().encode(['uint256'], [0xdeadbeef]);
const bytesB = ethers.AbiCoder.defaultAbiCoder().encode(['uint256'], [0x0123456789]);
const bytesC = ethers.AbiCoder.defaultAbiCoder().encode(['uint256'], [0x42424242]);
const bytesD = ethers.AbiCoder.defaultAbiCoder().encode(['uint256'], [0x171717]);
const coder = ethers.AbiCoder.defaultAbiCoder();
const bytesA = coder.encode(['uint256'], [0xdeadbeef]);
const bytesB = coder.encode(['uint256'], [0x0123456789]);
const bytesC = coder.encode(['uint256'], [0x42424242]);
const bytesD = coder.encode(['uint256'], [0x171717]);

beforeEach(async function () {
Object.assign(this, await loadFixture(fixture));
Expand Down

0 comments on commit 3494dcc

Please sign in to comment.