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

[FlexiDag] remove some proxima-compatible codes #4115

Merged
merged 1 commit into from
May 27, 2024
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
6 changes: 1 addition & 5 deletions chain/open-block/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,11 +250,7 @@ impl OpenedBlock {
}
/// Run blockmeta first
fn initialize(&mut self) -> Result<()> {
let block_metadata_txn = if self.chain_id.is_proxima() {
Transaction::BlockMetadata(self.block_meta.to_legacy())
} else {
Transaction::BlockMetadata(self.block_meta.clone())
};
let block_metadata_txn = Transaction::BlockMetadata(self.block_meta.clone());
let block_meta_txn_hash = block_metadata_txn.id();
let mut results = execute_transactions(
&self.state,
Expand Down
16 changes: 8 additions & 8 deletions vm/transaction-builder/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -347,24 +347,24 @@ pub fn create_signed_txn_with_association_account(
.expect("Sign txn should work.")
}

pub fn build_stdlib_package(net: &ChainNetwork, stdlib_option: StdLibOptions) -> Result<Package> {
let init_script = match net.genesis_config().stdlib_version {
fn build_init_script(net: &ChainNetwork) -> ScriptFunction {
match net.genesis_config().stdlib_version {
StdlibVersion::Version(1) => build_init_script_v1(net),
version if version < StdlibVersion::Version(12) => build_init_script_v2(net),
_ => build_init_script_v3(net),
};
}
}

pub fn build_stdlib_package(net: &ChainNetwork, stdlib_option: StdLibOptions) -> Result<Package> {
let init_script = build_init_script(net);
stdlib_package(stdlib_option, Some(init_script))
}

pub fn build_stdlib_package_with_modules(
net: &ChainNetwork,
modules: Vec<Vec<u8>>,
) -> Result<Package> {
let init_script = match net.genesis_config().stdlib_version {
StdlibVersion::Version(1) => build_init_script_v1(net),
version if version < StdlibVersion::Version(12) => build_init_script_v2(net),
_ => build_init_script_v3(net),
};
let init_script = build_init_script(net);
module_to_package(modules, Some(init_script))
}

Expand Down
4 changes: 0 additions & 4 deletions vm/types/src/block_metadata/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,6 @@ impl BlockMetadata {
pub fn author(&self) -> AccountAddress {
self.author
}
pub fn to_legacy(&self) -> Self {
let meta: legacy::BlockMetadata = self.clone().into();
meta.into()
}
}

impl<'de> Deserialize<'de> for BlockMetadata {
Expand Down
Loading