Skip to content

Commit

Permalink
feat: cairo-test -> snforge + fork test upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
JordyRo1 committed Dec 7, 2024
1 parent d9627d6 commit 9511dc9
Show file tree
Hide file tree
Showing 5 changed files with 339 additions and 265 deletions.
13 changes: 3 additions & 10 deletions pragma-oracle/Scarb.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,13 @@ alexandria_sorting = { git = "https://github.com/keep-starknet-strange/alexandri
cubit = { git = "https://github.com/influenceth/cubit", rev = "2ccb2536dffa3f15ebd38b755c1be65fde1eab0c" }
openzeppelin = { git = "https://github.com/OpenZeppelin/cairo-contracts.git", tag = "v0.7.0" }
starknet = "2.2.0"
snforge_std = { git = "https://github.com/foundry-rs/starknet-foundry", tag = "v0.7.0" }


[[target.starknet-contract]]
# Enable Sierra codegen.
casm = true
sierra = true

# Enable CASM codegen.
casm = true

# Emit Python-powered hints in order to run compiled CASM class with legacy Cairo VM.
casm-add-pythonic-hints = true

allowed-libfuncs-list.name = "audited"

[scripts]
sierra = "cairo-compile . -r"
test-cairo = "cairo-test --starknet ."

6 changes: 3 additions & 3 deletions pragma-oracle/src/lib.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ mod pool {
mod tests {
mod test_oracle;
mod test_publisher_registry;
mod test_summary_stats;
mod test_yield_curve;
mod test_randomness;
// mod test_summary_stats;
// mod test_yield_curve;
// mod test_randomness;
}

8 changes: 5 additions & 3 deletions pragma-oracle/src/oracle/oracle.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -545,9 +545,11 @@ mod Oracle {
};

// Get base currency and pool
let base_asset: felt252 = self.get_pair(asset).base_currency_id;
assert(base_asset != 0, 'Asset not registered');
let pool_address: ContractAddress = self.tokenized_vault.read((base_asset, 'STRK'));
let quote_asset: felt252 = self.get_pair(asset).quote_currency_id;
assert(quote_asset != 0, 'Asset not registered');
let pool_address: ContractAddress = self
.tokenized_vault
.read((quote_asset, 'STRK'));
assert(
pool_address != starknet::contract_address_const::<0>(),
'No pool address for given token'
Expand Down
Loading

0 comments on commit 9511dc9

Please sign in to comment.