Skip to content

Commit 76afb02

Browse files
Add debug changes and VAA generation helper
Co-Authored-By: [email protected] <[email protected]>
1 parent 0b71196 commit 76afb02

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

target_chains/ethereum/contracts/forge-test/GenerateGovernanceVAAs.t.sol

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,29 @@ contract GenerateGovernanceVAAs is Test, WormholeTestUtils, PythTestUtils, PythG
133133
console.logBytes(vaa);
134134
}
135135

136+
function testGenerateWithdrawFeeVAAWithAlice() public view {
137+
// Generate VAA with Alice's address: 0x70997970C51812dc3A010C7d01b50e0d17dc79C8
138+
bytes memory withdrawFeeMessage = abi.encodePacked(
139+
MAGIC,
140+
uint8(GovernanceModule.Target),
141+
uint8(GovernanceAction.WithdrawFee),
142+
TARGET_CHAIN_ID,
143+
hex"70997970C51812dc3A010C7d01b50e0d17dc79C8", // Alice's address (20 bytes)
144+
uint64(100), // value (8 bytes)
145+
uint64(3) // expo (8 bytes)
146+
);
147+
148+
bytes memory vaa = encodeAndSignMessage(
149+
withdrawFeeMessage,
150+
TEST_GOVERNANCE_CHAIN_ID,
151+
TEST_GOVERNANCE_EMITTER,
152+
1
153+
);
154+
155+
console.log("test_withdraw_fee VAA with Alice:");
156+
console.logBytes(vaa);
157+
}
158+
136159
function encodeAndSignMessage(
137160
bytes memory data,
138161
uint16 emitterChainId,

target_chains/stylus/contracts/wormhole/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,7 @@ impl IWormhole for WormholeContract {
502502

503503
let vaa = self.parse_vm(&encoded_vaa)?;
504504
self.verify_vm(&vaa)?;
505+
505506
Ok(vaa)
506507
}
507508

0 commit comments

Comments
 (0)