-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RPC 0.8.0: restructure errors (#627)
* Move and rename tx status struct; add failure_reason * Rename InsufficientMaxFee to InsufficientResourcesForValidate * Improve panicking_contract: compile with 2.8.0, add method for distant panic
- Loading branch information
Showing
26 changed files
with
1,185 additions
and
269 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
contracts/test_artifacts/cairo1/panicking_contract/compilation_info.txt
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 |
---|---|---|
@@ -1 +1 @@ | ||
Compiled using cairo 2.2.0 | ||
Compiled using cairo 2.8.0 |
15 changes: 14 additions & 1 deletion
15
contracts/test_artifacts/cairo1/panicking_contract/panicking_contract.cairo
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 |
---|---|---|
@@ -1,17 +1,30 @@ | ||
use core::starknet::ContractAddress; | ||
|
||
#[starknet::interface] | ||
trait IPanickingContract<TContractState> { | ||
fn create_panic(self: @TContractState, panic_reason: felt252); | ||
fn create_panic_in_another_contract(self: @TContractState, address: ContractAddress, panic_reason: felt252); | ||
} | ||
|
||
#[starknet::contract] | ||
mod PanickingContract { | ||
use core::starknet::{ContractAddress, call_contract_syscall}; | ||
|
||
#[storage] | ||
struct Storage {} | ||
|
||
#[external(v0)] | ||
#[abi(embed_v0)] | ||
impl PanickingContract of super::IPanickingContract<ContractState> { | ||
fn create_panic(self: @ContractState, panic_reason: felt252) { | ||
panic_with_felt252(panic_reason); | ||
} | ||
|
||
fn create_panic_in_another_contract(self: @ContractState, address: ContractAddress, panic_reason: felt252) { | ||
call_contract_syscall( | ||
address, | ||
selector!("create_panic"), | ||
array![panic_reason].span() | ||
).unwrap(); | ||
} | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
contracts/test_artifacts/cairo1/panicking_contract/panicking_contract.sierra
Large diffs are not rendered by default.
Oops, something went wrong.
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
Oops, something went wrong.