yarn test currently runs two cases (23 are skipped). subgraph does not fail passes. correctly updates the broadcaster deposit when ticket value is less than deposit fails, so the suite exits 1 even when the subgraph is fine.
Found while validating #263, after #265 and #266 made the docker stack bootable again.
Three problems, in order of discovery:
- The ticket hash is ABI-encoded with the wrong types:
recipientRandHash as string (contract: bytes32) and auxData as uint256 (contract: bytes). ethers throws value out-of-bounds before anything reaches the chain. Fix: use TicketBroker.getTicketHash(ticket).
signer.signMessage(hexString) signs the UTF-8 text of the hex string, not the hash bytes. And geth's personal_sign requires a password argument that ethers' remote signer does not send, so it fails with missing value for required argument 2. Fix: provider.send("personal_sign", [hash, address, ""]).
- With 1 and 2 fixed,
redeemWinningTicket reverts on chain. Reason not yet identified. The geth-with-livepeer-protocol:streamflow image deploys a 2022 protocol commit, so this may be an image-side rule. Not worth debugging until the anvil-based test image from the testnet proposal exists.
The test also has no assertion, it only logs the query result.
Suggested short-term: land fixes 1 and 2 and it.skip the case with a pointer here, so yarn test exits 0 and can gate dependency PRs. Branch fix/ticket-hash-encoding has 1 and 2.
yarn testcurrently runs two cases (23 are skipped).subgraph does not failpasses.correctly updates the broadcaster deposit when ticket value is less than depositfails, so the suite exits 1 even when the subgraph is fine.Found while validating #263, after #265 and #266 made the docker stack bootable again.
Three problems, in order of discovery:
recipientRandHashasstring(contract:bytes32) andauxDataasuint256(contract:bytes). ethers throwsvalue out-of-boundsbefore anything reaches the chain. Fix: useTicketBroker.getTicketHash(ticket).signer.signMessage(hexString)signs the UTF-8 text of the hex string, not the hash bytes. And geth'spersonal_signrequires a password argument that ethers' remote signer does not send, so it fails withmissing value for required argument 2. Fix:provider.send("personal_sign", [hash, address, ""]).redeemWinningTicketreverts on chain. Reason not yet identified. Thegeth-with-livepeer-protocol:streamflowimage deploys a 2022 protocol commit, so this may be an image-side rule. Not worth debugging until the anvil-based test image from the testnet proposal exists.The test also has no assertion, it only logs the query result.
Suggested short-term: land fixes 1 and 2 and
it.skipthe case with a pointer here, soyarn testexits 0 and can gate dependency PRs. Branchfix/ticket-hash-encodinghas 1 and 2.