Skip to content

Commit

Permalink
Update the Scrypto dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
0xOmarA committed Jul 4, 2024
1 parent 37fc432 commit 325308c
Show file tree
Hide file tree
Showing 8 changed files with 239 additions and 103 deletions.
262 changes: 199 additions & 63 deletions Cargo.lock

Large diffs are not rendered by default.

56 changes: 28 additions & 28 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,22 @@ edition = "2021"
description = "The implementation of project Ignition in Scrypto for the Radix Ledger"

[workspace.dependencies]
sbor = { git = "https://github.com/radixdlt/radixdlt-scrypto", rev = "506293ad5c3ebde32cc2595053996153bc986a01" }
radix-rust = { git = "https://github.com/radixdlt/radixdlt-scrypto", rev = "506293ad5c3ebde32cc2595053996153bc986a01" }
scrypto = { git = "https://github.com/radixdlt/radixdlt-scrypto", rev = "506293ad5c3ebde32cc2595053996153bc986a01" }
scrypto-test = { git = "https://github.com/radixdlt/radixdlt-scrypto", rev = "506293ad5c3ebde32cc2595053996153bc986a01" }
radix-engine = { git = "https://github.com/radixdlt/radixdlt-scrypto", rev = "506293ad5c3ebde32cc2595053996153bc986a01" }
radix-common = { git = "https://github.com/radixdlt/radixdlt-scrypto", rev = "506293ad5c3ebde32cc2595053996153bc986a01" }
scrypto-compiler = { git = "https://github.com/radixdlt/radixdlt-scrypto", rev = "506293ad5c3ebde32cc2595053996153bc986a01" }
radix-native-sdk = { git = "https://github.com/radixdlt/radixdlt-scrypto", rev = "506293ad5c3ebde32cc2595053996153bc986a01" }
radix-transactions = { git = "https://github.com/radixdlt/radixdlt-scrypto", rev = "506293ad5c3ebde32cc2595053996153bc986a01" }
radix-engine-stores = { git = "https://github.com/radixdlt/radixdlt-scrypto", rev = "506293ad5c3ebde32cc2595053996153bc986a01" }
radix-common-derive = { git = "https://github.com/radixdlt/radixdlt-scrypto", rev = "506293ad5c3ebde32cc2595053996153bc986a01" }
radix-engine-interface = { git = "https://github.com/radixdlt/radixdlt-scrypto", rev = "506293ad5c3ebde32cc2595053996153bc986a01" }
radix-substate-store-impls = { git = "https://www.github.com/radixdlt/radixdlt-scrypto", rev = "506293ad5c3ebde32cc2595053996153bc986a01" }
radix-substate-store-interface = { git = "https://www.github.com/radixdlt/radixdlt-scrypto", rev = "506293ad5c3ebde32cc2595053996153bc986a01" }
radix-substate-store-queries = { git = "https://www.github.com/radixdlt/radixdlt-scrypto", rev = "506293ad5c3ebde32cc2595053996153bc986a01" }
radix-blueprint-schema-init = { git = "https://www.github.com/radixdlt/radixdlt-scrypto", rev = "506293ad5c3ebde32cc2595053996153bc986a01" }
sbor = { git = "https://github.com/radixdlt/radixdlt-scrypto", rev = "93ab38386333e7c9b3658e63392e6493692a9291" }
radix-rust = { git = "https://github.com/radixdlt/radixdlt-scrypto", rev = "93ab38386333e7c9b3658e63392e6493692a9291" }
scrypto = { git = "https://github.com/radixdlt/radixdlt-scrypto", rev = "93ab38386333e7c9b3658e63392e6493692a9291" }
scrypto-test = { git = "https://github.com/radixdlt/radixdlt-scrypto", rev = "93ab38386333e7c9b3658e63392e6493692a9291" }
radix-engine = { git = "https://github.com/radixdlt/radixdlt-scrypto", rev = "93ab38386333e7c9b3658e63392e6493692a9291" }
radix-common = { git = "https://github.com/radixdlt/radixdlt-scrypto", rev = "93ab38386333e7c9b3658e63392e6493692a9291" }
scrypto-compiler = { git = "https://github.com/radixdlt/radixdlt-scrypto", rev = "93ab38386333e7c9b3658e63392e6493692a9291" }
radix-native-sdk = { git = "https://github.com/radixdlt/radixdlt-scrypto", rev = "93ab38386333e7c9b3658e63392e6493692a9291" }
radix-transactions = { git = "https://github.com/radixdlt/radixdlt-scrypto", rev = "93ab38386333e7c9b3658e63392e6493692a9291" }
radix-engine-stores = { git = "https://github.com/radixdlt/radixdlt-scrypto", rev = "93ab38386333e7c9b3658e63392e6493692a9291" }
radix-common-derive = { git = "https://github.com/radixdlt/radixdlt-scrypto", rev = "93ab38386333e7c9b3658e63392e6493692a9291" }
radix-engine-interface = { git = "https://github.com/radixdlt/radixdlt-scrypto", rev = "93ab38386333e7c9b3658e63392e6493692a9291" }
radix-substate-store-impls = { git = "https://www.github.com/radixdlt/radixdlt-scrypto", rev = "93ab38386333e7c9b3658e63392e6493692a9291" }
radix-substate-store-interface = { git = "https://www.github.com/radixdlt/radixdlt-scrypto", rev = "93ab38386333e7c9b3658e63392e6493692a9291" }
radix-substate-store-queries = { git = "https://www.github.com/radixdlt/radixdlt-scrypto", rev = "93ab38386333e7c9b3658e63392e6493692a9291" }
radix-blueprint-schema-init = { git = "https://www.github.com/radixdlt/radixdlt-scrypto", rev = "93ab38386333e7c9b3658e63392e6493692a9291" }

