Skip to content

Commit

Permalink
compile e2e perf tests with move2
Browse files Browse the repository at this point in the history
  • Loading branch information
igor-aptos committed Oct 30, 2024
1 parent c44f1a3 commit 60862ba
Show file tree
Hide file tree
Showing 4 changed files with 1,822 additions and 1,741 deletions.
17 changes: 13 additions & 4 deletions crates/transaction-generator-lib/src/publishing/publish_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
// SPDX-License-Identifier: Apache-2.0

use crate::publishing::{module_simple, raw_module_data};
use aptos_framework::{natives::code::PackageMetadata, KnownAttribute};
use aptos_framework::{
natives::code::PackageMetadata, KnownAttribute, APTOS_METADATA_KEY, APTOS_METADATA_KEY_V1,
};
use aptos_sdk::{
bcs,
move_types::{identifier::Identifier, language_storage::ModuleId},
Expand Down Expand Up @@ -272,10 +274,17 @@ fn update(
}
});
});
assert!(new_module.metadata.len() == 1);
let mut count = 0;
new_module.metadata.iter_mut().for_each(|metadata_holder| {
metadata_holder.value = bcs::to_bytes(&metadata).expect("Metadata must serialize");
})
if metadata_holder.key == APTOS_METADATA_KEY_V1
|| metadata_holder.key == APTOS_METADATA_KEY
{
metadata_holder.value =
bcs::to_bytes(&metadata).expect("Metadata must serialize");
count += 1;
}
});
assert!(count == 1, "{:?}", new_module.metadata);
}

new_modules.push((original_name.clone(), new_module));
Expand Down
Loading

0 comments on commit 60862ba

Please sign in to comment.