Skip to content

Commit

Permalink
format: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
emarai committed Sep 3, 2021
1 parent d86e631 commit b2262b4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
6 changes: 3 additions & 3 deletions paras-nft-contract/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ impl Contract {
refund_deposit(env::storage_usage() - initial_storage_usage, 0);

TokenSeriesJson{
token_series_id: token_series_id,
token_series_id,
metadata: token_metadata,
creator_id: creator_id.into(),
royalty: royalty_res,
Expand Down Expand Up @@ -492,7 +492,7 @@ impl Contract {
pub fn nft_get_series_single(&self, token_series_id: TokenSeriesId) -> TokenSeriesJson {
let token_series = self.token_series_by_id.get(&token_series_id).expect("Series does not exist");
TokenSeriesJson{
token_series_id: token_series_id,
token_series_id,
metadata: token_series.metadata,
creator_id: token_series.creator_id,
royalty: token_series.royalty,
Expand Down Expand Up @@ -525,7 +525,7 @@ impl Contract {
.skip(start_index as usize)
.take(limit)
.map(|(token_series_id, token_series)| TokenSeriesJson{
token_series_id: token_series_id,
token_series_id,
metadata: token_series.metadata,
creator_id: token_series.creator_id,
royalty: token_series.royalty,
Expand Down
16 changes: 10 additions & 6 deletions tests/simulation_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use near_sdk_sim::{
};
use near_sdk::serde_json::json;


pub const NFT_CONTRACT_ID: &str = "nft";

near_sdk_sim::lazy_static_include::lazy_static_include_bytes! {
Expand Down Expand Up @@ -68,7 +67,8 @@ fn simulate_create_new_series() {
to_yocto("2")
);

let storage_price_for_adding_series = (nft.account().unwrap().storage_usage - initial_storage_usage) as u128 * 10u128.pow(19);
let storage_price_for_adding_series =
(nft.account().unwrap().storage_usage - initial_storage_usage) as u128 * 10u128.pow(19);
println!("[CREATE SERIES] Storage price: {} yoctoNEAR", storage_price_for_adding_series);
println!("[CREATE SERIES] Gas burnt price: {} TeraGas", outcome.gas_burnt() as f64 / 1e12);
}
Expand Down Expand Up @@ -109,7 +109,8 @@ fn simulate_mint() {
to_yocto("2")
);

let storage_price_for_mint = (nft.account().unwrap().storage_usage - initial_storage_usage) as u128 * 10u128.pow(19);
let storage_price_for_mint =
(nft.account().unwrap().storage_usage - initial_storage_usage) as u128 * 10u128.pow(19);
println!("[MINT] Storage price: {} yoctoNEAR", storage_price_for_mint);
println!("[MINT] Gas burnt price: {} TeraGas", outcome.gas_burnt() as f64 / 1e12);

Expand All @@ -126,7 +127,8 @@ fn simulate_mint() {
to_yocto("2")
);

let storage_price_for_mint = (nft.account().unwrap().storage_usage - initial_storage_usage) as u128 * 10u128.pow(19);
let storage_price_for_mint: u128 =
(nft.account().unwrap().storage_usage - initial_storage_usage) as u128 * 10u128.pow(19);
println!("[MINT 2nd] Storage price: {} yoctoNEAR", storage_price_for_mint);
println!("[MINT 2nd] Gas burnt price: {} TeraGas", outcome.gas_burnt() as f64 / 1e12);

Expand All @@ -143,7 +145,8 @@ fn simulate_mint() {
to_yocto("2")
);

let storage_price_for_mint = (nft.account().unwrap().storage_usage - initial_storage_usage) as u128 * 10u128.pow(19);
let storage_price_for_mint =
(nft.account().unwrap().storage_usage - initial_storage_usage) as u128 * 10u128.pow(19);
println!("[MINT 3nd] Storage price: {} yoctoNEAR", storage_price_for_mint);
println!("[MINT 3nd] Gas burnt price: {} TeraGas", outcome.gas_burnt() as f64 / 1e12);

Expand Down Expand Up @@ -198,7 +201,8 @@ fn simulate_approve() {
to_yocto("2")
);

let storage_price_for_approve = (nft.account().unwrap().storage_usage - initial_storage_usage) as u128 * 10u128.pow(19);
let storage_price_for_approve =
(nft.account().unwrap().storage_usage - initial_storage_usage) as u128 * 10u128.pow(19);
println!("[APPROVE] Storage price: {} yoctoNEAR", storage_price_for_approve);
println!("[APPROVE] Gas burnt price: {} TeraGas", outcome.gas_burnt() as f64 / 1e12);
}
Expand Down

0 comments on commit b2262b4

Please sign in to comment.