Skip to content

Commit

Permalink
test: added tests headers
Browse files Browse the repository at this point in the history
  • Loading branch information
ametel01 committed May 14, 2024
1 parent cb9ca36 commit 889fd74
Show file tree
Hide file tree
Showing 4 changed files with 244 additions and 1 deletion.
2 changes: 1 addition & 1 deletion starknet/src/fact_registry/contract.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ pub mod FactRegistry {
let result_values = self.extract_list_values(result, result_items.span());

match option {
OptionsSet::StorageHash => {},
OptionsSet::CodeHash => {
let code_hash = *result_values.at(3);
self
Expand All @@ -71,6 +70,7 @@ pub mod FactRegistry {
let nonce = *(*result_values.at(0)).values.at(0);
self.verified_account_nonce.write((account, block), nonce);
},
OptionsSet::StorageHash => {},
};
}
}
Expand Down
80 changes: 80 additions & 0 deletions starknet/tests/test_fact_registry.cairo
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
use fossil::fact_registry::interface::IFactRegistryDispatcherTrait;
use super::test_utils::setup;

#[test]
fn prove_account_test_success_code_hash() {
assert!(true)
}

#[test]
fn prove_account_test_success_balance() {
assert!(true)
}

#[test]
fn prove_account_test_success_nonce() {
assert!(true)
}

#[test]
#[should_panic]
fn prove_account_test_fail_state_root_is_zero() {
assert!(false)
}

#[test]
#[should_panic]
fn prove_account_test_fail_account_not_found() {
assert!(false)
}

#[test]
fn get_storage_test_success_with_some_data() {
assert!(true)
}

#[test]
fn get_storage_test_success_with_no_data() {
assert!(true)
}

#[test]
#[should_panic]
fn get_storage_test_fail_state_root_is_zero() {
assert!(false)
}

#[test]
fn get_storage_uint_test_success() {
assert!(true)
}

#[test]
fn get_initialized_test() {
assert!(true)
}

#[test]
fn get_l1_headers_store_addr_test() {
assert!(true)
}

#[test]
fn get_verified_account_storage_hash_test() {
assert!(true)
}

#[test]
fn get_verified_account_code_hash_test() {
assert!(true)
}

#[test]
fn get_verified_account_balance_test() {
assert!(true)
}

#[test]
fn get_verified_account_nonce_test() {
assert!(true)
}
141 changes: 141 additions & 0 deletions starknet/tests/test_l1_header_store.cairo
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
use fossil::L1_headers_store::interface::IL1HeadersStoreDispatcherTrait;
use super::test_utils::setup;

#[test]
fn receive_from_l1_success_test() {
assert!(true)
}

#[test]
#[should_panic]
fn receive_from_l1_fail_wrong_caller_test() {
assert!(false)
}

#[test]
fn process_block_success_uncle_hash_test() {
assert!(true)
}

#[test]
fn process_block_success_beneficiary_test() {
assert!(true)
}

#[test]
fn process_block_success_state_root_test() {
assert!(true)
}

#[test]
fn process_block_success_transactions_root_test() {
assert!(true)
}

#[test]
fn process_block_success_receipts_root_test() {
assert!(true)
}

#[test]
fn process_block_success_difficulty_test() {
assert!(true)
}

#[test]
fn process_block_gas_used_test() {
assert!(true)
}

#[test]
fn process_block_success_timestamp_test() {
assert!(true)
}

#[test]
fn process_block_success_base_fee_test() {
assert!(true)
}

#[test]
#[should_panic]
fn process_block_cannot_validate_header_rlp_test() {
assert!(false)
}

#[test]
fn process_till_block_success_test() {
assert!(true)
}

#[test]
#[should_panic]
fn process_till_block_fail_wrong_block_headers_length_test() {
assert!(false)
}

#[test]
#[should_panic]
fn process_till_block_fail_wrong_block_headers_test() {
assert!(false)
}

#[test]
fn get_initialized_test() {
assert!(true)
}

#[test]
fn get_parent_hash_test() {
assert!(true)
}

#[test]
fn get_latest_l1_block_hash() {
assert!(true)
}

#[test]
fn get_state_root_test() {
assert!(true)
}

#[test]
fn get_transactions_root_test() {
assert!(true)
}

#[test]
fn get_receipts_root_test() {
assert!(true)
}

#[test]
fn get_uncles_hash_test() {
assert!(true)
}

#[test]
fn get_beneficiary_test() {
assert!(true)
}

#[test]
fn get_difficulty_test() {
assert!(true)
}

#[test]
fn get_base_fee_test() {
assert!(true)
}

#[test]
fn get_timestamp_test() {
assert!(true)
}

#[test]
fn get_gas_used_test() {
assert!(true)
}
22 changes: 22 additions & 0 deletions starknet/tests/test_l1_messages_proxy.cairo
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
use fossil::L1_messages_proxy::interface::IL1MessagesProxyDispatcherTrait;
use super::test_utils::setup;

#[test]
fn change_contract_addresses_test_success() {
assert!(true)
}

#[test]
fn get_initialized_test() {
assert!(true)
}

#[test]
fn get_l1_message_sender_test() {
assert!(true)
}

#[test]
fn get_l1_headers_store_address_test() {
assert!(true)
}

0 comments on commit 889fd74

Please sign in to comment.