Quellcode durchsuchen

fix(target_chains/fuel): initialize all storage variables (#1566)

* initialize all storage variables

* initialize all storage vars
Daniel Chew vor 1 Jahr
Ursprung
Commit
ae8fab1217
1 geänderte Dateien mit 6 neuen und 1 gelöschten Zeilen
  1. 6 1
      target_chains/fuel/contracts/pyth-contract/src/main.sw

+ 6 - 1
target_chains/fuel/contracts/pyth-contract/src/main.sw

@@ -502,6 +502,7 @@ impl PythInit for Contract {
 
             i += 1;
         }
+        storage.latest_price_feed.write(StorageMap::<PriceFeedId, PriceFeed> {});
 
         storage
             .valid_time_period_seconds
@@ -529,8 +530,12 @@ impl PythInit for Contract {
 
         storage.governance_data_source.write(governance_data_source);
         storage.wormhole_governance_data_source.write(wormhole_governance_data_source);
-
+        storage.governance_data_source_index.write(0);
+        storage.wormhole_consumed_governance_actions.write(StorageMap::<b256, bool> {});
         storage.chain_id.write(chain_id);
+        storage.last_executed_governance_sequence.write(0);
+
+        storage.current_implementation.write(Identity::Address(Address::from(ZERO_B256)));
 
         // This function revokes ownership of the current owner and disallows any new owners. https://github.com/FuelLabs/sway-libs/blob/8045a19e3297599750abdf6300c11e9927a29d40/libs/src/ownership.sw#L89-L99
         renounce_ownership();