Skip to content

Commit

Permalink
Merge a43cad8 into 5a91e39
Browse files Browse the repository at this point in the history
  • Loading branch information
dapplion committed May 24, 2023
2 parents 5a91e39 + a43cad8 commit 08b6806
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,18 @@ describe("getExpectedWithdrawals", () => {

for (const opts of testCases) {
const caseID = [
`eb ${opts.excessBalance}`,
`eth1 ${opts.eth1Credentials}`,
`we ${opts.withdrawable}`,
`wn ${opts.withdrawn}`,
`eb:${opts.excessBalance}`,
`eth1:${opts.eth1Credentials}`,
`we:${opts.withdrawable}`,
`wn:${opts.withdrawn}`,
opts.cache ? null : "nocache",
`- smpl ${opts.sampled}`,
`smpl:${opts.sampled}`,
]
.filter((str) => str)
.join(" ");
.join(",");

itBench<CachedBeaconStateCapella, CachedBeaconStateCapella>({
id: `vc - ${vc} ${caseID}`,
id: `getExpectedWithdrawals ${vc} ${caseID}`,
yieldEventLoopAfterEach: true, // So SubTree(s)'s WeakRef can be garbage collected https://github.com/nodejs/node/issues/39902
before: () => {
const state = getExpectedWithdrawalsTestData(vc, opts);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,18 @@ describe("getExpectedWithdrawals", () => {

for (const opts of testCases) {
const caseID = [
`eb ${opts.excessBalance}`,
`eth1 ${opts.eth1Credentials}`,
`we ${opts.withdrawable}`,
`wn ${opts.withdrawn}`,
`eb:${opts.excessBalance}`,
`eth1:${opts.eth1Credentials}`,
`we:${opts.withdrawable}`,
`wn:${opts.withdrawn}`,
]
.filter((str) => str)
.join(" ");
.join(",");

// Clone true to drop cache
const state = beforeValue(() => getExpectedWithdrawalsTestData(vc, opts).clone(true));

it(`vc - ${vc} ${caseID}`, () => {
it(`getExpectedWithdrawals ${vc} ${caseID}`, () => {
const {sampledValidators, withdrawals} = getExpectedWithdrawals(state.value);
expect(sampledValidators).equals(opts.sampled, "Wrong sampledValidators");
expect(withdrawals.length).equals(opts.withdrawals, "Wrong withdrawals");
Expand Down

0 comments on commit 08b6806

Please sign in to comment.