chore: npm run pretty
This commit is contained in:
@ -49,7 +49,9 @@ declare module '@solana/web3.js' {
|
|||||||
};
|
};
|
||||||
|
|
||||||
declare type AccountChangeCallback = (accountInfo: AccountInfo) => void;
|
declare type AccountChangeCallback = (accountInfo: AccountInfo) => void;
|
||||||
declare type ProgramAccountChangeCallback = (keyedAccountInfo: KeyedAccountInfo) => void;
|
declare type ProgramAccountChangeCallback = (
|
||||||
|
keyedAccountInfo: KeyedAccountInfo,
|
||||||
|
) => void;
|
||||||
|
|
||||||
declare export type SignatureStatus =
|
declare export type SignatureStatus =
|
||||||
| 'Confirmed'
|
| 'Confirmed'
|
||||||
|
@ -325,9 +325,7 @@ export class BudgetProgram {
|
|||||||
program: PublicKey,
|
program: PublicKey,
|
||||||
to: PublicKey,
|
to: PublicKey,
|
||||||
): Transaction {
|
): Transaction {
|
||||||
const dataLayout = BufferLayout.struct([
|
const dataLayout = BufferLayout.struct([BufferLayout.u32('instruction')]);
|
||||||
BufferLayout.u32('instruction'),
|
|
||||||
]);
|
|
||||||
|
|
||||||
const data = Buffer.alloc(dataLayout.span);
|
const data = Buffer.alloc(dataLayout.span);
|
||||||
dataLayout.encode(
|
dataLayout.encode(
|
||||||
|
@ -108,9 +108,7 @@ export class Loader {
|
|||||||
* @param program `load()`ed Account
|
* @param program `load()`ed Account
|
||||||
*/
|
*/
|
||||||
async finalize(program: Account) {
|
async finalize(program: Account) {
|
||||||
const dataLayout = BufferLayout.struct([
|
const dataLayout = BufferLayout.struct([BufferLayout.u32('instruction')]);
|
||||||
BufferLayout.u32('instruction'),
|
|
||||||
]);
|
|
||||||
|
|
||||||
const data = Buffer.alloc(dataLayout.span);
|
const data = Buffer.alloc(dataLayout.span);
|
||||||
dataLayout.encode(
|
dataLayout.encode(
|
||||||
|
@ -263,9 +263,7 @@ export class Token {
|
|||||||
const tokenAccount = new Account();
|
const tokenAccount = new Account();
|
||||||
let transaction;
|
let transaction;
|
||||||
|
|
||||||
const dataLayout = BufferLayout.struct([
|
const dataLayout = BufferLayout.struct([BufferLayout.u32('instruction')]);
|
||||||
BufferLayout.u32('instruction'),
|
|
||||||
]);
|
|
||||||
|
|
||||||
const data = Buffer.alloc(dataLayout.span);
|
const data = Buffer.alloc(dataLayout.span);
|
||||||
dataLayout.encode(
|
dataLayout.encode(
|
||||||
@ -555,9 +553,7 @@ export class Token {
|
|||||||
account: PublicKey,
|
account: PublicKey,
|
||||||
newOwner: PublicKey,
|
newOwner: PublicKey,
|
||||||
): TransactionInstruction {
|
): TransactionInstruction {
|
||||||
const dataLayout = BufferLayout.struct([
|
const dataLayout = BufferLayout.struct([BufferLayout.u32('instruction')]);
|
||||||
BufferLayout.u32('instruction'),
|
|
||||||
]);
|
|
||||||
|
|
||||||
const data = Buffer.alloc(dataLayout.span);
|
const data = Buffer.alloc(dataLayout.span);
|
||||||
dataLayout.encode(
|
dataLayout.encode(
|
||||||
|
@ -472,9 +472,7 @@ test('account change notification', async () => {
|
|||||||
expect(mockCallback.mock.calls[0][0].lamports).toBe(41);
|
expect(mockCallback.mock.calls[0][0].lamports).toBe(41);
|
||||||
expect(mockCallback.mock.calls[0][0].owner).toEqual(BpfLoader.programId);
|
expect(mockCallback.mock.calls[0][0].owner).toEqual(BpfLoader.programId);
|
||||||
expect(mockCallback.mock.calls[0][0].executable).toBe(false);
|
expect(mockCallback.mock.calls[0][0].executable).toBe(false);
|
||||||
expect(mockCallback.mock.calls[0][0].data).toEqual(
|
expect(mockCallback.mock.calls[0][0].data).toEqual(Buffer.from([1, 2, 3]));
|
||||||
Buffer.from([1, 2, 3]),
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
test('program account change notification', async () => {
|
test('program account change notification', async () => {
|
||||||
|
Reference in New Issue
Block a user