Skip to content

Commit

Permalink
apply comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Daanvdplas committed Apr 24, 2024
1 parent c9219e6 commit a890520
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion pop-api/examples/balance-transfer/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "balances"
name = "balance_transfer"
version = "0.1.0"
authors = ["[your_name] <[your_email]>"]
edition = "2021"
Expand Down
4 changes: 2 additions & 2 deletions pop-api/examples/balance-transfer/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ mod balance_transfer {
value: Balance,
) -> Result<(), ContractError> {
ink::env::debug_println!(
"BalanceTransfer::transfer_through_runtime: \nreceiver: {:?}, \nvalue: {:?}",
"BalanceTransfer::transfer: \nreceiver: {:?}, \nvalue: {:?}",
receiver,
value
);

transfer_keep_alive(receiver, value)?;

ink::env::debug_println!("BalanceTransfer::transfer_through_runtime end");
ink::env::debug_println!("BalanceTransfer::transfer end");
Ok(())
}
}
Expand Down
10 changes: 5 additions & 5 deletions pop-api/examples/nfts/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ mod nfts {
}

#[ink(message)]
pub fn mint_through_runtime(
pub fn mint(
&mut self,
collection_id: u32,
item_id: u32,
receiver: AccountId,
) -> Result<(), ContractError> {
ink::env::debug_println!(
"Nfts::mint_through_runtime: collection_id: {:?} item_id {:?} receiver: {:?}",
"Nfts::mint: collection_id: {:?} item_id {:?} receiver: {:?}",
collection_id,
item_id,
receiver
Expand All @@ -53,21 +53,21 @@ mod nfts {

// mint api
mint(collection_id, item_id, receiver)?;
ink::env::debug_println!("Nfts::mint_through_runtime: item minted successfully");
ink::env::debug_println!("Nfts::mint: item minted successfully");

// check owner
match owner(collection_id, item_id)? {
Some(owner) if owner == receiver => {
ink::env::debug_println!(
"Nfts::mint_through_runtime success: minted item belongs to receiver"
"Nfts::mint success: minted item belongs to receiver"
);
},
_ => {
return Err(ContractError::NotOwner);
},
}

ink::env::debug_println!("Nfts::mint_through_runtime end");
ink::env::debug_println!("Nfts::mint end");
Ok(())
}
}
Expand Down
2 changes: 1 addition & 1 deletion runtime/devnet/src/extensions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ mod tests {
let _ = env_logger::try_init();

let (wasm_binary, _) = load_wasm_module::<Runtime>(
"../../pop-api/examples/balance-transfer/target/ink/balances.wasm",
"../../pop-api/examples/balance-transfer/target/ink/balance_transfer.wasm",
)
.unwrap();

Expand Down
2 changes: 1 addition & 1 deletion runtime/testnet/src/extensions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ mod tests {
let _ = env_logger::try_init();

let (wasm_binary, _) = load_wasm_module::<Runtime>(
"../../pop-api/examples/balance-transfer/target/ink/balances.wasm",
"../../pop-api/examples/balance-transfer/target/ink/balance_transfer.wasm",
)
.unwrap();

Expand Down

0 comments on commit a890520

Please sign in to comment.