Skip to content

Commit

Permalink
fix: Use nostd for no_std environment (#124)
Browse files Browse the repository at this point in the history
  • Loading branch information
code0xff authored Jan 17, 2025
1 parent c681ad6 commit e25af14
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions frame/solana/runtime-api/src/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

use crate::{error::Error, SolanaRuntimeCall};
use frame_support::traits::Get;
use nostd::marker::PhantomData;
use nostd::{marker::PhantomData, prelude::*};
use pallet_solana::Pubkey;
use solana_inline_spl::token::GenericTokenAccount;
use solana_rpc_client_api::filter::RpcFilterType;
Expand Down Expand Up @@ -101,7 +101,7 @@ impl<T> ProgramAccounts<T> {
}

fn calc_scan_result_size(account: &Account) -> usize {
account.data().len() + std::mem::size_of::<Account>() + std::mem::size_of::<Pubkey>()
account.data().len() + core::mem::size_of::<Account>() + core::mem::size_of::<Pubkey>()
}
}

Expand Down
2 changes: 1 addition & 1 deletion frame/solana/runtime-api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pub mod fee;
pub mod transaction;

use error::Error;
use nostd::{string::String, vec::Vec};
use nostd::prelude::*;
use sp_api::decl_runtime_apis;

decl_runtime_apis! {
Expand Down
2 changes: 1 addition & 1 deletion frame/solana/runtime-api/src/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// limitations under the License.

use crate::{error::Error, SolanaRuntimeCall};
use nostd::marker::PhantomData;
use nostd::{marker::PhantomData, prelude::*};
use pallet_solana::{runtime::bank::TransactionSimulationResult, Pubkey};
use solana_sdk::{
feature_set::FeatureSet,
Expand Down
2 changes: 1 addition & 1 deletion frame/solana/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ pub mod pallet {
},
};
use frame_system::{pallet_prelude::*, CheckWeight};
use nostd::sync::Arc;
use nostd::{prelude::*, sync::Arc};
use np_runtime::traits::LossyInto;
use parity_scale_codec::Codec;
use solana_sdk::{
Expand Down
2 changes: 1 addition & 1 deletion vendor/solana/rpc-client-api/src/filter.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use {
base64::{prelude::BASE64_STANDARD, Engine},
nostd::borrow::Cow,
nostd::{borrow::Cow, prelude::*},
serde::{Deserialize, Serialize},
solana_inline_spl::{token::GenericTokenAccount, token_2022::Account},
solana_sdk::account::{AccountSharedData, ReadableAccount},
Expand Down

0 comments on commit e25af14

Please sign in to comment.