Skip to content

Commit 319f012

Browse files
fix: add mut to contract variables in test functions to resolve compilation errors
- Fix mutability errors in test_update_new_price_feed - Fix mutability errors in test_update_existing_price_feed - Fix mutability errors in test_invalid_magic_header - Fix mutability errors in test_invalid_wire_format - Fix mutability errors in test_invalid_wormhole_vaa - Fix mutability errors in test_invalid_merkle_proof All compilation errors related to borrowing immutable contracts as mutable are now resolved. Co-Authored-By: [email protected] <[email protected]>
1 parent fd2bdc2 commit 319f012

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

target_chains/stylus/contracts/pyth-receiver/src/integration_tests.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ mod test {
128128
#[test]
129129
fn test_update_new_price_feed() {
130130
let vm = TestVM::default();
131-
let contract = initialize_test_contract(&vm);
131+
let mut contract = initialize_test_contract(&vm);
132132

133133
let test_price_id = TEST_PRICE_ID;
134134

@@ -144,7 +144,7 @@ mod test {
144144
#[test]
145145
fn test_update_existing_price_feed() {
146146
let vm = TestVM::default();
147-
let contract = initialize_test_contract(&vm);
147+
let mut contract = initialize_test_contract(&vm);
148148

149149
let _test_price_id = TEST_PRICE_ID;
150150

@@ -159,7 +159,7 @@ mod test {
159159
#[test]
160160
fn test_invalid_magic_header() {
161161
let vm = TestVM::default();
162-
let contract = initialize_test_contract(&vm);
162+
let mut contract = initialize_test_contract(&vm);
163163

164164
let invalid_data = create_invalid_magic_data();
165165
let result = contract.update_price_feeds_internal(invalid_data);
@@ -171,7 +171,7 @@ mod test {
171171
#[test]
172172
fn test_invalid_wire_format() {
173173
let vm = TestVM::default();
174-
let contract = initialize_test_contract(&vm);
174+
let mut contract = initialize_test_contract(&vm);
175175

176176
let short_data = create_short_data();
177177
let result = contract.update_price_feeds_internal(short_data);
@@ -183,7 +183,7 @@ mod test {
183183
#[test]
184184
fn test_invalid_wormhole_vaa() {
185185
let vm = TestVM::default();
186-
let contract = initialize_test_contract(&vm);
186+
let mut contract = initialize_test_contract(&vm);
187187

188188
let invalid_vaa_data = create_invalid_vaa_data();
189189
let result = contract.update_price_feeds_internal(invalid_vaa_data);
@@ -194,7 +194,7 @@ mod test {
194194
#[test]
195195
fn test_invalid_merkle_proof() {
196196
let vm = TestVM::default();
197-
let contract = initialize_test_contract(&vm);
197+
let mut contract = initialize_test_contract(&vm);
198198

199199
let invalid_merkle_data = create_invalid_merkle_data();
200200
let result = contract.update_price_feeds_internal(invalid_merkle_data);

0 commit comments

Comments
 (0)