Skip to content

Commit

Permalink
chore: remove unknown casts in archiver test (#648)
Browse files Browse the repository at this point in the history
Removes intermediate casts to unknown from archiver test, which hide
type errors in the args of the mocked event.
  • Loading branch information
spalladino authored May 22, 2023
1 parent de6006e commit 34b8249
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions yarn-project/archiver/src/archiver/archiver.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function makeL2BlockProcessedEvent(l1BlockNum: bigint, l2BlockNum: bigint) {
blockNumber: l1BlockNum,
args: { blockNum: l2BlockNum },
transactionHash: `0x${l2BlockNum}`,
} as unknown as Log<bigint, number, undefined, typeof RollupAbi, 'L2BlockProcessed'>;
} as Log<bigint, number, undefined, typeof RollupAbi, 'L2BlockProcessed'>;
}

/**
Expand All @@ -95,11 +95,11 @@ function makeUnverifiedDataEvent(l1BlockNum: bigint, l2BlockNum: bigint) {
blockNumber: l1BlockNum,
args: {
l2BlockNum,
sender: EthAddress.random(),
sender: EthAddress.random().toString(),
data: '0x' + createRandomUnverifiedData(16).toString('hex'),
},
transactionHash: `0x${l2BlockNum}`,
} as unknown as Log<bigint, number, undefined, typeof UnverifiedDataEmitterAbi, 'UnverifiedData'>;
} as Log<bigint, number, undefined, typeof UnverifiedDataEmitterAbi, 'UnverifiedData'>;
}

/**
Expand All @@ -126,7 +126,7 @@ function makeContractDeployedEvent(l1BlockNum: bigint, l2BlockNum: bigint) {
acir: '0x' + acir,
},
transactionHash: `0x${l2BlockNum}`,
} as unknown as Log<bigint, number, undefined, typeof UnverifiedDataEmitterAbi, 'ContractDeployed'>;
} as Log<bigint, number, undefined, typeof UnverifiedDataEmitterAbi, 'ContractDeployment'>;
}

/**
Expand Down

0 comments on commit 34b8249

Please sign in to comment.