Skip to content

Commit

Permalink
Merge pull request #155 from Jemiiah/main
Browse files Browse the repository at this point in the history
feat: scarb & foundry update
  • Loading branch information
Darlington02 authored Oct 3, 2024
2 parents 9bcde94 + c711ce3 commit 8ee4d82
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test_contract.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ jobs:
- uses: software-mansion/setup-scarb@v1
- uses: foundry-rs/setup-snfoundry@v3
with:
starknet-foundry-version: 0.25.0
starknet-foundry-version: 0.31.0
- name: Run cairo tests
run: cd contracts && snforge test
12 changes: 10 additions & 2 deletions contracts/Scarb.lock
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,15 @@ name = "openzeppelin_utils"
version = "0.15.0"
source = "git+https://github.com/OpenZeppelin/cairo-contracts.git?tag=v0.15.0#f57642960f1c8cffafefb88bfff418eca8510634"

[[package]]
name = "snforge_scarb_plugin"
version = "0.31.0"
source = "git+https://github.com/foundry-rs/starknet-foundry?tag=v0.31.0#72ea785ca354e9e506de3e5d687da9fb2c1b3c67"

[[package]]
name = "snforge_std"
version = "0.27.0"
source = "git+https://github.com/foundry-rs/starknet-foundry?tag=v0.27.0#2d99b7c00678ef0363881ee0273550c44a9263de"
version = "0.31.0"
source = "git+https://github.com/foundry-rs/starknet-foundry?tag=v0.31.0#72ea785ca354e9e506de3e5d687da9fb2c1b3c67"
dependencies = [
"snforge_scarb_plugin",
]
4 changes: 2 additions & 2 deletions contracts/Scarb.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ name = "contracts"
version = "0.1.0"

[dependencies]
starknet = "2.7.0"
snforge_std = { git = "https://github.com/foundry-rs/starknet-foundry", tag = "v0.27.0" }
starknet = "2.8.2"
snforge_std = { git = "https://github.com/foundry-rs/starknet-foundry", tag = "v0.31.0" }
openzeppelin = { git = "https://github.com/OpenZeppelin/cairo-contracts.git", tag = "v0.15.0" }

[[target.starknet-contract]]
Expand Down
4 changes: 2 additions & 2 deletions contracts/scripts/Scarb.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ edition = "2023_11"
# See more keys and their definitions at https://docs.swmansion.com/scarb/docs/reference/manifest.html

[dependencies]
sncast_std = { git = "https://github.com/foundry-rs/starknet-foundry", tag = "v0.27.0" }
starknet = "2.7.0"
sncast_std = { git = "https://github.com/foundry-rs/starknet-foundry", tag = "v0.31.0" }
starknet = "2.8.2"
contracts = { path = "../" }

[lib]
Expand Down
10 changes: 7 additions & 3 deletions contracts/tests/test_contract.cairo
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
use core::starknet::SyscallResultTrait;
use snforge_std::{declare, ContractClassTrait};
use snforge_std::{declare, ContractClassTrait, DeclareResultTrait, DeclareResult};
use contracts::{IHelloStarknetDispatcher, IHelloStarknetDispatcherTrait};

#[test]
fn test_balance() {
let contract = declare("HelloStarknet").unwrap();
let (contract_address, _) = contract.deploy(@ArrayTrait::new()).unwrap_syscall();
let contract = match declare("HelloStarknet").unwrap() {
DeclareResult::Success(class) => class,
DeclareResult::AlreadyDeclared(class) => class,
};

let (contract_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();

let dispatcher = IHelloStarknetDispatcher { contract_address };

Expand Down

0 comments on commit 8ee4d82

Please sign in to comment.