From b929d7dadc35e6cc52d27227b990d825717c7314 Mon Sep 17 00:00:00 2001 From: Afonso Barracha <113945054+afonsobarracha@users.noreply.github.com> Date: Fri, 29 Sep 2023 15:47:21 +1300 Subject: [PATCH] build(deps): remove wee_alloc (#158) * build(deps): remove wee_alloc * build(deps): bump @wasm-tool/wasm-pack-plugin from 1.6.0 to 1.7.0 * build(deps): bump wasm-bindgen dependencies * fix: remove redudant comment * ci: fix rust version at 1.72.x * build(deps): update nodejs dependencies * build(deps): bump web-sys from 0.3.39 to 0.3.64 * chore: run cargo fix --edition * build(version): bump wasm version from 0.1.0 to 0.1.1 * refactor: always install rust 1.72 --- Cargo.lock | 153 ++++++++++++++++---------------- Cargo.toml | 18 ++-- package.json | 4 +- scripts/install-dependencies.sh | 3 + src/lib.rs | 6 -- yarn.lock | 16 ++-- 6 files changed, 99 insertions(+), 101 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f8ddb45..8929733 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -36,7 +36,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d117600f438b1707d4e4ae15d3595657288f8235a0eb593e80ecc98ab34e1bc" dependencies = [ "addr2line", - "cfg-if 1.0.0", + "cfg-if", "libc", "miniz_oxide", "object", @@ -58,7 +58,7 @@ dependencies = [ "pairing-plus", "rand 0.7.3", "serde", - "serde-wasm-bindgen", + "serde-wasm-bindgen 0.1.3", "wasm-bindgen", "zeroize", ] @@ -114,12 +114,6 @@ version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae44d1a3d5a19df61dd0c8beb138458ac2a53a7ac09eba97d55592540004306b" -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -128,11 +122,11 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "console_error_panic_hook" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8d976903543e0c48546a91908f21588a680a8c8f984df9a5d69feccb2b2a211" +checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc" dependencies = [ - "cfg-if 0.1.10", + "cfg-if", "wasm-bindgen", ] @@ -173,7 +167,7 @@ checksum = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.72", "synstructure", ] @@ -206,7 +200,7 @@ dependencies = [ "num-traits", "proc-macro2", "quote", - "syn", + "syn 1.0.72", ] [[package]] @@ -236,7 +230,7 @@ version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "js-sys", "libc", "wasi", @@ -277,19 +271,13 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.45" +version = "0.3.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca059e81d9486668f12d455a4ea6daa600bd408134cd17e3d3fb5a32d1f016f8" +checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" dependencies = [ "wasm-bindgen", ] -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - [[package]] name = "libc" version = "0.2.86" @@ -302,15 +290,9 @@ version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - [[package]] name = "miniz_oxide" version = "0.4.3" @@ -357,6 +339,12 @@ version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a9a7ab5d64814df0fe4a4b5ead45ed6c5f181ee3ff04ba344313a6c80446c5d4" +[[package]] +name = "once_cell" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" + [[package]] name = "opaque-debug" version = "0.2.3" @@ -386,18 +374,18 @@ checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" [[package]] name = "proc-macro2" -version = "1.0.27" +version = "1.0.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0d8caf72986c1a598726adc988bb5984792ef84f5ee5aa50209145ee8077038" +checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" dependencies = [ - "unicode-xid", + "unicode-ident", ] [[package]] name = "quote" -version = "1.0.9" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -522,6 +510,17 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "serde-wasm-bindgen" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30c9933e5689bd420dc6c87b7a1835701810cbc10cd86a26e4da45b73e6b1d78" +dependencies = [ + "js-sys", + "serde", + "wasm-bindgen", +] + [[package]] name = "serde_derive" version = "1.0.123" @@ -530,7 +529,7 @@ checksum = "9391c295d64fc0abb2c556bad848f33cb8296276b1ad2677d1ae1ace4f258f31" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.72", ] [[package]] @@ -562,6 +561,17 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "syn" +version = "2.0.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7303ef2c05cd654186cb250d29049a24840ca25d2747c25c0381c8d9e2f582e8" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "synstructure" version = "0.12.4" @@ -570,7 +580,7 @@ checksum = "b834f2d66f734cb897113e34aaff2f1ab4719ca946f9a7358dba8f8064148701" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.72", "unicode-xid", ] @@ -580,6 +590,12 @@ version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "373c8a200f9e67a0c95e62a4f52fbf80c23b4381c05a17845531982fa99e6b33" +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + [[package]] name = "unicode-xid" version = "0.2.1" @@ -594,7 +610,7 @@ checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" [[package]] name = "wasm" -version = "0.1.0" +version = "0.1.1" dependencies = [ "arrayref", "bbs", @@ -604,47 +620,46 @@ dependencies = [ "pairing-plus", "rand 0.7.3", "serde", - "serde-wasm-bindgen", + "serde-wasm-bindgen 0.6.0", "sha2", "wasm-bindgen", "wasm-bindgen-futures", "wasm-bindgen-test", "web-sys", - "wee_alloc", ] [[package]] name = "wasm-bindgen" -version = "0.2.74" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54ee1d4ed486f78874278e63e4069fc1ab9f6a18ca492076ffb90c5eb2997fd" +checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.74" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b33f6a0694ccfea53d94db8b2ed1c3a8a4c86dd936b13b9f0a15ec4a451b900" +checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" dependencies = [ "bumpalo", - "lazy_static", "log", + "once_cell", "proc-macro2", "quote", - "syn", + "syn 2.0.37", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.18" +version = "0.4.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7866cab0aa01de1edf8b5d7936938a7e397ee50ce24119aef3e1eaa3b6171da" +checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" dependencies = [ - "cfg-if 0.1.10", + "cfg-if", "js-sys", "wasm-bindgen", "web-sys", @@ -652,9 +667,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.74" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "088169ca61430fe1e58b8096c24975251700e7b1f6fd91cc9d59b04fb9b18bd4" +checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -662,28 +677,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.74" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be2241542ff3d9f241f5e2cb6dd09b37efe786df8851c54957683a49f0987a97" +checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.37", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.74" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7cff876b8f18eed75a66cf49b65e7f967cb354a7aa16003fb55dbfd25b44b4f" +checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" [[package]] name = "wasm-bindgen-test" -version = "0.3.13" +version = "0.3.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f0dfda4d3b3f8acbc3c291b09208081c203af457fb14a229783b06e2f128aa7" +checksum = "6e6e302a7ea94f83a6d09e78e7dc7d9ca7b186bc2829c24a22d0753efd680671" dependencies = [ "console_error_panic_hook", "js-sys", @@ -695,9 +710,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-test-macro" -version = "0.3.13" +version = "0.3.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c2e18093f11c19ca4e188c177fecc7c372304c311189f12c2f9bea5b7324ac7" +checksum = "ecb993dd8c836930ed130e020e77d9b2e65dd0fbab1b67c790b0f5d80b11a575" dependencies = [ "proc-macro2", "quote", @@ -705,26 +720,14 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.45" +version = "0.3.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bf6ef87ad7ae8008e15a355ce696bed26012b7caa21605188cfd8214ab51e2d" +checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" dependencies = [ "js-sys", "wasm-bindgen", ] -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "memory_units", - "winapi", -] - [[package]] name = "winapi" version = "0.3.9" @@ -764,6 +767,6 @@ checksum = "3f8f187641dad4f680d25c4bfc4225b418165984179f26ca76ec4fb6441d3a17" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.72", "synstructure", ] diff --git a/Cargo.toml b/Cargo.toml index 5a2060e..c0e5d83 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,37 +1,35 @@ [package] authors = ["Tobias Looker ", "Mike Lodder "] description = "WASM binding to bbs rust crate" -edition = "2018" +edition = "2021" license = "Apache-2.0" name = "wasm" repository = "https://github.com/mattrglobal/bbs-signatures" -version = "0.1.0" +version = "0.1.1" [lib] crate-type = ["cdylib", "rlib"] [features] console = ["console_error_panic_hook"] -default = ["wee_alloc"] [dependencies] arrayref = "0.3" bbs = { version = "0.4.1", default-features = false, features = ["wasm"] } -console_error_panic_hook = { version = "0.1.1", optional = true } +console_error_panic_hook = { version = "0.1.7", optional = true } hkdf = "0.8" js-sys = "0.3" rand = { version = "0.7", features = ["wasm-bindgen"] } pairing-plus = "0.19" serde = { version = "1.0", features = ["derive"] } -serde-wasm-bindgen = "0.1.3" +serde-wasm-bindgen = "0.6.0" sha2 = "0.8" -wasm-bindgen = "= 0.2.74" -wasm-bindgen-futures = "0.4.18" -web-sys = { version = "0.3.39", features = ['console'] } -wee_alloc = { version = "0.4.2", optional = true } +wasm-bindgen = "= 0.2.87" +wasm-bindgen-futures = "0.4.37" +web-sys = { version = "0.3.64", features = ['console'] } [dev-dependencies] -wasm-bindgen-test = "0.3.13" +wasm-bindgen-test = "0.3.37" [profile.release] lto = true diff --git a/package.json b/package.json index eee46be..1dacb36 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "@stablelib/benchmark": "1.0.0", "@types/jest": "28.1.1", "@types/node": "12.7.2", - "@wasm-tool/wasm-pack-plugin": "1.6.0", + "@wasm-tool/wasm-pack-plugin": "1.7.0", "buffer": "6.0.3", "conventional-changelog": "3.1.25", "conventional-changelog-cli": "2.2.2", @@ -66,7 +66,7 @@ "lodash": "4.17.21" }, "optionalDependencies": { - "@mattrglobal/node-bbs-signatures": "0.17.0" + "@mattrglobal/node-bbs-signatures": "0.18.1" }, "dependencies": { "@stablelib/random": "1.0.0" diff --git a/scripts/install-dependencies.sh b/scripts/install-dependencies.sh index 096d9ba..2eeffd4 100755 --- a/scripts/install-dependencies.sh +++ b/scripts/install-dependencies.sh @@ -2,6 +2,9 @@ set -e echo ">>>> Installing Dependencies" +echo ">>> Installing rust version 1.72" +rustup install 1.72 + if ! [ -x "$(command -v wasm-pack)" ]; then echo ">>> Installing wasm-pack" curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh diff --git a/src/lib.rs b/src/lib.rs index dbb8ede..0967813 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -11,12 +11,6 @@ * limitations under the License. */ -// When the `wee_alloc` feature is enabled, use `wee_alloc` as the global -// allocator. -#[cfg(feature = "wee_alloc")] -#[global_allocator] -static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT; - #[macro_use] extern crate arrayref; diff --git a/yarn.lock b/yarn.lock index 3b022c2..e73da95 100644 --- a/yarn.lock +++ b/yarn.lock @@ -769,10 +769,10 @@ semver "^7.3.5" tar "^6.1.11" -"@mattrglobal/node-bbs-signatures@0.17.0": - version "0.17.0" - resolved "https://registry.yarnpkg.com/@mattrglobal/node-bbs-signatures/-/node-bbs-signatures-0.17.0.tgz#50d18ae45cd9b6a3ea5f17812cf6fb6c20baaf17" - integrity sha512-midEd1qGYfAKjILyIdEgyY7tbVwIFR7ozWli8AaxBaiDie2oBaj6O1A2rh/GCOKTpBZ3Thbi+CE0QZntWf+Xzg== +"@mattrglobal/node-bbs-signatures@0.18.1": + version "0.18.1" + resolved "https://registry.yarnpkg.com/@mattrglobal/node-bbs-signatures/-/node-bbs-signatures-0.18.1.tgz#f313da682bdd9b592e7b65549cbbb8f67b0ce583" + integrity sha512-s9ccL/1TTvCP1N//4QR84j/d5D/stx/AI1kPcRgiE4O3KrxyF7ZdL9ca8fmFuN6yh9LAbn/OiGRnOXgvn38Dgg== dependencies: "@mapbox/node-pre-gyp" "1.0.11" neon-cli "0.10.1" @@ -980,10 +980,10 @@ dependencies: "@types/yargs-parser" "*" -"@wasm-tool/wasm-pack-plugin@1.6.0": - version "1.6.0" - resolved "https://registry.yarnpkg.com/@wasm-tool/wasm-pack-plugin/-/wasm-pack-plugin-1.6.0.tgz#a2dbec777b317b04f72e13f0080a3f483cd89809" - integrity sha512-Iax4nEgIvVCZqrmuseJm7ln/muWpg7uT5fXMAT0crYo+k5JTuZE58DJvBQoeIAegA3IM9cZgfkcZjAOUCPsT1g== +"@wasm-tool/wasm-pack-plugin@1.7.0": + version "1.7.0" + resolved "https://registry.yarnpkg.com/@wasm-tool/wasm-pack-plugin/-/wasm-pack-plugin-1.7.0.tgz#63a17357c0c8621a88513134852918cb9a480755" + integrity sha512-WikzYsw7nTd5CZxH75h7NxM/FLJAgqfWt+/gk3EL3wYKxiIlpMIYPja+sHQl3ARiicIYy4BDfxkbAVjRYlouTA== dependencies: chalk "^2.4.1" command-exists "^1.2.7"