Skip to content

Commit

Permalink
Lm changed proxy name (#553)
Browse files Browse the repository at this point in the history
  • Loading branch information
LouiseMedova authored Jan 17, 2025
1 parent 20e5b3f commit 0ccfc02
Show file tree
Hide file tree
Showing 24 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions contracts/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ members = [
"oracle",
"oracle/randomness",
"ping-pong",
"proxy-example/counter",
"proxy-example/upgrade-proxy",
"upgrade-proxy/counter",
"upgrade-proxy/upgrade-proxy",
"rmrk",
"rmrk/catalog",
"rmrk/resource",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ pub fn contribute(&mut self, msg_source: Option<ActorId>) -> u128 {
#### State Migration
State migration allows the transfer of critical program data from an old program to a new one, enabling smooth upgrades while preserving important state variables. In this example, the migration involves exporting specific fields (`value`, `limit`, and `contributions`) and importing them into a new instance of the program.
1. Exporting State
The `export_migration_state` function serializes only the necessary fields from the program's state and encodes them for transfer.

The `export_migration_state` function serializes only the necessary fields from the program's state and encodes them for transfer.
```rust
/// Exports the essential state for migration.
/// Only includes `value`, `limit`, and `contributions` fields.
Expand All @@ -103,7 +104,8 @@ pub fn export_migration_state(&self) -> Vec<u8> {
}
```
2. Importing State
The `import_migration_state` function allows a new program to decode and load the state exported from the old program.

The `import_migration_state` function allows a new program to decode and load the state exported from the old program.
```rust
/// Imports the state from the previous program.
/// Decodes and applies `value`, `limit`, and `contributions` fields.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 0ccfc02

Please sign in to comment.