-
Notifications
You must be signed in to change notification settings - Fork 247
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(executor/call): properly return error stack information for faile…
…d calls Use blockifier's code to convert a failed call to a revert summary and add then convert that to an error stack. This adds proper error stacks for call failures where the failure does not happen in the top-level call.
- Loading branch information
Showing
7 changed files
with
222 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Code generated by scarb DO NOT EDIT. | ||
version = 1 | ||
|
||
[[package]] | ||
name = "caller" | ||
version = "0.1.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[package] | ||
name = "caller" | ||
version = "0.1.0" | ||
edition = "2024_07" | ||
description = "A simple contract that calls other contracts." | ||
|
||
# See more keys and their definitions at https://docs.swmansion.com/scarb/docs/reference/manifest.html | ||
|
||
[dependencies] | ||
starknet = ">=2.9.2" | ||
|
||
[[target.starknet-contract]] | ||
casm = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
use starknet::account::Call; | ||
|
||
#[starknet::interface] | ||
pub trait ICaller<TContractState> { | ||
fn call(ref self: TContractState, calls: Array<Call>) -> Array<Span<felt252>>; | ||
} | ||
|
||
#[starknet::contract] | ||
pub mod Caller { | ||
use starknet::account::Call; | ||
use starknet::SyscallResultTrait; | ||
|
||
#[storage] | ||
struct Storage {} | ||
|
||
#[abi(embed_v0)] | ||
pub impl CallerImpl of super::ICaller<ContractState> { | ||
fn call(ref self: ContractState, calls: Array<Call>) -> Array<Span<felt252>> { | ||
let mut res = array![]; | ||
for call in calls.span() { | ||
res.append(execute_single_call(call)) | ||
}; | ||
res | ||
} | ||
} | ||
|
||
fn execute_single_call(call: @Call) -> Span<felt252> { | ||
let Call { to, selector, calldata } = *call; | ||
starknet::syscalls::call_contract_syscall(to, selector, calldata).unwrap_syscall() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters