Skip to content

Commit

Permalink
add back in fossil processor validation
Browse files Browse the repository at this point in the history
  • Loading branch information
0xDegenDeveloper committed Nov 4, 2024
1 parent afd2d89 commit e2c670f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
9 changes: 5 additions & 4 deletions src/fossil_client/contract.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,15 @@ mod FossilClient {
// (timestamp & program id)/outputs (l1 data)/proof

// @note Skipping for now for testnet testing
// assert(
// get_caller_address() == self.fossil_processor.read(),
// Errors::CallerNotFossilProcessor
// );
assert(
get_caller_address() == self.fossil_processor.read(),
Errors::CallerNotFossilProcessor
);

// Relay L1 data to the vault
IVaultDispatcher { contract_address: vault_address }
.fossil_client_callback(l1_data, timestamp);

// Emit callback success event
self
.emit(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ fn get_request_serialized(ref vault: VaultFacade) -> Span<felt252> {
// @note Un-ignore this after Fossil processor is setup
#[test]
#[available_gas(50000000)]
#[ignore]
fn test_only_fossil_processor_can_call_fossil_callback() {
let (mut vault, _) = setup_facade();
let fossil_client = vault.get_fossil_client_facade();
Expand Down
2 changes: 2 additions & 0 deletions src/tests/utils/facades/fossil_client_facade.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use crate::fossil_client::interface::{
IFossilClientSafeDispatcherTrait
};
use crate::tests::utils::helpers::setup::FOSSIL_PROCESSOR;
use starknet::testing::set_contract_address;
// add this and tests

// test only fossil processor can call the client (fossil_callback)
Expand All @@ -27,6 +28,7 @@ impl FossilClientFacadeImpl of FossilClientFacadeTrait {

/// Entrypoints
fn fossil_callback(self: FossilClientFacade, request: Span<felt252>, result: Span<felt252>) {
set_contract_address(FOSSIL_PROCESSOR());
self.dispatcher().fossil_callback(request, result);
}

Expand Down

0 comments on commit e2c670f

Please sign in to comment.