Skip to content

Commit

Permalink
[autofix.ci] apply automated fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
autofix-ci[bot] authored Nov 28, 2024
1 parent 8d2c041 commit f3a17ba
Showing 1 changed file with 8 additions and 15 deletions.
23 changes: 8 additions & 15 deletions src/pages/storey/migration-plus.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ tags: ["storey", "storage-plus"]

import { Callout, Tabs } from "nextra/components";

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.
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.

## Composite keys (tuples)

Expand All @@ -24,22 +24,15 @@ 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();
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
);
```
assert_eq!( balances .load(&storage, ("alice".to_string(), "uusd".to_string())) .unwrap(), 100 );

````

</Tabs.Tab>
<Tabs.Tab>
Expand Down Expand Up @@ -72,7 +65,7 @@ assert_eq!(
.unwrap(),
Some(100)
);
```
````

</Tabs.Tab>
</Tabs>
Expand Down

0 comments on commit f3a17ba

Please sign in to comment.