Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Use Vec from nostd for no_std environment #124

Merged
merged 1 commit into from
Jan 17, 2025
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
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
Loading