Skip to content

Commit c9c2031

Browse files
authored
Add slot variable in constructing fake wormhole payloads (#908)
The structure of the fake payload was not as expected. Some tests were failing for the wrong reason but with the right error code. Added one testcase to make sure the default behavior of the forging function is correct.
1 parent ef963cd commit c9c2031

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

target_chains/ethereum/contracts/forge-test/Pyth.WormholeMerkleAccumulator.t.sol

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,7 @@ contract PythWormholeMerkleAccumulatorTest is
522522
isNotMatch(forgeItem, "whUpdateType")
523523
? uint8(PythAccumulator.UpdateType.WormholeMerkle)
524524
: uint8(PythAccumulator.UpdateType.WormholeMerkle) + 1,
525+
uint64(0), // Slot, not used in target networks
525526
uint32(0), // Storage index, not used in target networks
526527
isNotMatch(forgeItem, "rootDigest")
527528
? rootDigest
@@ -597,6 +598,18 @@ contract PythWormholeMerkleAccumulatorTest is
597598
);
598599
}
599600

601+
function testUpdatePriceFeedWithWormholeMerkleWorksWithoutForging() public {
602+
// In this test we make sure the structure returned by createAndForgeWormholeMerkleUpdateData
603+
// is valid if no particular forge flag is set
604+
(
605+
bytes[] memory updateData,
606+
uint updateFee,
607+
bytes32[] memory priceIds
608+
) = createAndForgeWormholeMerkleUpdateData("");
609+
610+
pyth.updatePriceFeeds{value: updateFee}(updateData);
611+
}
612+
600613
function testUpdatePriceFeedWithWormholeMerkleRevertsOnWrongVAAPayloadUpdateType()
601614
public
602615
{

0 commit comments

Comments
 (0)