From b13e9a3895b150c7b6b5daa6049b9b3a572d7798 Mon Sep 17 00:00:00 2001 From: Elias Tazartes <66871571+Eikix@users.noreply.github.com> Date: Mon, 5 Feb 2024 18:12:41 +0100 Subject: [PATCH] chore: bump kakarot (#756) * chore: bump kakarot * fix: remove clone * fix: fix event filtering * chore: bump kakarot further * fix: fix pr comments * fix: fix docker compose * fix: fix fmt --- .trunk/trunk.yaml | 1 - Makefile | 2 +- lib/kakarot | 2 +- src/eth_provider/provider.rs | 6 ++++-- src/test_utils/eoa.rs | 7 ++++++- src/test_utils/tx_waiter.rs | 1 + 6 files changed, 13 insertions(+), 6 deletions(-) diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index 03ad5e02a..1fde54e1a 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -15,7 +15,6 @@ runtimes: - python@3.10.8 lint: disabled: - - yamllint - checkov enabled: - actionlint@1.6.26 diff --git a/Makefile b/Makefile index 7c23c83cc..775ac18cd 100644 --- a/Makefile +++ b/Makefile @@ -35,7 +35,7 @@ madara-rpc-up: docker compose -f docker-compose.madara.yaml up -d --force-recreate docker-down: - docker compose down --remove-orphans && docker compose rm + docker compose down -v --remove-orphans && docker compose rm install-katana: cargo install --git https://github.com/dojoengine/dojo --locked --rev be16762 katana diff --git a/lib/kakarot b/lib/kakarot index 13e5c4083..a15f20985 160000 --- a/lib/kakarot +++ b/lib/kakarot @@ -1 +1 @@ -Subproject commit 13e5c408350d330b05d04f4be7603f2758926545 +Subproject commit a15f20985039502300649424e5a7726b181bc0ee diff --git a/src/eth_provider/provider.rs b/src/eth_provider/provider.rs index 2d87b514a..6f04d82e4 100644 --- a/src/eth_provider/provider.rs +++ b/src/eth_provider/provider.rs @@ -490,10 +490,10 @@ where // Here we check if CallRequest.origin is None, if so, we insert origin = address(0) let from = into_via_wrapper!(call.from.unwrap_or_default()); - let data = call.input.unique_input().unwrap_or_default().cloned().unwrap_or_default(); + let data = call.input.into_input().unwrap_or_default(); let calldata: Vec<_> = data.into_iter().map(FieldElement::from).collect(); - let gas_limit = into_via_try_wrapper!(call.gas.unwrap_or_default()); + let gas_limit = into_via_try_wrapper!(call.gas.unwrap_or_else(|| U256::from(u64::MAX))); let gas_price = into_via_try_wrapper!(call.gas_price.unwrap_or_default()); let value = into_via_try_wrapper!(call.value.unwrap_or_default()); @@ -508,6 +508,8 @@ where &Uint256 { low: value, high: FieldElement::ZERO }, &calldata.len().into(), &CairoArrayLegacy(calldata), + &FieldElement::ZERO, + &CairoArrayLegacy(vec![]), ) .block_id(starknet_block_id) .call() diff --git a/src/test_utils/eoa.rs b/src/test_utils/eoa.rs index 3d1d3ed27..29e10039e 100644 --- a/src/test_utils/eoa.rs +++ b/src/test_utils/eoa.rs @@ -88,6 +88,11 @@ impl KakarotEOA

{ let chain_id = self.eth_provider.chain_id().await?.unwrap_or_default(); let bytecode = ::load_contract_bytecode(contract_name)?; + let expected_address = { + let expected_eth_address = self.evm_address().expect("Failed to get EVM address").create(nonce); + FieldElement::from_byte_slice_be(expected_eth_address.as_slice()) + .expect("Failed to convert address to field element") + }; let tx = ::prepare_create_transaction( &bytecode, @@ -124,7 +129,7 @@ impl KakarotEOA

{ let event = receipt .events .into_iter() - .find(|event| event.keys.contains(&selector)) + .find(|event| event.keys.contains(&selector) && event.data.contains(&expected_address)) .ok_or_else(|| eyre::eyre!("Failed to find deployed contract address"))?; Ok(KakarotEvmContract::new(bytecode, event.data[1], event.data[0])) diff --git a/src/test_utils/tx_waiter.rs b/src/test_utils/tx_waiter.rs index 87f4af892..1b8a1c311 100644 --- a/src/test_utils/tx_waiter.rs +++ b/src/test_utils/tx_waiter.rs @@ -27,6 +27,7 @@ where match provider.get_transaction_receipt(transaction_hash).await { Ok(receipt) => match receipt.execution_result() { ExecutionResult::Succeeded => { + info!("Transaction confirmed successfully 🎉"); return Ok(()); } ExecutionResult::Reverted { reason } => {