Skip to content

Commit

Permalink
update README
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronc committed Sep 20, 2024
1 parent 1830d78 commit 6516221
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rust/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,15 @@ Here's an example demonstrating all three methods:
```rust
#[publish]
impl MyAccountHandler {
pub fn set_caller_value(&mut self, ctx: &Context, x: u64) -> Result<()> {
pub fn set_caller_value(&self, ctx: &mut Context, x: u64) -> Result<()> {
self.my_map.set(ctx, ctx.caller(), x)?;
Ok(())
}
}

impl MyAccountHandler {
#[publish]
pub fn set_owner(&mut self, ctx: &Context, new_owner: Address) -> Result<()> {
pub fn set_owner(&self, ctx: &mut Context, new_owner: Address) -> Result<()> {
if ctx.caller() != self.owner(ctx)? {
return Err("Unauthorized".into());
}
Expand Down

0 comments on commit 6516221

Please sign in to comment.