Skip to content

Commit

Permalink
Update examples/transient_storage.rs
Browse files Browse the repository at this point in the history
Co-authored-by: clearloop <[email protected]>
  • Loading branch information
malik672 and clearloop authored Dec 2, 2024
1 parent fba299f commit 23356af
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions examples/transient_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,10 @@ use zink::storage::TransientStorage;
#[zink::transient_storage(i32)]
pub struct TempCounter;

/// Set value to the transient storage.
/// Set and get value via the transient storage.
#[zink::external]
pub fn set_temp(value: i32) {
pub fn set_and_get_temp(value: i32) -> i32 {
TempCounter::set(value);
}

/// Get value from the transient storage.
#[zink::external]
pub fn get_temp() -> i32 {
TempCounter::get()
}

Expand Down

0 comments on commit 23356af

Please sign in to comment.