Skip to content

Commit e25af14

Browse files
authored
fix: Use nostd for no_std environment (#124)
1 parent c681ad6 commit e25af14

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

frame/solana/runtime-api/src/account.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
use crate::{error::Error, SolanaRuntimeCall};
1919
use frame_support::traits::Get;
20-
use nostd::marker::PhantomData;
20+
use nostd::{marker::PhantomData, prelude::*};
2121
use pallet_solana::Pubkey;
2222
use solana_inline_spl::token::GenericTokenAccount;
2323
use solana_rpc_client_api::filter::RpcFilterType;
@@ -101,7 +101,7 @@ impl<T> ProgramAccounts<T> {
101101
}
102102

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

frame/solana/runtime-api/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pub mod fee;
2424
pub mod transaction;
2525

2626
use error::Error;
27-
use nostd::{string::String, vec::Vec};
27+
use nostd::prelude::*;
2828
use sp_api::decl_runtime_apis;
2929

3030
decl_runtime_apis! {

frame/solana/runtime-api/src/transaction.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
// limitations under the License.
1717

1818
use crate::{error::Error, SolanaRuntimeCall};
19-
use nostd::marker::PhantomData;
19+
use nostd::{marker::PhantomData, prelude::*};
2020
use pallet_solana::{runtime::bank::TransactionSimulationResult, Pubkey};
2121
use solana_sdk::{
2222
feature_set::FeatureSet,

frame/solana/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ pub mod pallet {
108108
},
109109
};
110110
use frame_system::{pallet_prelude::*, CheckWeight};
111-
use nostd::sync::Arc;
111+
use nostd::{prelude::*, sync::Arc};
112112
use np_runtime::traits::LossyInto;
113113
use parity_scale_codec::Codec;
114114
use solana_sdk::{

vendor/solana/rpc-client-api/src/filter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use {
22
base64::{prelude::BASE64_STANDARD, Engine},
3-
nostd::borrow::Cow,
3+
nostd::{borrow::Cow, prelude::*},
44
serde::{Deserialize, Serialize},
55
solana_inline_spl::{token::GenericTokenAccount, token_2022::Account},
66
solana_sdk::account::{AccountSharedData, ReadableAccount},

0 commit comments

Comments
 (0)