Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions account/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ dev-context-only-utils = ["bincode", "dep:qualifier_attr"]
frozen-abi = [
"dep:solana-frozen-abi",
"dep:solana-frozen-abi-macro",
"dep:solana-logger",
"solana-pubkey/frozen-abi",
]
serde = [
Expand All @@ -41,7 +40,6 @@ solana-clock = { workspace = true }
solana-frozen-abi = { workspace = true, optional = true }
solana-frozen-abi-macro = { workspace = true, optional = true }
solana-instruction-error = { workspace = true }
solana-logger = { workspace = true, optional = true }
solana-pubkey = { workspace = true }
solana-sdk-ids = { workspace = true }
solana-sysvar = { workspace = true, features = ["bincode"], optional = true }
Expand Down
10 changes: 4 additions & 6 deletions frozen-abi-macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ fn derive_abi_sample_enum_type(input: ItemEnum) -> TokenStream {
#( #attrs )*
impl #impl_generics ::solana_frozen_abi::abi_example::AbiExample for #type_name #ty_generics #where_clause {
fn example() -> Self {
::solana_frozen_abi::__private::log::info!(
::std::println!(
"AbiExample for enum: {}",
std::any::type_name::<#type_name #ty_generics>()
);
Expand Down Expand Up @@ -194,7 +194,7 @@ fn derive_abi_sample_struct_type(input: ItemStruct) -> TokenStream {
#( #attrs )*
impl #impl_generics ::solana_frozen_abi::abi_example::AbiExample for #type_name #ty_generics #where_clause {
fn example() -> Self {
::solana_frozen_abi::__private::log::info!(
::std::println!(
"AbiExample for struct: {}",
std::any::type_name::<#type_name #ty_generics>()
);
Expand Down Expand Up @@ -287,22 +287,20 @@ fn quote_for_test(

#[test]
fn test_abi_digest() {
::solana_logger::setup();
let mut digester = ::solana_frozen_abi::abi_digester::AbiDigester::create();
let example = <#type_name>::example();
let result = <_>::visit_for_abi(&&example, &mut digester);
let mut hash = digester.finalize();
// pretty-print error
if result.is_err() {
::solana_frozen_abi::__private::log::error!("digest error: {:#?}", result);
::std::eprintln!("Error: digest error: {:#?}", result);
}
result.unwrap();
let actual_digest = ::std::format!("{}", hash);
if ::std::env::var("SOLANA_ABI_BULK_UPDATE").is_ok() {
if #expected_digest != actual_digest {
::std::eprintln!("sed -i -e 's/{}/{}/g' $(git grep --files-with-matches frozen_abi)", #expected_digest, hash);
}
::solana_frozen_abi::__private::log::warn!("Not testing the abi digest under SOLANA_ABI_BULK_UPDATE!");
::std::eprintln!("Warning: Not testing the abi digest under SOLANA_ABI_BULK_UPDATE!");
} else {
if let Ok(dir) = ::std::env::var("SOLANA_ABI_DUMP_DIR") {
assert_eq!(#expected_digest, actual_digest, "Possibly ABI changed? Examine the diff in SOLANA_ABI_DUMP_DIR!: \n$ diff -u {}/*{}* {}/*{}*", dir, #expected_digest, dir, actual_digest);
Expand Down
1 change: 0 additions & 1 deletion frozen-abi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ memmap2 = { workspace = true }
bitflags = { workspace = true, features = ["serde"] }
serde_bytes = { workspace = true }
serde_with = { workspace = true, features = ["macros"] }
solana-logger = { workspace = true }

[lints]
workspace = true
5 changes: 2 additions & 3 deletions frozen-abi/src/abi_digester.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use {
abi_example::{normalize_type_name, AbiEnumVisitor},
hash::{Hash, Hasher},
},
log::*,
serde::ser::{Error as SerdeError, *},
std::{any::type_name, io::Write},
thiserror::Error,
Expand Down Expand Up @@ -148,7 +147,7 @@ impl AbiDigester {
buf,
width = self.depth.saturating_mul(INDENT_WIDTH)
);
info!("updating with: {}", buf.trim_end());
println!("updating with: {}", buf.trim_end());
(*self.data_types.borrow_mut()).push(buf);
}

Expand Down Expand Up @@ -212,7 +211,7 @@ impl AbiDigester {
.unwrap_or("unknown-test-thread")
.replace(':', "_");
if thread_name == "main" {
error!("Bad thread name detected for dumping; Maybe, --test-threads=1? Sorry, SOLANA_ABI_DUMP_DIR doesn't work under 1; increase it");
eprintln!("Bad thread name detected for dumping; Maybe, --test-threads=1? Sorry, SOLANA_ABI_DUMP_DIR doesn't work under 1; increase it");
}

let path = format!("{dir}/{thread_name}_{hash}",);
Expand Down
Loading