Skip to content

Commit

Permalink
rusk: removed contract deployment contract id
Browse files Browse the repository at this point in the history
  • Loading branch information
miloszm committed Jul 9, 2024
1 parent 92bdb8c commit a5f494c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
7 changes: 4 additions & 3 deletions rusk/src/lib/chain/rusk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,9 @@ impl Rusk {

if gas_spent > block_gas_left || deploy_result.is_err() {
// If the transaction went over the block gas limit we
// re-execute all spent transactions. We don't discard the
// transaction, since it is technically valid.
// re-execute all spent transactions. We don't discard
// the transaction, since it is
// technically valid.
if gas_spent > block_gas_left {
warn!("This is not supposed to happen with conservative tx inclusion");
}
Expand Down Expand Up @@ -650,7 +651,7 @@ fn try_deploy(
) -> Result<()> {
if let Some(deploy) = tx.payload().contract_deploy() {
let result = session.deploy_raw(
deploy.contract_id.map(|id| id.into()),
None,
deploy.bytecode.bytes.as_slice(),
deploy.constructor_args.clone(),
deploy.owner.clone(),
Expand Down
5 changes: 0 additions & 5 deletions rusk/tests/services/contract_deployment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ fn make_and_execute_transaction_deploy(
rusk: &Rusk,
wallet: &wallet::Wallet<TestStore, TestStateClient, TestProverClient>,
bytecode: impl AsRef<[u8]>,
contract_id: &ContractId,
gas_limit: u64,
init_value: u8,
should_err: bool,
Expand All @@ -132,7 +131,6 @@ fn make_and_execute_transaction_deploy(
.execute(
&mut rng,
CallOrDeploy::Deploy(ContractDeploy {
contract_id: Some(contract_id.to_bytes()),
bytecode: Bytecode {
hash: bytecode_hash(bytecode.as_ref()),
bytes: bytecode.as_ref().to_vec(),
Expand Down Expand Up @@ -256,7 +254,6 @@ pub async fn contract_deploy() {
&rusk,
&wallet,
bob_bytecode,
&BOB_CONTRACT_ID,
GAS_LIMIT,
BOB_INIT_VALUE,
false,
Expand Down Expand Up @@ -306,7 +303,6 @@ pub async fn contract_already_deployed() {
&rusk,
&wallet,
bob_bytecode,
&BOB_CONTRACT_ID,
GAS_LIMIT,
BOB_INIT_VALUE,
true,
Expand Down Expand Up @@ -357,7 +353,6 @@ pub async fn contract_deploy_corrupted_bytecode() {
&rusk,
&wallet,
bob_bytecode,
&BOB_CONTRACT_ID,
GAS_LIMIT,
BOB_INIT_VALUE,
true,
Expand Down

0 comments on commit a5f494c

Please sign in to comment.