fix: fixed typescript tests
This commit is contained in:
parent
35ea2e1b6e
commit
12966235f2
|
@ -15,7 +15,7 @@
|
|||
"scripts": {
|
||||
"test": "jest --detectOpenHandles",
|
||||
"start:lite-rpc": "lite-rpc",
|
||||
"test:test-validator": "start-server-and-test 'solana-test-validator --reset --quiet & target/debug/lite-rpc --rpc-url http://localhost:8899 --websocket-url ws://localhost:8900/' http://localhost:8899/health test"
|
||||
"test:test-validator": "start-server-and-test 'target/debug/lite-rpc --port 9000 --subscription-port 9001 --rpc-url http://localhost:8899 --websocket-url ws://localhost:8900/' http://localhost:8899/health test"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^4.8.4"
|
||||
|
|
|
@ -49,7 +49,7 @@ pub fn main() {
|
|||
notification_reciever,
|
||||
));
|
||||
|
||||
let subscription_port = subscription_port
|
||||
let subscription_port = format!("127.0.0.1:{}",subscription_port)
|
||||
.parse::<SocketAddr>()
|
||||
.expect("Invalid subscription port");
|
||||
|
||||
|
@ -91,7 +91,7 @@ pub fn main() {
|
|||
.expect("Runtime"),
|
||||
);
|
||||
let max_request_body_size: usize = 50 * (1 << 10);
|
||||
let socket_addr = rpc_addr.parse::<SocketAddr>().unwrap();
|
||||
let socket_addr = format!("127.0.0.1:{}",rpc_addr).parse::<SocketAddr>().unwrap();
|
||||
|
||||
{
|
||||
let request_processor = request_processor.clone();
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { Connection, Keypair, LAMPORTS_PER_SOL, Message, VersionedTransaction } from "@solana/web3.js";
|
||||
import { url } from "./urls";
|
||||
|
||||
jest.setTimeout(60000);
|
||||
test('send and confirm transaction', async () => {
|
||||
const connection = new Connection(url, 'confirmed');
|
||||
const payer = Keypair.generate();
|
||||
|
@ -19,7 +19,7 @@ test('send and confirm transaction', async () => {
|
|||
accountKeys: [payer.publicKey.toBase58()],
|
||||
}),
|
||||
);
|
||||
|
||||
|
||||
versionedTx.sign([payer]);
|
||||
const signature = await connection.sendTransaction(versionedTx);
|
||||
const latestBlockHash = await connection.getLatestBlockhash();
|
||||
|
|
Loading…
Reference in New Issue