-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(compilation): do not compile devnet contract artifacts when doing…
… `cargo build` (#365)
- Loading branch information
Showing
34 changed files
with
187 additions
and
249 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,6 +33,6 @@ jobs: | |
- name: Run unit tests | ||
run: | | ||
cargo test | ||
cargo test --workspace | ||
env: | ||
PROPTEST_CASES: 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
target | ||
crates/client/sync/test-data/*.json | ||
cairo-artifacts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Cairo artifacts | ||
|
||
We commit these artifacts so that the compilation process is easier, as they require different cairo 0 / cairo 1 versions. | ||
|
||
The OZ contracts were compiled as to match the [`starkli`'s allowed class hash list](https://github.com/xJonathanLEI/starkli/blob/1bed33383d8f8cec926f7ce97c4a4243b8bbe43b/src/account.rs#L109): | ||
OpenZeppelin v0.13.0 compiled with cairo v2.6.3. | ||
|
||
```sh | ||
git clone https://github.com/OpenZeppelin/cairo-contracts | ||
cd cairo-contracts | ||
|
||
SCARB_VERSION=2.6.3 | ||
OZ_VERSION=0.13.0 | ||
|
||
git checkout v$OZ_VERSION | ||
asdf install scarb $SCARB_VERSION | ||
asdf shell scarb $SCARB_VERSION | ||
scarb build | ||
starkli class-hash target/dev/openzeppelin_AccountUpgradeable.contract_class.json | ||
``` | ||
|
||
should always return class hash `0x00e2eb8f5672af4e6a4e8a8f1b44989685e668489b0a25437733756c5a34a1d6`, and | ||
`target/dev/openzeppelin_AccountUpgradeable.contract_class.json` should match the file in this | ||
folder. | ||
|
||
`openzeppelin_ERC20Upgradeable.contract_class.json` is compiled using the same scarb and OZ versions. |
File renamed without changes.
1 change: 1 addition & 0 deletions
1
cairo-artifacts/openzeppelin_AccountUpgradeable.contract_class.json
Large diffs are not rendered by default.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
cairo-artifacts/openzeppelin_ERC20Upgradeable.contract_class.json
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
|
||
pub mod erc20; | ||
pub mod udc; | ||
pub mod account; | ||
pub mod test_account; | ||
pub mod hello; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[package] | ||
name = "m-cairo-test-contracts" | ||
authors.workspace = true | ||
homepage.workspace = true | ||
edition.workspace = true | ||
repository.workspace = true | ||
version.workspace = true | ||
license.workspace = true | ||
|
||
[lints] | ||
workspace = true | ||
|
||
[package.metadata.docs.rs] | ||
targets = ["x86_64-unknown-linux-gnu"] | ||
|
||
[dependencies] |
2 changes: 1 addition & 1 deletion
2
crates/client/devnet/build.rs → crates/cairo-test-contracts/build.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
//! This crate is used to build the cairo test contracts for tests. Contracts that are not used in | ||
//! tests need to be put in the `cairo-artifacts` folder at the root of the project`. | ||
|
||
pub const TEST_CONTRACT_SIERRA: &[u8] = | ||
include_bytes!("../../../cairo/target/dev/madara_contracts_TestContract.contract_class.json"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.