diff --git a/src/pages/storey/migration-plus.mdx b/src/pages/storey/migration-plus.mdx index eb866178..5c186647 100644 --- a/src/pages/storey/migration-plus.mdx +++ b/src/pages/storey/migration-plus.mdx @@ -4,6 +4,8 @@ tags: ["storey", "storage-plus"] import { Callout, Tabs } from "nextra/components"; +# Migrating from cw-storage-plus to storey + This section is a "cheat sheet" to migrating from `cw-storage-plus` to `storey`. It's ideal for those who have already used `cw-storage-plus`. Feel free to use it to migrate your contracts. @@ -24,14 +26,25 @@ Here's a simple example: ```rust template="storage" use cw_storage_plus::Map; -type Address = String; type Token = String; +type Address = String; +type Token = String; let balances: Map<(Address, Token), u128> = Map::new("b"); -balances .save(&mut storage, ("alice".to_string(), "uusd".to_string()), &100) .unwrap(); - -assert_eq!( balances .load(&storage, ("alice".to_string(), "uusd".to_string())) .unwrap(), 100 ); +balances + .save( + &mut storage, + ("alice".to_string(), "uusd".to_string()), + &100, + ) + .unwrap(); +assert_eq!( + balances + .load(&storage, ("alice".to_string(), "uusd".to_string())) + .unwrap(), + 100 +); ````