Skip to content

Commit

Permalink
fix: cannot publish packages to crates.io (#334)
Browse files Browse the repository at this point in the history
Resolves #291
  • Loading branch information
bidzyyys authored Oct 16, 2024
1 parent 3b560b3 commit 7e770ee
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 15 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/check-links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Link Checker
uses: lycheeverse/lychee-action@v1
with:
args: --no-progress './**/*.md'
fail: true

- name: Run linkspector
uses: umbrelladocs/action-linkspector@v1
with:
fail_on_error: true


7 changes: 3 additions & 4 deletions .github/workflows/check-publish.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: check-publish
# This workflow checks that the libraries can be published on crates.io.
# This workflow checks if the libraries can be published on crates.io.
permissions:
contents: read
on:
Expand Down Expand Up @@ -40,6 +40,5 @@ jobs:
- name: check openzeppelin-stylus-proc
run: cargo publish -p openzeppelin-stylus-proc --target wasm32-unknown-unknown --dry-run

# TODO: https://github.com/OpenZeppelin/rust-contracts-stylus/issues/291
# - name: check openzeppelin-stylus
# run: cargo publish -p openzeppelin-stylus --target wasm32-unknown-unknown --dry-run
- name: check openzeppelin-stylus
run: cargo publish -p openzeppelin-stylus --target wasm32-unknown-unknown --dry-run
5 changes: 4 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 7 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ stylus-sdk = { version = "=0.6.0", default-features = false }
stylus-proc = { version = "=0.6.0", default-features = false }
mini-alloc = "0.4.2"

alloy = { version = "0.1.4", features = [
alloy = { version = "=0.1.4", features = [
"contract",
"network",
"providers",
Expand All @@ -80,8 +80,11 @@ alloy = { version = "0.1.4", features = [
# Even though `alloy` includes `alloy-primitives` and `alloy-sol-types` we need
# to keep both versions for compatibility with the Stylus SDK. Once they start
# using `alloy` we can remove these.
alloy-primitives = { version = "0.7.6", default-features = false }
alloy-sol-types = { version = "0.7.6", default-features = false }
alloy-primitives = { version = "=0.7.6", default-features = false }
alloy-sol-types = { version = "=0.7.6", default-features = false }
alloy-sol-macro = { version = "=0.7.6", default-features = false }
alloy-sol-macro-expander = { version = "=0.7.6", default-features = false }
alloy-sol-macro-input = { version = "=0.7.6", default-features = false }

const-hex = { version = "1.11.1", default-features = false }
eyre = "0.6.8"
Expand All @@ -100,7 +103,7 @@ quote = "1.0.35"

# members
openzeppelin-stylus = { path = "contracts" }
openzeppelin-stylus-proc = { path = "contracts-proc" }
openzeppelin-stylus-proc = { path = "contracts-proc", version = "0.1.0-rc" }
openzeppelin-crypto = { path = "lib/crypto" }
motsu = { path = "lib/motsu"}
motsu-proc = { path = "lib/motsu-proc", version = "0.1.0" }
Expand Down
2 changes: 1 addition & 1 deletion contracts-proc/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[package]
name = "openzeppelin-stylus-proc"
description = "Procedural macros for OpenZeppelin Stylus contracts"
version.workspace = true
authors.workspace = true
edition.workspace = true
license.workspace = true
keywords.workspace = true
repository.workspace = true
version = "0.1.0"


[dependencies]
Expand Down
3 changes: 3 additions & 0 deletions contracts/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ version.workspace = true
[dependencies]
alloy-primitives.workspace = true
alloy-sol-types.workspace = true
alloy-sol-macro.workspace = true
alloy-sol-macro-expander.workspace = true
alloy-sol-macro-input.workspace = true
stylus-sdk.workspace = true
stylus-proc.workspace = true
mini-alloc.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/ROOT/pages/crypto.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ pub fn verify(&self, proof: Vec<B256>, root: B256, leaf: B256) -> bool {
}
----

Note that these functions use `keccak256` as the hashing algorithm, but our library also provides generic counterparts: https://docs.rs/openzeppelin-crypto/0.1.0-rc/openzeppelin_crypto/merkle/struct.Verifier.html#method.verify_with_builder[`verify_with_builer`] and https://docs.rs/openzeppelin-crypto/0.1.0-rc/openzeppelin_crypto/merkle/struct.Verifier.html#method.verify_multi_proof_with_builder[`verify_multi_proof_with_builder`].
Note that these functions use `keccak256` as the hashing algorithm, but our library also provides generic counterparts: https://docs.rs/openzeppelin-crypto/0.1.0-rc/openzeppelin_crypto/merkle/struct.Verifier.html#method.verify_with_builder[`verify_with_builder`] and https://docs.rs/openzeppelin-crypto/0.1.0-rc/openzeppelin_crypto/merkle/struct.Verifier.html#method.verify_multi_proof_with_builder[`verify_multi_proof_with_builder`].

We also provide an adapter https://docs.rs/openzeppelin-crypto/0.1.0-rc/openzeppelin_crypto/hash/index.html[`hash`] module to use your own hashers in conjunction with them that resembles Rust's standard library's API.

0 comments on commit 7e770ee

Please sign in to comment.