Skip to content

Commit

Permalink
Merge branch 'main' into lob/library
Browse files Browse the repository at this point in the history
  • Loading branch information
kent-3 committed May 26, 2024
2 parents 9d91e6e + ae81bce commit 66c186b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 21 deletions.
20 changes: 11 additions & 9 deletions contracts/snip20_derivative/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ use secret_toolkit::{
utils::{pad_handle_result, pad_query_result},
};

use secret_toolkit_crypto::{sha_256, Prng};
use secret_toolkit_crypto::{sha_256, ContractPrng};
use serde::de::DeserializeOwned;
use shade_protocol::query_auth::QueryPermit;

Expand Down Expand Up @@ -1172,13 +1172,15 @@ fn query_rewards<C: CustomQuery>(
fn query_rewards<C: CustomQuery>(_: QuerierWrapper<C>, _: &Addr, _: &Config) -> StdResult<Rewards> {
use crate::staking_interface::RewardToken;

Ok(Rewards { rewards: vec![Reward{
token: RewardToken {
address: Addr::unchecked("shade_contract_info_address"),
code_hash: String::from("shade_contract_info_code_hash"),
},
amount: Uint128::from(100000000_u128)
}] })
Ok(Rewards {
rewards: vec![Reward {
token: RewardToken {
address: Addr::unchecked("shade_contract_info_address"),
code_hash: String::from("shade_contract_info_code_hash"),
},
amount: Uint128::from(100000000_u128),
}],
})
}

#[cfg(test)]
Expand Down Expand Up @@ -1477,7 +1479,7 @@ pub fn new_viewing_key(
rng_entropy.extend_from_slice(sender.as_bytes());
rng_entropy.extend_from_slice(entropy);

let mut rng = Prng::new(seed, &rng_entropy);
let mut rng = ContractPrng::new(seed, &rng_entropy);

let rand_slice = rng.rand_bytes();

Expand Down
2 changes: 1 addition & 1 deletion packages/shade_protocol/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ schemars = "0.8.16"
serde = { version = "1.0.193", default-features = false, features = ["derive", "alloc"] }
thiserror = "1.0.50"

secret-storage-plus = { git = "https://github.com/securesecrets/secret-plus-utils", version = "0.13.4", optional = true }
secret-storage-plus = { git = "https://github.com/securesecrets/secret-plus-utils", tag = "v0.1.1", optional = true, features = [] }

# Testing
anyhow = { version = "1", optional = true }
Expand Down
13 changes: 2 additions & 11 deletions packages/shade_protocol/src/utils/callback.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,8 @@ use crate::multi_test::{App, AppResponse, Contract as MultiContract, Executor};
use crate::AnyResult;
use crate::{
c_std::{
to_binary,
Addr,
Coin,
ContractInfo,
CosmosMsg,
Empty,
QuerierWrapper,
QueryRequest,
StdResult,
WasmMsg,
WasmQuery,
to_binary, Addr, Coin, ContractInfo, CosmosMsg, Empty, QuerierWrapper, QueryRequest,
StdResult, WasmMsg, WasmQuery,
},
serde::{de::DeserializeOwned, Serialize},
Contract,
Expand Down

0 comments on commit 66c186b

Please sign in to comment.