-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
use beerus::gen::{client::Client, Address, BlockId, BlockTag, Felt, Rpc}; | ||
|
||
mod common; | ||
|
||
#[ignore] | ||
#[tokio::test] | ||
async fn declare_account() { | ||
let url = "http://127.0.0.1:5050"; | ||
let client = Client::new(url); | ||
|
||
let res_chain_id = client.chainId().await; | ||
assert!(res_chain_id.is_ok()); | ||
assert_eq!(res_chain_id.unwrap().as_ref(), "0x4b4154414e41"); | ||
|
||
let block_id = BlockId::BlockTag(BlockTag::Pending); | ||
let class_hash = Felt::try_new( | ||
"0x6b46f84b1bbb779e588a9c5f577907c3dfb66e6b13cf4c4f480d4fb1677c2ba", | ||
) | ||
.unwrap(); | ||
let res_class = client.getClass(block_id.clone(), class_hash).await; | ||
assert!(res_class.is_err()); | ||
assert!(res_class.unwrap_err().message.contains("Class hash not found")); | ||
|
||
let contract_address = Address( | ||
Felt::try_new( | ||
"0x6162896d1d7ab204c7ccac6dd5f8e9e7c25ecd5ae4fcb4ad32e57786bb46e03", | ||
) | ||
.unwrap(), | ||
); | ||
let res_nonce = client.getNonce(block_id, contract_address).await; | ||
assert!(res_nonce.is_ok()); | ||
assert_eq!(res_nonce.unwrap().as_ref(), "0x0"); | ||
} |