Skip to content

Commit

Permalink
sdk: Fix --no-default-features build in transaction_context.rs (solan…
Browse files Browse the repository at this point in the history
…a-labs#1409)

sdk: Fix --no-default-features build
  • Loading branch information
joncinque authored May 17, 2024
1 parent a7dd8d6 commit 43d6a04
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions sdk/src/transaction_context.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Data shared between program runtime and built-in programs as well as SBF programs.
#![deny(clippy::indexing_slicing)]

#[cfg(all(not(target_os = "solana"), debug_assertions))]
#[cfg(all(not(target_os = "solana"), feature = "full", debug_assertions))]
use crate::signature::Signature;
#[cfg(not(target_os = "solana"))]
use {
Expand Down Expand Up @@ -145,7 +145,7 @@ pub struct TransactionContext {
#[cfg(not(target_os = "solana"))]
rent: Rent,
/// Useful for debugging to filter by or to look it up on the explorer
#[cfg(all(not(target_os = "solana"), debug_assertions))]
#[cfg(all(not(target_os = "solana"), feature = "full", debug_assertions))]
signature: Signature,
}

Expand All @@ -172,7 +172,7 @@ impl TransactionContext {
return_data: TransactionReturnData::default(),
accounts_resize_delta: RefCell::new(0),
rent,
#[cfg(all(not(target_os = "solana"), debug_assertions))]
#[cfg(all(not(target_os = "solana"), feature = "full", debug_assertions))]
signature: Signature::default(),
}
}
Expand All @@ -195,13 +195,13 @@ impl TransactionContext {
}

/// Stores the signature of the current transaction
#[cfg(all(not(target_os = "solana"), debug_assertions))]
#[cfg(all(not(target_os = "solana"), feature = "full", debug_assertions))]
pub fn set_signature(&mut self, signature: &Signature) {
self.signature = *signature;
}

/// Returns the signature of the current transaction
#[cfg(all(not(target_os = "solana"), debug_assertions))]
#[cfg(all(not(target_os = "solana"), feature = "full", debug_assertions))]
pub fn get_signature(&self) -> &Signature {
&self.signature
}
Expand Down

0 comments on commit 43d6a04

Please sign in to comment.