Skip to content

Commit 70135b2

Browse files
committed
formatting
1 parent a1a6125 commit 70135b2

7 files changed

+29
-19
lines changed

src/btbe.rs

+3-7
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ use secret_toolkit_crypto::hkdf_sha_256;
1212
use serde::{Deserialize, Serialize};
1313
use serde_big_array::BigArray;
1414

15-
use crate::{constants::{ADDRESS_BYTES_LEN, IMPOSSIBLE_ADDR}, dwb::constant_time_if_else_u32, state::{safe_add, safe_add_u64, INTERNAL_SECRET_SENSITIVE}};
16-
use crate::dwb::{amount_u64, DelayedWriteBufferEntry, TxBundle};
15+
use crate::constants::{ADDRESS_BYTES_LEN, IMPOSSIBLE_ADDR};
16+
use crate::dwb::{amount_u64, constant_time_if_else_u32, DelayedWriteBufferEntry, TxBundle};
17+
use crate::state::{safe_add, safe_add_u64, INTERNAL_SECRET_SENSITIVE};
1718
#[cfg(feature = "gas_tracking")]
1819
use crate::gas_tracker::GasTracker;
1920

@@ -816,9 +817,6 @@ mod tests {
816817
"Init failed: {}",
817818
init_result.err().unwrap()
818819
);
819-
let _env = mock_env();
820-
let _info = mock_info("bob", &[]);
821-
let storage = &mut deps.storage;
822820

823821
let canonical = deps
824822
.api
@@ -852,8 +850,6 @@ mod tests {
852850
"Init failed: {}",
853851
init_result.err().unwrap()
854852
);
855-
let env = mock_env();
856-
let _info = mock_info("bob", &[]);
857853
let storage = &mut deps.storage;
858854

859855
let _ = initialize_btbe(storage).unwrap();

src/contract.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ use crate::notifications::{
3131
AllowanceNotification, MultiRecvdNotification, MultiSpentNotification, RecvdNotification, SpentNotification
3232
};
3333
use crate::state::{
34-
Config, MintersStore, CHANNELS, CONFIG, CONTRACT_STATUS, INTERNAL_SECRET_RELAXED, INTERNAL_SECRET_SENSITIVE, NOTIFICATIONS_ENABLED, TOTAL_SUPPLY
34+
Config, MintersStore, CHANNELS, CONFIG, CONTRACT_STATUS, INTERNAL_SECRET_RELAXED, INTERNAL_SECRET_SENSITIVE, NOTIFICATIONS_ENABLED,
35+
TOTAL_SUPPLY,
3536
};
3637
use crate::strings::TRANSFER_HISTORY_UNSUPPORTED_MSG;
3738

src/execute.rs

-5
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,6 @@ pub fn try_increase_allowance(
121121
spender: spender.clone(),
122122
allowance: Uint128::from(new_amount),
123123
})?);
124-
125-
println!("Got 1 {:?}", resp);
126124

