Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: scarb & foundry update #155

Merged
merged 5 commits into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading