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

Update toolchain #131

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
- name: Install Rust Toolchain
uses: RDXWorks-actions/toolchain@master
with:
toolchain: nightly-2024-02-01
toolchain: nightly-2024-12-14
default: true
profile: minimal
# - name: Run sccache-cache
Expand Down Expand Up @@ -113,7 +113,7 @@ jobs:
- name: Install Rust Toolchain
uses: RDXWorks-actions/toolchain@master
with:
toolchain: nightly-2024-02-01
toolchain: nightly-2024-12-14
default: true
profile: minimal
target: ${{ matrix.build-target.target-triple }}
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/release-kotlin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,19 @@ jobs:
uses: RDXWorks-actions/checkout@main
- name: Install Rust Target
run: |
# Install nightly-2024-02-01
rustup toolchain install nightly-2024-02-01
# Install nightly-2024-12-14
rustup toolchain install nightly-2024-12-14

# Update both toolchains
rustup update nightly-2024-07-30
rustup update nightly-2024-02-01
rustup update nightly-2024-12-14

# Add target
rustup target install ${{ matrix.build-target.target-triple }}
rustup +nightly-2024-02-01 target install ${{ matrix.build-target.target-triple }}
rustup +nightly-2024-12-14 target install ${{ matrix.build-target.target-triple }}

# Install the nightly-2024-02-01 toolchain of the target of this machine.
# Install the nightly-2024-12-14 toolchain of the target of this machine.
DEFAULT_TARGET=$(rustc -vV | sed -n 's|host: ||p')
rustup component add rust-src --toolchain nightly-2024-02-01-$DEFAULT_TARGET
rustup component add rust-src --toolchain nightly-2024-12-14-$DEFAULT_TARGET
- name: Build dependencies (x86_64-pc-windows-gnu)
if: ${{ matrix.build-target.target-triple == 'x86_64-pc-windows-gnu' }}
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: Install Rust Toolchain
uses: RDXWorks-actions/toolchain@master
with:
toolchain: nightly-2024-07-30
toolchain: nightly-2024-12-14
default: true
components: rustfmt, clippy
- name: Install cargo nextest
Expand Down Expand Up @@ -79,7 +79,7 @@ jobs:
- name: Install Rust Toolchain
uses: RDXWorks-actions/toolchain@master
with:
toolchain: nightly-2024-07-30
toolchain: nightly-2024-12-14
default: true
profile: minimal
- name: Cargo Check
Expand All @@ -91,7 +91,7 @@ jobs:
- name: Install Rust Toolchain
uses: RDXWorks-actions/toolchain@master
with:
toolchain: nightly-2024-07-30
toolchain: nightly-2024-12-14
default: true
components: rustfmt, clippy
- name: Clippy Check
Expand Down
11 changes: 7 additions & 4 deletions crates/radix-engine-toolkit-uniffi/src/blueprints/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,13 @@ impl ToNative for MetadataInit {
None => None,
};

Ok((key, NativeKeyValueStoreInitEntry::<NativeMetadataValue> {
lock: value.lock,
value: metadata,
}))
Ok((
key,
NativeKeyValueStoreInitEntry::<NativeMetadataValue> {
lock: value.lock,
value: metadata,
},
))
})
.collect::<Result<
IndexMap<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#![allow(clippy::too_many_arguments)]

use crate::prelude::*;
use radix_common::prelude::{FromPublicKey, to_manifest_value};
use radix_common::prelude::{to_manifest_value, FromPublicKey};

