Skip to content

Commit

Permalink
review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
VladasZ committed Jan 25, 2024
1 parent 7b20ef4 commit 1d26d97
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 14 deletions.
2 changes: 1 addition & 1 deletion integration-tests/src/defer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ async fn test_defer() -> anyhow::Result<()> {

let (total_fee, total_for_user) = context
.ft_contract()
.calculate_fee_for_batch(BATCH_SIZE, CLAIM_AMOUNT)
.calculate_payout_with_fee_for_batch(BATCH_SIZE, CLAIM_AMOUNT)
.call()
.await?;

Expand Down
2 changes: 1 addition & 1 deletion model/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,5 @@ pub trait StorageManagement {

#[make_integration_version]
pub trait IntegrationTestMethods {
fn calculate_fee_for_batch(&self, batch_size: u32, claim_amount: u32) -> (U128, U128);
fn calculate_payout_with_fee_for_batch(&self, batch_size: u32, claim_amount: u32) -> (U128, U128);
}
Binary file modified res/sweat.wasm
Binary file not shown.
4 changes: 2 additions & 2 deletions sweat-integration/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ impl SweatApiIntegration for SweatFt<'_> {
}

impl IntegrationTestMethodsIntegration for SweatFt<'_> {
fn calculate_fee_for_batch(&self, batch_size: u32, claim_amount: u32) -> ContractCall<(U128, U128)> {
self.make_call("calculate_fee_for_batch")
fn calculate_payout_with_fee_for_batch(&self, batch_size: u32, claim_amount: u32) -> ContractCall<(U128, U128)> {
self.make_call("calculate_payout_with_fee_for_batch")
.args_json(json!({
"batch_size": batch_size,
"claim_amount": claim_amount,
Expand Down
10 changes: 1 addition & 9 deletions sweat/src/defer.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
use near_contract_standards::fungible_token::events::FtMint;
use near_sdk::{
env,
env::{log_str, panic_str},
ext_contract, is_promise_success,
json_types::U128,
near_bindgen, require,
serde_json::json,
env, env::panic_str, ext_contract, is_promise_success, json_types::U128, near_bindgen, require, serde_json::json,
AccountId, Gas, Promise, PromiseOrValue,
};
use sweat_model::SweatDefer;
Expand Down Expand Up @@ -44,9 +39,6 @@ impl SweatDefer for Contract {
// These values calculated in `measure_record_batch_for_hold_test` in claim contract.
let record_batch_for_hold_gas = Gas::ONE_TERA * 8 + Gas(batch_len * ONE_GGAS * 320);

log_str("holding_account_id");
log_str(holding_account_id.as_str());

Promise::new(holding_account_id.clone())
.function_call(
"record_batch_for_hold".to_string(),
Expand Down
2 changes: 1 addition & 1 deletion sweat/src/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use crate::{Contract, ContractExt};

#[near_bindgen]
impl IntegrationTestMethods for Contract {
fn calculate_fee_for_batch(&self, batch_size: u32, claim_amount: u32) -> (U128, U128) {
fn calculate_payout_with_fee_for_batch(&self, batch_size: u32, claim_amount: u32) -> (U128, U128) {
let mut total_fee = 0;
let mut total_for_user = 0;

Expand Down

0 comments on commit 1d26d97

Please sign in to comment.