state-manager = { git = "https://github.com/radixdlt/babylon-node", rev = "8fb0a8b886a7ab37bd4947a90be2a7e3511cd877" }

Expand All @@ -64,18 +64,18 @@ strip = true
overflow-checks = true

[patch.'https://github.com/radixdlt/radixdlt-scrypto']
sbor = { git = "https://www.github.com/radixdlt/radixdlt-scrypto.git", rev = "506293ad5c3ebde32cc2595053996153bc986a01" }
radix-transactions = { git = "https://www.github.com/radixdlt/radixdlt-scrypto.git", rev = "506293ad5c3ebde32cc2595053996153bc986a01" }
radix-transaction-scenarios = { git = "https://www.github.com/radixdlt/radixdlt-scrypto.git", rev = "506293ad5c3ebde32cc2595053996153bc986a01" }
radix-common = { git = "https://www.github.com/radixdlt/radixdlt-scrypto.git", rev = "506293ad5c3ebde32cc2595053996153bc986a01" }
radix-engine-interface = { git = "https://www.github.com/radixdlt/radixdlt-scrypto.git", rev = "506293ad5c3ebde32cc2595053996153bc986a01" }
radix-engine = { git = "https://www.github.com/radixdlt/radixdlt-scrypto.git", rev = "506293ad5c3ebde32cc2595053996153bc986a01" }
radix-substate-store-impls = { git = "https://www.github.com/radixdlt/radixdlt-scrypto.git", rev = "506293ad5c3ebde32cc2595053996153bc986a01" }
radix-substate-store-interface = { git = "https://www.github.com/radixdlt/radixdlt-scrypto.git", rev = "506293ad5c3ebde32cc2595053996153bc986a01" }
radix-substate-store-queries = { git = "https://www.github.com/radixdlt/radixdlt-scrypto.git", rev = "506293ad5c3ebde32cc2595053996153bc986a01" }
radix-rust = { git = "https://www.github.com/radixdlt/radixdlt-scrypto.git", rev = "506293ad5c3ebde32cc2595053996153bc986a01" }
scrypto-test = { git = "https://www.github.com/radixdlt/radixdlt-scrypto.git", rev = "506293ad5c3ebde32cc2595053996153bc986a01" }
radix-blueprint-schema-init = { git = "https://www.github.com/radixdlt/radixdlt-scrypto.git", rev = "506293ad5c3ebde32cc2595053996153bc986a01" }
sbor = { git = "https://www.github.com/radixdlt/radixdlt-scrypto.git", rev = "93ab38386333e7c9b3658e63392e6493692a9291" }
radix-transactions = { git = "https://www.github.com/radixdlt/radixdlt-scrypto.git", rev = "93ab38386333e7c9b3658e63392e6493692a9291" }
radix-transaction-scenarios = { git = "https://www.github.com/radixdlt/radixdlt-scrypto.git", rev = "93ab38386333e7c9b3658e63392e6493692a9291" }
radix-common = { git = "https://www.github.com/radixdlt/radixdlt-scrypto.git", rev = "93ab38386333e7c9b3658e63392e6493692a9291" }
radix-engine-interface = { git = "https://www.github.com/radixdlt/radixdlt-scrypto.git", rev = "93ab38386333e7c9b3658e63392e6493692a9291" }
radix-engine = { git = "https://www.github.com/radixdlt/radixdlt-scrypto.git", rev = "93ab38386333e7c9b3658e63392e6493692a9291" }
radix-substate-store-impls = { git = "https://www.github.com/radixdlt/radixdlt-scrypto.git", rev = "93ab38386333e7c9b3658e63392e6493692a9291" }
radix-substate-store-interface = { git = "https://www.github.com/radixdlt/radixdlt-scrypto.git", rev = "93ab38386333e7c9b3658e63392e6493692a9291" }
radix-substate-store-queries = { git = "https://www.github.com/radixdlt/radixdlt-scrypto.git", rev = "93ab38386333e7c9b3658e63392e6493692a9291" }
radix-rust = { git = "https://www.github.com/radixdlt/radixdlt-scrypto.git", rev = "93ab38386333e7c9b3658e63392e6493692a9291" }
scrypto-test = { git = "https://www.github.com/radixdlt/radixdlt-scrypto.git", rev = "93ab38386333e7c9b3658e63392e6493692a9291" }
radix-blueprint-schema-init = { git = "https://www.github.com/radixdlt/radixdlt-scrypto.git", rev = "93ab38386333e7c9b3658e63392e6493692a9291" }

