Skip to content

Commit

Permalink
chore(frame): remove dependency on lazy-static (#4109)
Browse files Browse the repository at this point in the history
Replace the usage of lazy-static dependency by simply allocating the
object in each benchmark rather than using a static object.  There’s
really no reason to mess around and create a static object.

Furthermore, replace hex-parsing done at runtime with the use of
hex_literal.  For consistency, do that throughout the file.
  • Loading branch information
mina86 authored Sep 1, 2023
1 parent 6fbb524 commit 21b2e44
Show file tree
Hide file tree
Showing 6 changed files with 140 additions and 209 deletions.
3 changes: 1 addition & 2 deletions code/Cargo.lock

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

8 changes: 1 addition & 7 deletions code/parachain/frame/cosmwasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,13 @@ frame-benchmarking = { default-features = false, workspace = true, optional = tr
frame-support = { default-features = false, workspace = true }
frame-system = { default-features = false, workspace = true }
hex = { version = "0.4", default-features = false, features = ["alloc"] }
hex-literal = "0.3.4"
vec1 = { version = "*", default-features = false, features = ["smallvec-v1"] }

ibc = { workspace = true, default-features = false }
ibc-primitives = { workspace = true, default-features = false, optional = false }
pallet-ibc = { workspace = true, default-features = false }

lazy_static = { version = "1.4.0", optional = true, default-features = false, features = [
"spin_no_std",
] }
libsecp256k1 = { version = "0.7.0", default-features = false }

log = { version = "0.4.14", default-features = false }
Expand Down Expand Up @@ -81,9 +79,6 @@ composable-traits = { path = "../composable-traits", default-features = false }
[dev-dependencies]
composable-tests-helpers = { path = "../composable-tests-helpers", default-features = false }
common = { path = "../../runtime/common", default-features = false }
lazy_static = { version = "1.4.0", default-features = false, features = [
"spin_no_std",
] }
num-traits = { version = "0.2.14", default-features = false }
orml-tokens = { workspace = true }
orml-traits = { workspace = true }
Expand All @@ -98,7 +93,6 @@ rand = { version = "0.8.5", default-features = false, features = [
default = ["std"]

runtime-benchmarks = [
"lazy_static",
"rand",
"frame-benchmarking",
"frame-support/runtime-benchmarks",
Expand Down
Loading

0 comments on commit 21b2e44

Please sign in to comment.