Skip to content

Commit

Permalink
all building (#375)
Browse files Browse the repository at this point in the history
  • Loading branch information
DrPresident authored Nov 1, 2023
1 parent 40ece0a commit ae81bce
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 23 deletions.
4 changes: 2 additions & 2 deletions contracts/snip20_derivative/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ shade-protocol = { version = "0.1.0", path = "../../packages/shade_protocol", fe
"snip20",
"storage_plus",
] }
secret-toolkit = { version = "0.7.0", features = [
secret-toolkit = { version = "0.10.0", features = [
"permit",
"viewing-key",
] }
secret-toolkit-crypto = { version = "0.7.0", features = ["rand", "hash"]}
secret-toolkit-crypto = { version = "0.10.0", features = ["rand", "hash"]}

schemars = "0.8.11"
serde = { version = "1.0.114", default-features = false, features = ["derive"] }
Expand Down
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 @@ -117,7 +117,7 @@ schemars = "0.8.9"
serde = { version = "1.0.103", default-features = false, features = ["derive", "alloc"] }
thiserror = "1.0"

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
15 changes: 4 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 Expand Up @@ -64,6 +55,7 @@ pub trait InstantiateCallback: Serialize {
msg,
label,
funds,
admin: None,
};
Ok(init.into())
}
Expand Down Expand Up @@ -321,6 +313,7 @@ mod tests {
code_hash,
funds,
label,
admin: None,
}) => {
assert_eq!(code_id, id);
let mut expected_msg = r#"{"f1":1,"f2":2}"#.as_bytes().to_vec();
Expand Down

0 comments on commit ae81bce

Please sign in to comment.