Skip to content

Commit

Permalink
chore: bump kakarot (#756)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Eikix authored Feb 5, 2024
1 parent 776e3bb commit b13e9a3
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 6 deletions.
1 change: 0 additions & 1 deletion .trunk/trunk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ runtimes:
- python@3.10.8
lint:
disabled:
- yamllint
- checkov
enabled:
- actionlint@1.6.26
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/kakarot
Submodule kakarot updated 119 files
6 changes: 4 additions & 2 deletions src/eth_provider/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand All @@ -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()
Expand Down
7 changes: 6 additions & 1 deletion src/test_utils/eoa.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ impl<P: Provider + Send + Sync> KakarotEOA<P> {
let chain_id = self.eth_provider.chain_id().await?.unwrap_or_default();

let bytecode = <KakarotEvmContract as EvmContract>::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 = <KakarotEvmContract as EvmContract>::prepare_create_transaction(
&bytecode,
Expand Down Expand Up @@ -124,7 +129,7 @@ impl<P: Provider + Send + Sync> KakarotEOA<P> {
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]))
Expand Down
1 change: 1 addition & 0 deletions src/test_utils/tx_waiter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 } => {
Expand Down

0 comments on commit b13e9a3

Please sign in to comment.