Skip to content

Commit

Permalink
fix: day 1 fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nickfrosty committed Jun 16, 2023
1 parent 397ff93 commit ec52d20
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 19 deletions.
19 changes: 2 additions & 17 deletions quest-1/scripts/1.simpleTransaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

// import custom helpers for demos
import { payer, testWallet, connection } from "@/lib/vars";
import { payer, connection } from "@/lib/vars";
import { explorerURL, printConsoleSeparator } from "@/lib/helpers";

//
Expand All @@ -21,7 +21,6 @@ import {
//////////////////////////////////////////////////////////////////////////////

console.log("Payer address:", payer.publicKey.toBase58());
console.log("Test wallet address:", testWallet.publicKey.toBase58());

//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -91,7 +90,7 @@ import {
// console.log("tx before signing:", tx);

// sign the transaction with our needed Signers (e.g. `payer` and `keypair`)
tx.sign([payer]);
tx.sign([payer, keypair]);

console.log("tx after signing:", tx);

Expand All @@ -102,20 +101,6 @@ import {
// actually send the transaction
const sig = await connection.sendTransaction(tx);

const subId = connection.onSignatureWithOptions(
sig,
val => {
console.log("onSignature: triggered");
console.log(val);
},
{
commitment: "processed",
// enableReceivedNotification: true,
},
);

// await connection.on(subId);

/**
* display some helper text
*/
Expand Down
4 changes: 2 additions & 2 deletions quest-1/scripts/2.complexTransaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@ import { SystemProgram, TransactionMessage, VersionedTransaction } from "@solana
payerKey: payer.publicKey,
recentBlockhash,
instructions: [
// create the test wallet's account on chain
createTestAccountIx,
// transfer lamports to the static wallet
transferToStaticWalletIx,
// transfer lamports to the test wallet
transferToTestWalletIx,
// create the test wallet's account on chain
createTestAccountIx,
// transfer lamports to the static wallet
transferToStaticWalletIx,
],
Expand Down

0 comments on commit ec52d20

Please sign in to comment.