# Class: ProgramTestContext
The result of calling start()
.
Contains a BanksClient, a recent blockhash and a funded payer keypair.
# Table of contents
# Constructors
# Properties
# Accessors
# Methods
# Constructors
# constructor
• new ProgramTestContext(inner
)
# Parameters
Name | Type |
---|---|
inner | ProgramTestContext |
# Defined in
index.ts:419 (opens new window)
# Properties
# inner
• Private
inner: ProgramTestContext
# Defined in
index.ts:422 (opens new window)
# Accessors
# banksClient
• get
banksClient(): BanksClient
The client for this test.
# Returns
# Defined in
index.ts:424 (opens new window)
# genesisConfig
• get
genesisConfig(): GenesisConfig
The chain's genesis config.
# Returns
# Defined in
index.ts:436 (opens new window)
# lastBlockhash
• get
lastBlockhash(): string
The last blockhash registered when the client was initialized.
# Returns
string
# Defined in
index.ts:432 (opens new window)
# payer
• get
payer(): Keypair
A funded keypair for sending transactions.
# Returns
Keypair
# Defined in
index.ts:428 (opens new window)
# Methods
# setAccount
▸ setAccount(address
, account
): void
Create or overwrite an account, subverting normal runtime checks.
This method exists to make it easier to set up artificial situations that would be difficult to replicate by sending individual transactions. Beware that it can be used to create states that would not be reachable by sending transactions!
# Parameters
Name | Type | Description |
---|---|---|
address | PublicKey | The address to write to. |
account | AccountInfoBytes | The account object to write. |
# Returns
void
# Defined in
index.ts:450 (opens new window)
# setClock
▸ setClock(clock
): void
Overwrite the clock sysvar.
# Parameters
Name | Type | Description |
---|---|---|
clock | Clock | The new clock object. |
# Returns
void
# Defined in
index.ts:457 (opens new window)
# setRent
▸ setRent(rent
): void
Overwrite the rent sysvar.
# Parameters
Name | Type | Description |
---|---|---|
rent | Rent | The new rent object. |
# Returns
void
# Defined in
index.ts:464 (opens new window)
# warpToEpoch
▸ warpToEpoch(epoch
): void
Force the working bank ahead to a new epoch.
# Parameters
Name | Type | Description |
---|---|---|
epoch | bigint | The epoch to warp to. |
# Returns
void
# Defined in
index.ts:478 (opens new window)
# warpToSlot
▸ warpToSlot(slot
): void
Force the working bank ahead to a new slot.
# Parameters
Name | Type | Description |
---|---|---|
slot | bigint | The slot to warp to. |
# Returns
void