Skip to content

Commit

Permalink
temporary fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jonas089 committed May 2, 2024
1 parent e272f3b commit aa86bd3
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 16 deletions.
12 changes: 6 additions & 6 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 16 additions & 9 deletions kairos-l1-utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ use casper_client::{
get_state_root_hash, query_global_state, types::StoredValue, JsonRpcId, Verbosity,
};
use casper_hashing::Digest;
use casper_types::URef;
use casper_types::{account::AccountHash, PublicKey, URef};

use casper_client::{
rpcs::results::PutDeployResult,
types::{Deploy, DeployBuilder, ExecutableDeployItem, Timestamp},
SuccessResponse,
};
use casper_types::{crypto::SecretKey, Key, RuntimeArgs};
use std::fs;
use std::{fs, thread, time::Duration};

pub const DEFAULT_PAYMENT_AMOUNT: u64 = 1_000_000_000_000;

Expand Down Expand Up @@ -51,7 +51,7 @@ pub async fn query_state_root_hash(node_address: &str) -> Digest {
None,
)
.await
.unwrap()
.expect("Failed to get state root hash")
.result
.state_root_hash
.unwrap()
Expand Down Expand Up @@ -88,7 +88,7 @@ async fn query_stored_value(
path,
)
.await
.unwrap()
.expect("Failed to query stored value")
.result
.stored_value
}
Expand Down Expand Up @@ -119,7 +119,7 @@ pub async fn query_contract_counter(

value
}

/*
#[cfg_attr(not(feature = "cctl-tests"), ignore)]
#[tokio::test]
async fn install_wasm() {
Expand Down Expand Up @@ -198,6 +198,7 @@ async fn install_wasm() {
.await
.unwrap()
}
*/

#[cfg_attr(not(feature = "cctl-tests"), ignore)]
#[tokio::test]
Expand Down Expand Up @@ -277,11 +278,17 @@ async fn counter_query_test() {
.await
.unwrap();

// replace this with a better solution
thread::sleep(Duration::from_secs(10));

let public_key_path = network
.assets_dir
.join("users/user-1/public_key.pem");

let public_key: PublicKey = PublicKey::from_file(public_key_path.to_str().unwrap()).unwrap();
let account_hash: AccountHash = public_key.to_account_hash();
// this is the default cctl account for user-1
let account: Key = Key::from_formatted_str(
"account-hash-5a9eb1f7da515d9fa2f0b74e18ec84cccf90f146269d538073416dff432a3c77",
)
.unwrap();
let account: Key = Key::from(account_hash);
let srh: Digest = query_state_root_hash(node_address).await;
let counter_value: u64 = query_contract_counter(
node_address,
Expand Down
1 change: 0 additions & 1 deletion kairos-test-utils/src/cctl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ impl Drop for CCTLNetwork {
#[cfg(test)]
mod tests {
use super::*;

#[cfg_attr(not(feature = "cctl-tests"), ignore)]
#[tokio::test]
async fn test_cctl_network_starts_and_terminates() {
Expand Down

0 comments on commit aa86bd3

Please sign in to comment.