fix(system-program): add base pubkey to create_account_with_seed
This commit is contained in:
committed by
Michael Vines
parent
0907750fea
commit
e0e3094370
@ -223,6 +223,7 @@ declare module '@solana/web3.js' {
|
||||
static createAccountWithSeed(
|
||||
from: PublicKey,
|
||||
newAccount: PublicKey,
|
||||
base: PublicKey,
|
||||
seed: string,
|
||||
lamports: number,
|
||||
space: number,
|
||||
|
6
web3.js/package-lock.json
generated
6
web3.js/package-lock.json
generated
@ -9720,8 +9720,7 @@
|
||||
"version": "4.2.1",
|
||||
"resolved": "https://registry.npmjs.org/hoek/-/hoek-4.2.1.tgz",
|
||||
"integrity": "sha512-QLg82fGkfnJ/4iy1xZ81/9SIJiq1NGFUMGs6ParyjBZr6jW2Ufj/snDqTHixNlHdPNwN2RLVD0Pi3igeK9+JfA==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
"dev": true
|
||||
},
|
||||
"hook-std": {
|
||||
"version": "2.0.0",
|
||||
@ -9859,8 +9858,7 @@
|
||||
"version": "2.7.0",
|
||||
"resolved": "https://registry.npmjs.org/acorn/-/acorn-2.7.0.tgz",
|
||||
"integrity": "sha1-q259nYhqrKiwhbwzEreaGYQz8Oc=",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
"dev": true
|
||||
},
|
||||
"acorn-globals": {
|
||||
"version": "1.0.9",
|
||||
|
@ -148,6 +148,7 @@ const SystemInstructionLayout = Object.freeze({
|
||||
index: 3,
|
||||
layout: BufferLayout.struct([
|
||||
BufferLayout.u32('instruction'),
|
||||
Layout.publicKey('base'),
|
||||
Layout.rustString('seed'),
|
||||
BufferLayout.ns64('lamports'),
|
||||
BufferLayout.ns64('space'),
|
||||
@ -246,6 +247,7 @@ export class SystemProgram {
|
||||
static createAccountWithSeed(
|
||||
from: PublicKey,
|
||||
newAccount: PublicKey,
|
||||
base: PublicKey,
|
||||
seed: string,
|
||||
lamports: number,
|
||||
space: number,
|
||||
@ -253,6 +255,7 @@ export class SystemProgram {
|
||||
): Transaction {
|
||||
const type = SystemInstructionLayout.CreateWithSeed;
|
||||
const data = encodeData(type, {
|
||||
base: base.toBuffer(),
|
||||
seed,
|
||||
lamports,
|
||||
space,
|
||||
|
@ -58,6 +58,7 @@ test('createAccountWithSeed', () => {
|
||||
transaction = SystemProgram.createAccountWithSeed(
|
||||
from.publicKey,
|
||||
newAccount.publicKey,
|
||||
from.publicKey,
|
||||
'hi there',
|
||||
123,
|
||||
BudgetProgram.space,
|
||||
@ -133,6 +134,7 @@ test('SystemInstruction createWithSeed', () => {
|
||||
const create = SystemProgram.createAccountWithSeed(
|
||||
from.publicKey,
|
||||
to.publicKey,
|
||||
from.publicKey,
|
||||
'hi there',
|
||||
amount,
|
||||
space,
|
||||
|
Reference in New Issue
Block a user