Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
fmkra committed Oct 24, 2024
1 parent e341830 commit 19c7e80
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/contracts.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ mod proxy;
#[cfg(feature: 'feature_change_my_name')]
mod verifier;
#[cfg(feature: 'feature_change_my_name')]
mod fact_registry;
mod fact_registry;
8 changes: 4 additions & 4 deletions src/contracts/fact_registry.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ use cairo_verifier::{
StarkProofWithSerde,
fri::fri::{FriLayerWitness, FriVerificationStateConstant, FriVerificationStateVariable},
contracts::{
fact_registry_interface::{VerificationListElement, Verification},
verifier::InitResult,
fact_registry_interface::{VerificationListElement, Verification}, verifier::InitResult,
},
settings::{
VerifierSettings, VerificationHash, HasherBitLength, StoneVersion, CairoVersion,
Expand All @@ -13,7 +12,6 @@ use cairo_verifier::{
use starknet::ContractAddress;



#[derive(Drop, Copy, Serde, starknet::Event)]
struct FactRegistered {
#[key]
Expand Down Expand Up @@ -77,7 +75,9 @@ mod FactRegistry {
VerificationHash, PresetHash, SecurityBits,
},
contracts::{
fact_registry::{VerificationListElement, Verification, IFactRegistryExternal, FactRegistered},
fact_registry::{
VerificationListElement, Verification, IFactRegistryExternal, FactRegistered
},
fact_registry_interface::IFactRegistry,
}
};
Expand Down
6 changes: 2 additions & 4 deletions src/contracts/fact_registry_interface.cairo
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
use cairo_verifier::{
settings::{
FactHash, VerifierPreset, VerificationHash, SecurityBits, VerifierConfiguration,
},
settings::{FactHash, VerifierPreset, VerificationHash, SecurityBits, VerifierConfiguration,},
};
use starknet::ContractAddress;

Expand Down Expand Up @@ -30,4 +28,4 @@ trait IFactRegistry<TContractState> {
) -> Option<Verification>;

fn get_verifier_address(self: @TContractState, preset: VerifierPreset) -> ContractAddress;
}
}
12 changes: 7 additions & 5 deletions src/contracts/proxy.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,7 @@ mod Proxy {
VerifierConfiguration, FactRegistered, VerificationListElement, Verification,
VerifierPreset
},
fact_registry_interface::{
IFactRegistryDispatcher, IFactRegistryDispatcherTrait,
}
fact_registry_interface::{IFactRegistryDispatcher, IFactRegistryDispatcherTrait,}
},
StarkProofWithSerde, StarkProof, CairoVersion,
fri::fri::{FriLayerWitness, FriVerificationStateConstant, FriVerificationStateVariable},
Expand Down Expand Up @@ -112,7 +110,9 @@ mod Proxy {
verifier_config: VerifierConfiguration,
stark_proof: StarkProofWithSerde,
) -> FactRegistered {
let fact = IFactRegistryExternalDispatcher { contract_address: self.fact_registry.read() }
let fact = IFactRegistryExternalDispatcher {
contract_address: self.fact_registry.read()
}
.verify_proof_full_and_register_fact(verifier_config, stark_proof);

self.emit(fact);
Expand Down Expand Up @@ -147,7 +147,9 @@ mod Proxy {
state_variable: FriVerificationStateVariable,
last_layer_coefficients: Span<felt252>,
) -> FactRegistered {
let fact = IFactRegistryExternalDispatcher { contract_address: self.fact_registry.read() }
let fact = IFactRegistryExternalDispatcher {
contract_address: self.fact_registry.read()
}
.verify_proof_final_and_register_fact(
job_id, state_constant, state_variable, last_layer_coefficients
);
Expand Down
9 changes: 7 additions & 2 deletions src/lib.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,13 @@ use starknet::contract_address::ContractAddressZero;

// re-export
use cairo_verifier::{
contracts::fact_registry_interface::{IFactRegistry, IFactRegistryDispatcher, IFactRegistryDispatcherTrait},
settings::{FactHash, VerificationHash, PresetHash, SecurityBits, JobId, CairoVersion, HasherBitLength, StoneVersion, VerifierSettings, VerifierPreset, VerifierConfiguration, split_settings},
contracts::fact_registry_interface::{
IFactRegistry, IFactRegistryDispatcher, IFactRegistryDispatcherTrait
},
settings::{
FactHash, VerificationHash, PresetHash, SecurityBits, JobId, CairoVersion, HasherBitLength,
StoneVersion, VerifierSettings, VerifierPreset, VerifierConfiguration, split_settings
},
};

#[cfg(feature: 'dex')]
Expand Down

0 comments on commit 19c7e80

Please sign in to comment.