[workspace.lints.clippy]
arithmetic_side_effects = "warn"
6 changes: 3 additions & 3 deletions libraries/common/src/indexed_buckets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ impl IndexedBuckets {
api: &mut Y,
) -> Result<Self, E>
where
Y: ClientApi<E>,
Y: SystemApi<E>,
E: Debug + ScryptoCategorize + ScryptoDecode,
{
let mut this = Self::new();
Expand All @@ -69,7 +69,7 @@ impl IndexedBuckets {
api: &mut Y,
) -> Result<Self, E>
where
Y: ClientApi<E>,
Y: SystemApi<E>,
E: Debug + ScryptoCategorize + ScryptoDecode,
{
let mut this = Self::new();
Expand All @@ -84,7 +84,7 @@ impl IndexedBuckets {
api: &mut Y,
) -> Result<(), E>
where
Y: ClientApi<E>,
Y: SystemApi<E>,
E: Debug + ScryptoCategorize + ScryptoDecode,
{
let bucket = bucket.into();
Expand Down
2 changes: 1 addition & 1 deletion libraries/scrypto-interface/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ mod client {

In a similar fashion to Scrypto stubs, this macro generated stubs to be used for the Scrypto Test framework. These stubs are meant to provide a typed abstraction over the blueprint removing the need to perform manual encoding and decoding and adding compile-time enforced type checks on interactions with the blueprint or components of the blueprint. The generated struct has the name `$struct_name` with a postfix of `InterfaceScryptoTestStub`.

The generated methods and functions have the same name as defined in the macro invocation. All functions have an additional argument named `blueprint_package_address` which is the `PackageAddress` of the package that the blueprint belongs to, and all functions and methods end with an argument called `env` which is a generic argument of any type that has a `::radix_engine_interface::prelude::ClientApi<E>` implementation. This is practically going to be the scrypto test environment. The return types are changed as well such that the functions return a `Result<T, RuntimeError>` instead of `T` where `T` is their original return type.
The generated methods and functions have the same name as defined in the macro invocation. All functions have an additional argument named `blueprint_package_address` which is the `PackageAddress` of the package that the blueprint belongs to, and all functions and methods end with an argument called `env` which is a generic argument of any type that has a `::radix_engine_interface::prelude::SystemApi<E>` implementation. This is practically going to be the scrypto test environment. The return types are changed as well such that the functions return a `Result<T, RuntimeError>` instead of `T` where `T` is their original return type.

The stubs generated by this macro can be useful in cases when tests involve blueprints external to the current project with no source code provided and just a WASM and an RPD. Thus, no scrypto-test stubs are provided with them from the `blueprint` macro.

Expand Down
2 changes: 1 addition & 1 deletion libraries/scrypto-interface/src/handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ fn generate_scrypto_test_stub(
#[allow(clippy::too_many_arguments)]
pub #token_fn #ident <Y, E> ( #arguments ) -> Result<#rtn, E>
where
Y: ::radix_engine_interface::prelude::ClientApi<E>,
Y: ::radix_engine_interface::prelude::SystemApi<E>,
E: ::core::fmt::Debug
{
#inner
Expand Down
2 changes: 1 addition & 1 deletion libraries/scrypto-interface/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ use proc_macro::TokenStream;
/// `blueprint_package_address` which is the `PackageAddress` of the package
/// that the blueprint belongs to, and all functions and methods end with an
/// argument called `env` which is a generic argument of any type that has a
/// `::radix_engine_interface::prelude::ClientApi<E>` implementation. This is
/// `::radix_engine_interface::prelude::SystemApi<E>` implementation. This is
/// practically going to be the scrypto test environment. The return types are
/// changed as well such that the functions return a `Result<T, RuntimeError>`
/// instead of `T` where `T` is their original return type.
Expand Down
8 changes: 4 additions & 4 deletions packages/defiplaza-v2-adapter-v1/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -437,8 +437,8 @@ pub mod adapter {
let mut pool = Global::<TwoResourcePool>::from(
pool_component_address,
);
let (bucket1, bucket2) =
pool.redeem(pool_units_bucket);
let (bucket1, bucket2) = pool
.redeem(pool_units_bucket.as_fungible());
IndexedBuckets::from_buckets([bucket1, bucket2])
},
);
Expand Down Expand Up @@ -543,8 +543,8 @@ pub mod adapter {
let mut pool = Global::<TwoResourcePool>::from(
pool_component_address,
);
let (bucket1, bucket2) =
pool.redeem(pool_units_bucket);
let (bucket1, bucket2) = pool
.redeem(pool_units_bucket.as_fungible());
IndexedBuckets::from_buckets([bucket1, bucket2])
},
);
Expand Down
4 changes: 2 additions & 2 deletions testing/tests/src/environment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ impl ScryptoTestEnv {

let registry =
OciswapV2RegistryInterfaceScryptoTestStub::instantiate(
GLOBAL_CALLER_VIRTUAL_BADGE,
GLOBAL_CALLER_RESOURCE,
dec!(0.03),
10080,
20,
Expand Down Expand Up @@ -1058,7 +1058,7 @@ impl ScryptoUnitEnv {
.lock_fee_from_faucet()
.ociswap_v2_registry_instantiate(
ociswap_v2_registry_package,
GLOBAL_CALLER_VIRTUAL_BADGE,
GLOBAL_CALLER_RESOURCE,
dec!(0.03),
10080,
20,
Expand Down

0 comments on commit 325308c

Please sign in to comment.