127125
if NOTIFICATIONS_ENABLED.load(deps.storage)? {
128126
let notification = Notification::new (
@@ -139,9 +137,6 @@ pub fn try_increase_allowance(
139137
notification.id_plaintext(),
140138
notification.data_plaintext()
141139
);
142-
143-
println!("Got 2 {:?}", resp);
144-
145140
}
146141

147142
Ok(resp)

src/execute_deposit_redeem.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
use cosmwasm_std::{to_binary, BankMsg, BlockInfo, CanonicalAddr, Coin, CosmosMsg, DepsMut, Env, MessageInfo, Response, StdError, StdResult, Storage, Uint128};
1+
use cosmwasm_std::{
2+
to_binary, BankMsg, BlockInfo, CanonicalAddr, Coin, CosmosMsg, DepsMut, Env, MessageInfo, Response, StdError,
3+
StdResult, Storage, Uint128,
4+
};
25
use secret_toolkit_crypto::ContractPrng;
36

47
use crate::dwb::DWB;

src/execute_transfer_send.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
use cosmwasm_std::{to_binary, Addr, Binary, BlockInfo, CanonicalAddr, CosmosMsg, DepsMut, Env, MessageInfo, Response, StdError, StdResult, Storage, Uint128};
1+
use cosmwasm_std::{
2+
to_binary, Addr, Binary, BlockInfo, CanonicalAddr, CosmosMsg, DepsMut, Env, MessageInfo, Response, StdError, StdResult, Storage,
3+
Uint128
4+
};
25
use secret_toolkit::notification::Notification;
36
use secret_toolkit_crypto::ContractPrng;
47

src/notifications.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
use std::collections::HashMap;
22

3-
use cosmwasm_std::{Addr, Api, Binary, CanonicalAddr, Response, StdError, StdResult};
3+
use cosmwasm_std::{Addr, Api, Binary, CanonicalAddr, Response, StdResult};
44
use primitive_types::{U256, U512};
5-
use secret_toolkit::notification::{get_seed, notification_id, xor_bytes, EncoderExt, CBL_ADDRESS, CBL_ARRAY_SHORT, CBL_BIGNUM_U64, CBL_TIMESTAMP, CBL_U8, Notification, DirectChannel, GroupChannel};
5+
use secret_toolkit::notification::{
6+
get_seed, notification_id, xor_bytes, EncoderExt, CBL_ADDRESS, CBL_ARRAY_SHORT, CBL_BIGNUM_U64, CBL_TIMESTAMP, CBL_U8, Notification,
7+
DirectChannel, GroupChannel,
8+
};
69
use minicbor::Encoder;
710
use secret_toolkit_crypto::{hkdf_sha_512, sha_256};
811
use serde::{Deserialize, Serialize};

src/query.rs

+11-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11
use cosmwasm_std::{to_binary, Addr, Binary, CanonicalAddr, Deps, Env, StdError, StdResult, Storage, Uint128, Uint64};
22
use rand_chacha::ChaChaRng;
33
use rand_core::{RngCore, SeedableRng};
4-
use secret_toolkit::notification::{get_seed, notification_id, BloomParameters, ChannelInfoData, Descriptor, DirectChannel, FlatDescriptor, GroupChannel, StructDescriptor};
4+
use secret_toolkit::notification::{
5+
get_seed, notification_id, BloomParameters, ChannelInfoData, Descriptor, DirectChannel, FlatDescriptor, GroupChannel, StructDescriptor,
6+
};
57
use secret_toolkit::permit::{RevokedPermits, RevokedPermitsStore};
68

7-
use crate::{btbe::{find_start_bundle, stored_balance, stored_entry, stored_tx_count}, dwb::{DWB, TX_NODES}, msg::{AllowanceGivenResult, AllowanceReceivedResult, QueryAnswer}, notifications::{AllowanceNotification, MultiRecvdNotification, MultiSpentNotification, RecvdNotification, SpentNotification}, state::{AllowancesStore, MintersStore, CHANNELS, CONFIG, CONTRACT_STATUS, INTERNAL_SECRET_RELAXED, INTERNAL_SECRET_SENSITIVE, TOTAL_SUPPLY}, transaction_history::Tx};
9+
use crate::btbe::{find_start_bundle, stored_balance, stored_entry, stored_tx_count};
10+
use crate::dwb::{DWB, TX_NODES};
11+
use crate::msg::{AllowanceGivenResult, AllowanceReceivedResult, QueryAnswer};
12+
use crate::notifications::{AllowanceNotification, MultiRecvdNotification, MultiSpentNotification, RecvdNotification, SpentNotification};
13+
use crate::state::{
14+
AllowancesStore, MintersStore, CHANNELS, CONFIG, CONTRACT_STATUS, INTERNAL_SECRET_RELAXED, INTERNAL_SECRET_SENSITIVE, TOTAL_SUPPLY
15+
};
16+
use crate::transaction_history::Tx;
817

918
pub fn query_exchange_rate(storage: &dyn Storage) -> StdResult<Binary> {
1019
let constants = CONFIG.load(storage)?;

0 commit comments

Comments
 (0)