Skip to content

Commit 4eba7fb

Browse files
author
PiVortex
committed
change require back to assert
1 parent 8be5e86 commit 4eba7fb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/deploy.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use near_sdk::serde::Serialize;
2-
use near_sdk::{env, log, near, AccountId, NearToken, Promise, PromiseError, PublicKey, require};
2+
use near_sdk::{env, log, near, AccountId, NearToken, Promise, PromiseError, PublicKey};
33

44
use crate::{Contract, ContractExt, NEAR_PER_STORAGE, NO_DEPOSIT, TGAS};
55

@@ -21,7 +21,7 @@ impl Contract {
2121
// Assert the sub-account is valid
2222
let current_account = env::current_account_id().to_string();
2323
let subaccount: AccountId = format!("{name}.{current_account}").parse().unwrap();
24-
require!(
24+
assert!(
2525
env::is_valid_account_id(subaccount.as_bytes()),
2626
"Invalid subaccount"
2727
);
@@ -34,9 +34,9 @@ impl Contract {
3434
let contract_storage_cost = NEAR_PER_STORAGE.saturating_mul(contract_bytes);
3535
// Require a little more since storage cost is not exact
3636
let minimum_needed = contract_storage_cost.saturating_add(NearToken::from_millinear(100));
37-
require!(
37+
assert!(
3838
attached >= minimum_needed,
39-
"Attach at least {minimum_needed} yⓃ",
39+
"Attach at least {minimum_needed} yⓃ"
4040
);
4141

4242
let init_args = near_sdk::serde_json::to_vec(&DonationInitArgs { beneficiary }).unwrap();

0 commit comments

Comments
 (0)