fix errors

This commit is contained in:
thesn10
2026-06-14 20:31:37 +02:00
parent 955430f1c9
commit 8ab04567cd
4 changed files with 14 additions and 46 deletions

View File

@@ -26,8 +26,8 @@ pyth-solana-receiver-sdk = "1.2.0"
[dev-dependencies]
litesvm = "0.12.0"
solana-message = "4.2.1"
solana-transaction = "4.1.3"
solana-message = "3.1.0"
solana-transaction = "3.1.0"
solana-signer = "3.0.1"
solana-keypair = "3.1.2"

View File

@@ -4,7 +4,7 @@ use anchor_lang::{
solana_program::{instruction::Instruction, system_program},
AccountDeserialize, InstructionData, ToAccountMetas,
};
use litesvm::LiteSVM;
use litesvm::{types::TransactionResult, LiteSVM};
use solana_keypair::Keypair;
use solana_message::{Message, VersionedMessage};
use solana_signer::Signer;
@@ -81,13 +81,11 @@ pub fn try_send(
svm: &mut LiteSVM,
ixs: &[Instruction],
signers: &[&Keypair],
) -> Result<(), Box<dyn std::error::Error>> {
) -> TransactionResult {
let blockhash = svm.latest_blockhash();
let msg = Message::new_with_blockhash(ixs, Some(&signers[0].pubkey()), &blockhash);
let tx = VersionedTransaction::try_new(VersionedMessage::Legacy(msg), signers)
.map_err(|e| Box::new(e) as Box<dyn std::error::Error>)?;
let tx = VersionedTransaction::try_new(VersionedMessage::Legacy(msg), signers).unwrap();
svm.send_transaction(tx)
.map_err(|e| Box::new(e) as Box<dyn std::error::Error>)
}
// --- Listing instruction builders ---

View File

@@ -1,5 +1,6 @@
mod common;
use common::*;
use solana_signer::Signer;
#[test]
fn seller_can_create_sol_only_listing() {