diff --git a/execution-core/src/transfer.rs b/execution-core/src/transfer.rs index 1ac6b5d483..f0e85e8bb7 100644 --- a/execution-core/src/transfer.rs +++ b/execution-core/src/transfer.rs @@ -108,8 +108,6 @@ pub enum CallOrDeploy { #[derive(Debug, Clone, PartialEq, Eq, Archive, Serialize, Deserialize)] #[archive_attr(derive(CheckBytes))] pub struct ContractDeploy { - /// The optional ID of the contract to be deployed. - pub contract_id: Option, /// Bytecode of the contract to be deployed. pub bytecode: Bytecode, /// Owner of the contract to be deployed. @@ -139,14 +137,6 @@ impl ContractDeploy { pub fn to_var_bytes(&self) -> Vec { let mut bytes = Vec::new(); - match self.contract_id { - Some(contract_id) => { - bytes.push(1); - bytes.extend(contract_id); - } - None => bytes.push(0), - } - bytes.extend(&self.bytecode.to_var_bytes()); bytes.extend((self.owner.len() as u64).to_bytes()); @@ -170,18 +160,6 @@ impl ContractDeploy { /// Errors when the bytes are not canonical. pub fn from_slice(buf: &[u8]) -> Result { let mut buf = buf; - let (offset, contract_id) = match u8::from_reader(&mut buf)? { - 0 => (0, None), - 1 => { - let mut contract = [0u8; 32]; - contract.copy_from_slice(&buf[..32]); - (32, Some(contract)) - } - _ => { - return Err(BytesError::InvalidData); - } - }; - let mut buf = &buf[offset..]; let (bytecode, bytecode_len) = Bytecode::from_buf(buf)?; buf = &buf[bytecode_len..]; @@ -206,7 +184,6 @@ impl ContractDeploy { }; Ok(Self { - contract_id, bytecode, owner, constructor_args, diff --git a/execution-core/src/transfer/transaction.rs b/execution-core/src/transfer/transaction.rs index 2a2ad06f48..a61abe4195 100644 --- a/execution-core/src/transfer/transaction.rs +++ b/execution-core/src/transfer/transaction.rs @@ -136,9 +136,6 @@ impl Payload { bytes.extend(call.fn_name.as_bytes()); bytes.extend(&call.fn_args); } else if let Some(deploy) = self.contract_deploy() { - if let Some(contract_id) = &deploy.contract_id { - bytes.extend(contract_id); - } bytes.extend(&deploy.bytecode.to_hash_input_bytes()); bytes.extend(&deploy.owner); if let Some(constructor_args) = &deploy.constructor_args { diff --git a/execution-core/tests/serialization.rs b/execution-core/tests/serialization.rs index 0fc0173dad..fa5bb9e0ef 100644 --- a/execution-core/tests/serialization.rs +++ b/execution-core/tests/serialization.rs @@ -112,7 +112,6 @@ fn transaction_serialization_deploy() -> Result<(), Error> { let (tx_skeleton, fee, _) = build_skeleton_fee_deposit(); // build the contract-deploy - let contract = [42; 32]; let bytecode = Bytecode { hash: [1u8; 32], bytes: vec![1, 2, 3, 4, 5], @@ -120,7 +119,6 @@ fn transaction_serialization_deploy() -> Result<(), Error> { let owner = [1; 32]; let constructor_args = vec![5]; let deploy = ContractDeploy { - contract_id: Some(contract), bytecode, owner: owner.to_vec(), constructor_args: Some(constructor_args),