fix: finalize tx need to have rent sysvar (#506)
This commit is contained in:
parent
5492ef7fa2
commit
7038468edb
|
@ -162,6 +162,9 @@ declare module '@solana/web3.js' {
|
|||
static fromConfigData(buffer: Buffer): ?ValidatorInfo;
|
||||
}
|
||||
|
||||
// === src/sysvar-rent.js ===
|
||||
declare export var SYSVAR_RENT_PUBKEY;
|
||||
|
||||
// === src/vote-account.js ===
|
||||
declare export var VOTE_ACCOUNT_KEY;
|
||||
declare export type Lockout = {|
|
||||
|
|
|
@ -9,6 +9,7 @@ export {SystemInstruction, SystemProgram} from './system-program';
|
|||
export {Transaction, TransactionInstruction} from './transaction';
|
||||
export {VALIDATOR_INFO_KEY, ValidatorInfo} from './validator-info';
|
||||
export {VOTE_ACCOUNT_KEY, VoteAccount} from './vote-account';
|
||||
export {SYSVAR_RENT_PUBKEY} from './sysvar-rent';
|
||||
export {sendAndConfirmTransaction} from './util/send-and-confirm-transaction';
|
||||
export {
|
||||
sendAndConfirmRawTransaction,
|
||||
|
|
|
@ -6,6 +6,7 @@ import {Account} from './account';
|
|||
import {PublicKey} from './publickey';
|
||||
import {NUM_TICKS_PER_SECOND} from './timing';
|
||||
import {Transaction, PACKET_DATA_SIZE} from './transaction';
|
||||
import {SYSVAR_RENT_PUBKEY} from './sysvar-rent';
|
||||
import {sendAndConfirmTransaction} from './util/send-and-confirm-transaction';
|
||||
import {sleep} from './util/sleep';
|
||||
import type {Connection} from './connection';
|
||||
|
@ -123,7 +124,10 @@ export class Loader {
|
|||
);
|
||||
|
||||
const transaction = new Transaction().add({
|
||||
keys: [{pubkey: program.publicKey, isSigner: true, isDebitable: true}],
|
||||
keys: [
|
||||
{pubkey: program.publicKey, isSigner: true, isDebitable: true},
|
||||
{pubkey: SYSVAR_RENT_PUBKEY, isSigner: false, isDebitable: false}
|
||||
],
|
||||
programId,
|
||||
data,
|
||||
});
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
// @flow
|
||||
import {PublicKey} from './publickey';
|
||||
|
||||
export const SYSVAR_RENT_PUBKEY = new PublicKey(
|
||||
'SysvarRent111111111111111111111111111111111',
|
||||
);
|
Loading…
Reference in New Issue