You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let hex_str = "010000000001001daf08e5e3799cbc6096a90c2361e43220325418f377620a7a73d6bece18322679f6ada9725d9081743805efb8bccecd51098f1d76f34cba8b835fae643bbd9c000000000100000000000100000000000000000000000000000000000000000000000000000000000000110000000000000001005054474d010600027e5f4552091a69125d5dfcb7b8c2659029395bdf";
189
-
let bytes = Vec::from_hex(hex_str).expect("Invalid hex string");
185
+
// This test is commented out because it requires an already deployed new Wormhole contract.
186
+
// This function demonstrates the usage of this instruction, however.
let hex_str = "010000000001001daf08e5e3799cbc6096a90c2361e43220325418f377620a7a73d6bece18322679f6ada9725d9081743805efb8bccecd51098f1d76f34cba8b835fae643bbd9c000000000100000000000100000000000000000000000000000000000000000000000000000000000000110000000000000001005054474d010600027e5f4552091a69125d5dfcb7b8c2659029395bdf";
197
+
let bytes = Vec::from_hex(hex_str).expect("Invalid hex string");
198
+
199
+
let result = pyth_contract
200
+
.sender(alice)
201
+
.execute_governance_instruction(bytes.clone());
202
+
if result.is_err() {
203
+
println!(
204
+
"SetWormholeAddress Error: {:?}",
205
+
result.as_ref().unwrap_err()
206
+
);
207
+
}
208
+
assert!(result.is_ok());
209
+
210
+
let result2 = pyth_contract
211
+
.sender(alice)
212
+
.execute_governance_instruction(bytes.clone());
213
+
assert!(result2.is_err(), "Second execution should fail due to sequence number check");
190
214
191
-
let result = pyth_contract
192
-
.sender(alice)
193
-
.execute_governance_instruction(bytes.clone());
194
-
if result.is_err(){
195
-
println!(
196
-
"SetWormholeAddress Error: {:?}",
197
-
result.as_ref().unwrap_err()
198
-
);
199
215
}
200
-
assert!(result.is_ok());
201
-
202
-
let result2 = pyth_contract
203
-
.sender(alice)
204
-
.execute_governance_instruction(bytes.clone());
205
-
assert!(result2.is_err(),"Second execution should fail due to sequence number check");
206
-
207
-
}
208
-
216
+
*/
209
217
#[motsu::test]
210
218
fntest_authorize_governance_data_source_transfer(
211
219
pyth_contract:Contract<PythReceiver>,
@@ -254,8 +262,10 @@ mod test {
254
262
let result2 = pyth_contract
255
263
.sender(alice)
256
264
.execute_governance_instruction(bytes.clone());
257
-
assert!(result2.is_err(),"Second execution should fail due to sequence number check");
258
-
265
+
assert!(
266
+
result2.is_err(),
267
+
"Second execution should fail due to sequence number check"
268
+
);
259
269
}
260
270
261
271
// Fee transfers can't be done in the motsu testing framework. This commented test serves as an example for how to use the function, though.
0 commit comments