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.
This commit is contained in:
parent
ef963cdfc6
commit
c9c20310d3
|
@ -522,6 +522,7 @@ contract PythWormholeMerkleAccumulatorTest is
|
|||
isNotMatch(forgeItem, "whUpdateType")
|
||||
? uint8(PythAccumulator.UpdateType.WormholeMerkle)
|
||||
: uint8(PythAccumulator.UpdateType.WormholeMerkle) + 1,
|
||||
uint64(0), // Slot, not used in target networks
|
||||
uint32(0), // Storage index, not used in target networks
|
||||
isNotMatch(forgeItem, "rootDigest")
|
||||
? rootDigest
|
||||
|
@ -597,6 +598,18 @@ contract PythWormholeMerkleAccumulatorTest is
|
|||
);
|
||||
}
|
||||
|
||||
function testUpdatePriceFeedWithWormholeMerkleWorksWithoutForging() public {
|
||||
// In this test we make sure the structure returned by createAndForgeWormholeMerkleUpdateData
|
||||
// is valid if no particular forge flag is set
|
||||
(
|
||||
bytes[] memory updateData,
|
||||
uint updateFee,
|
||||
bytes32[] memory priceIds
|
||||
) = createAndForgeWormholeMerkleUpdateData("");
|
||||
|
||||
pyth.updatePriceFeeds{value: updateFee}(updateData);
|
||||
}
|
||||
|
||||
function testUpdatePriceFeedWithWormholeMerkleRevertsOnWrongVAAPayloadUpdateType()
|
||||
public
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue