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

Replace eager_replace! with preinterpret! #2067

Merged
merged 4 commits into from
Feb 3, 2025
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
> Other incidental features or changes which shouldn't break existing integrations, but are worthy of mention to scrypto developers, dApp developers or other integrators.

* [#2053](https://github.com/radixdlt/radixdlt-scrypto/pull/2053) - Minor updates to improve the `name` and `description` of the native node module packages.
* [#2067](https://github.com/radixdlt/radixdlt-scrypto/pull/2067) - Removed the `eager!` macro and replaced it with the rewritten, open-source and more comprehensive `preinterpret!` macro which David is supporting in an open-source [preinterpret](https://github.com/dhedey/preinterpret) crate. Give it a try for replacing code-generation procedural macros.

# v1.3.x - [Cuttlefish](https://docs.radixdlt.com/docs/cuttlefish)

Expand Down
11 changes: 11 additions & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ ouroboros = { version = "0.17.2" }
paste = { version = "1.0.13" }
perfcnt = { version = "0.8.0" }
plotters = { version = "0.3.4" }
preinterpret = { version = "0.2.0" }
proc-macro2 = { version = "1.0.38" }
quote = { version = "1.0.18" }
radix-wasm-instrument = { version = "1.0.0", default-features = false, features = ["ignore_custom_section"]}
Expand Down
6 changes: 0 additions & 6 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ echo "Building scrypto packages and tests using cargo build, to catch errors qui
(set -x; cd radix-engine-tests/assets/blueprints; cargo build; cargo test --no-run)
(set -x; cd radix-clis/tests/blueprints; cargo build; cargo test --no-run)
(set -x; cd scrypto-test/tests/blueprints; cargo build; cargo test --no-run)
(set -x; cd scrypto-test/assets/blueprints; cargo build; cargo test --no-run)
(set -x; cd radix-transaction-scenarios/assets/blueprints; cargo build; cargo test --no-run)
(set -x; cd scrypto-compiler/tests/assets/scenario_1; cargo build; cargo test --no-run)
(set -x; cd scrypto-compiler/tests/assets/scenario_2; cargo build; cargo test --no-run)
Expand Down Expand Up @@ -47,11 +46,6 @@ echo "Building scrypto packages used in tests with scrypto build..."
| awk '{print substr($1, 1, length($1)-length("Cargo.toml"))}' \
| xargs -I '{}' bash -c "set -x; $scrypto build --path {}"
)
(
find "scrypto-test/assets/blueprints" -mindepth 2 -maxdepth 2 -type f \( -name Cargo.toml \) -print \
| awk '{print substr($1, 1, length($1)-length("Cargo.toml"))}' \
| xargs -I '{}' bash -c "set -x; $scrypto build --path {}"
)
(
find "radix-transaction-scenarios/assets/blueprints" -mindepth 2 -maxdepth 2 -type f \( -name Cargo.toml \) -print \
| awk '{print substr($1, 1, length($1)-length("Cargo.toml"))}' \
Expand Down
1 change: 0 additions & 1 deletion check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ packages="Cargo.toml$lf"
packages+="radix-engine-tests/assets/blueprints/Cargo.toml$lf"
packages+="radix-clis/tests/blueprints/Cargo.toml$lf"
packages+="scrypto-test/tests/blueprints/Cargo.toml$lf"
packages+="scrypto-test/assets/blueprints/Cargo.toml$lf"
packages+="scrypto-compiler/tests/assets/scenario_1/Cargo.toml$lf"
packages+="scrypto-compiler/tests/assets/scenario_2/Cargo.toml$lf"
packages+="$(find examples -mindepth 2 -maxdepth 2 -type f \( -name Cargo.toml \))$lf"
Expand Down
11 changes: 11 additions & 0 deletions examples/everything/Cargo.lock

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

11 changes: 11 additions & 0 deletions examples/hello-world/Cargo.lock

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

11 changes: 11 additions & 0 deletions examples/no-std/Cargo.lock

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

1 change: 0 additions & 1 deletion format-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ packages="Cargo.toml$lf"
packages+="radix-engine-tests/assets/blueprints/Cargo.toml$lf"
packages+="radix-clis/tests/blueprints/Cargo.toml$lf"
packages+="scrypto-test/tests/blueprints/Cargo.toml$lf"
packages+="scrypto-test/assets/blueprints/Cargo.toml$lf"
packages+="scrypto-compiler/tests/assets/scenario_1/Cargo.toml$lf"
packages+="scrypto-compiler/tests/assets/scenario_2/Cargo.toml$lf"
packages+="$(find examples -mindepth 2 -maxdepth 2 -type f \( -name Cargo.toml \))$lf"
Expand Down
1 change: 0 additions & 1 deletion format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ cd "$(dirname "$0")"
(set -x; cd radix-engine-tests/assets/blueprints; cargo fmt)
(set -x; cd radix-clis/tests/blueprints; cargo fmt)
(set -x; cd scrypto-test/tests/blueprints; cargo fmt)
(set -x; cd scrypto-test/assets/blueprints; cargo fmt)
(set -x; cd scrypto-compiler/tests/assets/scenario_1; cargo fmt)
(set -x; cd scrypto-compiler/tests/assets/scenario_2; cargo fmt)

Expand Down
11 changes: 11 additions & 0 deletions radix-clis/assets/template/Cargo.lock_template

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

11 changes: 11 additions & 0 deletions radix-clis/tests/blueprints/Cargo.lock

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

11 changes: 11 additions & 0 deletions radix-engine-tests/assets/blueprints/Cargo.lock

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

2 changes: 1 addition & 1 deletion radix-engine/src/system/system_db_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,7 @@ impl<'a, S: SubstateDatabase + ?Sized> SystemDatabaseReader<'a, S> {
payload: &[u8],
payload_schema: &'b ResolvedPayloadSchema,
depth_limit: usize,
) -> Result<(), LocatedValidationError<ScryptoCustomExtension>> {
) -> Result<(), LocatedValidationError<'b, ScryptoCustomExtension>> {
let validation_context: Box<dyn ValidationContext<Error = String>> =
Box::new(ValidationPayloadCheckerContext {
reader: self,
Expand Down
1 change: 1 addition & 0 deletions radix-rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ repository = "https://github.com/radixdlt/radixdlt-scrypto"
serde = { workspace = true, optional = true }
hashbrown = { workspace = true, optional = true }
indexmap = { workspace = true }
preinterpret = { workspace = true }

[features]
default = ["std"]
Expand Down
1 change: 1 addition & 0 deletions radix-rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,5 @@ pub mod prelude {
pub use crate::slice::*;

pub use crate::assert_matches;
pub use preinterpret::preinterpret;
}
Loading
Loading