-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: stop supporting legacy console.sol signatures
- Loading branch information
Showing
17 changed files
with
157 additions
and
932 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.
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
File renamed without changes.
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,83 @@ | ||
//! DSTest log interface. | ||
|
||
use super::{format_units_int, format_units_uint}; | ||
use alloy_primitives::hex; | ||
use alloy_sol_types::sol; | ||
use derive_more::Display; | ||
use itertools::Itertools; | ||
|
||
// TODO: Use `UiFmt` | ||
|
||
sol! { | ||
#[sol(abi)] | ||
#[derive(Display)] | ||
interface Console { | ||
#[display("{val}")] | ||
event log(string val); | ||
|
||
#[display("{}", hex::encode_prefixed(val))] | ||
event logs(bytes val); | ||
|
||
#[display("{val}")] | ||
event log_address(address val); | ||
|
||
#[display("{val}")] | ||
event log_bytes32(bytes32 val); | ||
|
||
#[display("{val}")] | ||
event log_int(int val); | ||
|
||
#[display("{val}")] | ||
event log_uint(uint val); | ||
|
||
#[display("{}", hex::encode_prefixed(val))] | ||
event log_bytes(bytes val); | ||
|
||
#[display("{val}")] | ||
event log_string(string val); | ||
|
||
#[display("[{}]", val.iter().format(", "))] | ||
event log_array(uint256[] val); | ||
|
||
#[display("[{}]", val.iter().format(", "))] | ||
event log_array(int256[] val); | ||
|
||
#[display("[{}]", val.iter().format(", "))] | ||
event log_array(address[] val); | ||
|
||
#[display("{key}: {val}")] | ||
event log_named_address(string key, address val); | ||
|
||
#[display("{key}: {val}")] | ||
event log_named_bytes32(string key, bytes32 val); | ||
|
||
#[display("{key}: {}", format_units_int(val, decimals))] | ||
event log_named_decimal_int(string key, int val, uint decimals); | ||
|
||
#[display("{key}: {}", format_units_uint(val, decimals))] | ||
event log_named_decimal_uint(string key, uint val, uint decimals); | ||
|
||
#[display("{key}: {val}")] | ||
event log_named_int(string key, int val); | ||
|
||
#[display("{key}: {val}")] | ||
event log_named_uint(string key, uint val); | ||
|
||
#[display("{key}: {}", hex::encode_prefixed(val))] | ||
event log_named_bytes(string key, bytes val); | ||
|
||
#[display("{key}: {val}")] | ||
event log_named_string(string key, string val); | ||
|
||
#[display("{key}: [{}]", val.iter().format(", "))] | ||
event log_named_array(string key, uint256[] val); | ||
|
||
#[display("{key}: [{}]", val.iter().format(", "))] | ||
event log_named_array(string key, int256[] val); | ||
|
||
#[display("{key}: [{}]", val.iter().format(", "))] | ||
event log_named_array(string key, address[] val); | ||
} | ||
} | ||
|
||
pub use Console::*; |
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
//! Hardhat `console.sol` interface. | ||
|
||
use alloy_sol_types::sol; | ||
use foundry_common_fmt::*; | ||
use foundry_macros::ConsoleFmt; | ||
|
||
sol!( | ||
#[sol(abi)] | ||
#[derive(ConsoleFmt)] | ||
Console, | ||
"src/Console.json" | ||
); | ||
|
||
pub use Console::*; |
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.