#[derive(Debug, Clone, Object, Default)]
pub struct ManifestV1Builder {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#![allow(clippy::too_many_arguments)]

use crate::prelude::*;
use radix_common::prelude::{FromPublicKey, to_manifest_value};
use radix_common::prelude::{to_manifest_value, FromPublicKey};

#[derive(Debug, Clone, Object)]
pub struct ManifestV2Builder {
Expand Down
4 changes: 3 additions & 1 deletion crates/radix-engine-toolkit-uniffi/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ pub enum RadixEngineToolkitError {
#[error("The static analysis of the manifest failed: {error}")]
StaticAnalysisFailed { error: String },

#[error("Not all of the builder items were specified, progressing failed.")]
#[error(
"Not all of the builder items were specified, progressing failed."
)]
NotAllBuilderItemsWereSpecified,

#[error("Validation of manifest failed: {error}")]
Expand Down
2 changes: 1 addition & 1 deletion crates/radix-engine-toolkit-uniffi/src/manifest/blob.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ impl From<NativeManifestBlobRef> for ManifestBlobRef {

impl From<ManifestBlobRef> for NativeManifestBlobRef {
fn from(value: ManifestBlobRef) -> Self {
Self(value.value.0.0)
Self(value.value.0 .0)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ fn subintent_transaction_hash_is_derived_correctly() -> Result<()> {
}

#[test]
fn partial_transaction_builder_produces_valid_partial_transactions()
-> Result<()> {
fn partial_transaction_builder_produces_valid_partial_transactions(
) -> Result<()> {
// Arrange
let [signer_private_key] = private_keys();

Expand Down Expand Up @@ -105,8 +105,8 @@ fn partial_transaction_builder_produces_valid_partial_transactions()
}

#[test]
fn partial_transaction_builder_produces_valid_partial_transactions_with_child_subintents()
-> Result<()> {
fn partial_transaction_builder_produces_valid_partial_transactions_with_child_subintents(
) -> Result<()> {
// Arrange
let [signer_private_key] = private_keys();
let child_partial_transaction = SignedPartialTransactionV2Builder::new()
Expand Down Expand Up @@ -172,8 +172,8 @@ fn partial_transaction_builder_produces_valid_partial_transactions_with_child_su
}

#[test]
fn partial_transaction_builder_produces_valid_partial_transactions_with_multiple_layers_of_child_subintents()
-> Result<()> {
fn partial_transaction_builder_produces_valid_partial_transactions_with_multiple_layers_of_child_subintents(
) -> Result<()> {
// Arrange
let [signer_private_key] = private_keys();
let child_child_partial_transaction =
Expand Down Expand Up @@ -314,8 +314,8 @@ fn transaction_builder_v2_produces_statically_valid_transactions() -> Result<()>
}

#[test]
fn transaction_builder_v2_produces_statically_valid_transactions_with_multiple_layers_of_child_subintents()
-> Result<()> {
fn transaction_builder_v2_produces_statically_valid_transactions_with_multiple_layers_of_child_subintents(
) -> Result<()> {
// Arrange
let [notary_private_key, signer_private_key] = private_keys();
let child_child_partial_transaction =
Expand Down
2 changes: 1 addition & 1 deletion crates/radix-engine-toolkit/src/functions/manifest_sbor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// under the License.

use radix_transactions::data::{
ManifestDecompilationDisplayContext, format_manifest_value,
format_manifest_value, ManifestDecompilationDisplayContext,
};
use sbor::prelude::ContextualSerialize;
use sbor::representations::{SerializationMode, SerializationParameters};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
use radix_common::prelude::*;
use radix_engine_toolkit_common::receipt::RuntimeToolkitTransactionReceipt;
use radix_transactions::errors::*;
use radix_transactions::manifest::BuildableManifest;
use radix_transactions::manifest::static_resource_movements::StaticResourceMovementsError;
use radix_transactions::manifest::BuildableManifest;
use radix_transactions::prelude::*;
use radix_transactions::validation::*;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,10 @@ pub fn as_enclosed(
object_names,
}: &SubintentManifestV2,
) -> Option<TransactionManifestV2> {
let [
assert_worktop_empty_instruction @ InstructionV2::AssertWorktopResourcesOnly(AssertWorktopResourcesOnly {
let [assert_worktop_empty_instruction @ InstructionV2::AssertWorktopResourcesOnly(AssertWorktopResourcesOnly {
constraints,
}),
other_instructions @ ..,
InstructionV2::YieldToParent(..),
] = instructions.as_slice()
}), other_instructions @ .., InstructionV2::YieldToParent(..)] =
instructions.as_slice()
else {
return None;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,11 +295,14 @@ mod tests {
let input = "account_sim1cyvgx33089ukm2pl97pv4max0x40ruvfy4lt60yvya744cve475w0q";

let x = CanonicalAccountAddress::from_str(input).unwrap();
assert_eq!(x.node_id.as_bytes(), [
193, 24, 131, 70, 47, 57, 121, 109, 168, 63, 47, 130, 202, 239,
166, 121, 170, 241, 241, 137, 37, 126, 189, 60, 140, 39, 125, 90,
225, 153
]);
assert_eq!(
x.node_id.as_bytes(),
[
193, 24, 131, 70, 47, 57, 121, 109, 168, 63, 47, 130, 202, 239,
166, 121, 170, 241, 241, 137, 37, 126, 189, 60, 140, 39, 125,
90, 225, 153
]
);
assert_eq!(x.network_id, 0xf2);
assert_eq!(x.to_string(), input);

Expand Down
19 changes: 11 additions & 8 deletions crates/radix-engine-toolkit/src/transaction_types/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -513,14 +513,17 @@ pub fn dynamically_analyze<M: ReadableManifest>(
k,
v.into_iter()
.map(|(badge, operation)| {
(badge, match operation {
Update::Set(()) => {
Operation::Added
}
Update::Remove => {
Operation::Removed
}
})
(
badge,
match operation {
Update::Set(()) => {
Operation::Added
}
Update::Remove => {
Operation::Removed
}
},
)
})
.collect(),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ impl GeneralDetector {
}

pub fn output(self) -> Option<()> {
if self.is_valid() { Some(()) } else { None }
if self.is_valid() {
Some(())
} else {
None
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ impl GeneralSubintentDetector {
}

pub fn output(self) -> Option<()> {
if self.is_valid() { Some(()) } else { None }
if self.is_valid() {
Some(())
} else {
None
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion crates/radix-engine-toolkit/tests/manifest_sbor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// under the License.

use radix_common::prelude::{
AddressBech32Encoder, ManifestValue, ScryptoCustomSchema, manifest_encode,
manifest_encode, AddressBech32Encoder, ManifestValue, ScryptoCustomSchema,
};
use radix_common::{ManifestSbor, ScryptoSbor};
use radix_engine_toolkit::functions::manifest_sbor::ManifestSborStringRepresentation;
Expand Down
50 changes: 24 additions & 26 deletions crates/radix-engine-toolkit/tests/non_fungible.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,12 @@ fn dynamic_analysis_new_non_fungible_list_initial_supply() {

// Assert
assert_eq!(dynamic_analysis.newly_created_non_fungibles.len(), 2);
assert!(
dynamic_analysis
.newly_created_non_fungibles
.contains(&NonFungibleGlobalId::new(*address, nf_id_1))
);
assert!(
dynamic_analysis
.newly_created_non_fungibles
.contains(&NonFungibleGlobalId::new(*address, nf_id_2))
);
assert!(dynamic_analysis
.newly_created_non_fungibles
.contains(&NonFungibleGlobalId::new(*address, nf_id_1)));
assert!(dynamic_analysis
.newly_created_non_fungibles
.contains(&NonFungibleGlobalId::new(*address, nf_id_2)));
}

#[test]
Expand Down Expand Up @@ -105,11 +101,9 @@ fn dynamic_analysis_new_non_fungible_list_after_mint() {

// Assert
assert_eq!(dynamic_analysis.newly_created_non_fungibles.len(), 1);
assert!(
dynamic_analysis
.newly_created_non_fungibles
.contains(&NonFungibleGlobalId::new(*address, nf_id_2))
);
assert!(dynamic_analysis
.newly_created_non_fungibles
.contains(&NonFungibleGlobalId::new(*address, nf_id_2)));
}

#[test]
Expand Down Expand Up @@ -200,11 +194,9 @@ fn dynamic_analysis_new_non_fungible_list_after_mint_and_burn() {

// Assert
assert_eq!(dynamic_analysis.newly_created_non_fungibles.len(), 1);
assert!(
dynamic_analysis
.newly_created_non_fungibles
.contains(&NonFungibleGlobalId::new(*address, nf_id_3))
);
assert!(dynamic_analysis
.newly_created_non_fungibles
.contains(&NonFungibleGlobalId::new(*address, nf_id_3)));
}

#[test]
Expand Down Expand Up @@ -234,12 +226,18 @@ fn dynamic_analysis_new_non_fungible_list_after_update() {
NonFungibleResourceRoles::single_locked_rule(AccessRule::AllowAll),
ModuleConfig::default(),
Some(vec![
(nf_id_1.clone(), NfData {
name: "data_1".to_string(),
}),
(nf_id_2.clone(), NfData {
name: "data_2".to_string(),
}),
(
nf_id_1.clone(),
NfData {
name: "data_1".to_string(),
},
),
(
nf_id_2.clone(),
NfData {
name: "data_2".to_string(),
},
),
]),
)
.try_deposit_entire_worktop_or_abort(account, None)
Expand Down
2 changes: 1 addition & 1 deletion crates/radix-engine-toolkit/tests/schema_visitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
// specific language governing permissions and limitations
// under the License.

use radix_common::ScryptoSbor;
use radix_common::prelude::ScryptoCustomSchema;
use radix_common::ScryptoSbor;
use radix_engine_toolkit::schema_visitor::core::traverser::traverse;
use radix_engine_toolkit::schema_visitor::visitors::bucket_in_path_visitor::BucketInPathVisitor;
use radix_engine_toolkit::schema_visitor::visitors::proof_in_path_visitor::ProofInPathVisitor;
Expand Down
4 changes: 2 additions & 2 deletions crates/radix-engine-toolkit/tests/scrypto_sbor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
// specific language governing permissions and limitations
// under the License.

use radix_common::ScryptoSbor;
use radix_common::prelude::{
AddressBech32Encoder, ScryptoCustomSchema, ScryptoValue, scrypto_encode,
scrypto_encode, AddressBech32Encoder, ScryptoCustomSchema, ScryptoValue,
};
use radix_common::ScryptoSbor;
use sbor::generate_full_schema_from_single_type;
use sbor::representations::SerializationMode;

Expand Down
4 changes: 2 additions & 2 deletions crates/radix-engine-toolkit/tests/subintent_manifest_v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ use radix_engine_toolkit::functions::transaction_v2::subintent_manifest::{
use scrypto_test::prelude::*;

#[test]
fn subintent_manifest_with_no_initial_resources_and_a_final_yield_is_considered_enclosed()
{
fn subintent_manifest_with_no_initial_resources_and_a_final_yield_is_considered_enclosed(
) {
// Arrange
let manifest = ManifestBuilder::new_subintent_v2()
.assert_worktop_is_empty()
Expand Down
Loading
Loading