crank pop params
This commit is contained in:
parent
c9cdb058c5
commit
1d1b0da1f2
|
@ -313,10 +313,11 @@ export class CrankAccount extends Account<types.CrankAccountData> {
|
|||
payer: PublicKey,
|
||||
params: {
|
||||
payoutTokenWallet: PublicKey;
|
||||
crank: types.CrankAccountData;
|
||||
crankRows: Array<types.CrankRow>;
|
||||
queueAccount: QueueAccount;
|
||||
queue: types.OracleQueueAccountData;
|
||||
|
||||
queuePubkey: PublicKey;
|
||||
queueAuthority: PublicKey;
|
||||
queueDataBuffer: PublicKey;
|
||||
crankDataBuffer: PublicKey;
|
||||
|
||||
remainingAccounts: Array<PublicKey>;
|
||||
leaseBumps: Map<string, number>;
|
||||
|
@ -353,13 +354,13 @@ export class CrankAccount extends Account<types.CrankAccountData> {
|
|||
},
|
||||
{
|
||||
crank: this.publicKey,
|
||||
oracleQueue: params.queueAccount.publicKey,
|
||||
queueAuthority: params.queue.authority,
|
||||
oracleQueue: params.queuePubkey,
|
||||
queueAuthority: params.queueAuthority,
|
||||
programState: this.program.programState.publicKey,
|
||||
payoutWallet: params.payoutTokenWallet,
|
||||
tokenProgram: TOKEN_PROGRAM_ID,
|
||||
crankDataBuffer: params.crank.dataBuffer,
|
||||
queueDataBuffer: params.queue.dataBuffer,
|
||||
crankDataBuffer: params.crankDataBuffer,
|
||||
queueDataBuffer: params.queueDataBuffer,
|
||||
mint: this.program.mint.address,
|
||||
}
|
||||
);
|
||||
|
@ -377,10 +378,12 @@ export class CrankAccount extends Account<types.CrankAccountData> {
|
|||
payer: PublicKey,
|
||||
params: {
|
||||
payoutTokenWallet: PublicKey;
|
||||
crank: types.CrankAccountData;
|
||||
crankRows: Array<types.CrankRow>;
|
||||
queueAccount: QueueAccount;
|
||||
queue: types.OracleQueueAccountData;
|
||||
|
||||
queuePubkey: PublicKey;
|
||||
queueAuthority: PublicKey;
|
||||
queueDataBuffer: PublicKey;
|
||||
crankDataBuffer: PublicKey;
|
||||
|
||||
readyAggregators: Array<[AggregatorAccount, AggregatorPdaAccounts]>;
|
||||
|
||||
nonce?: number;
|
||||
|
@ -466,10 +469,12 @@ export class CrankAccount extends Account<types.CrankAccountData> {
|
|||
payer: PublicKey,
|
||||
params: {
|
||||
payoutTokenWallet: PublicKey;
|
||||
crank: types.CrankAccountData;
|
||||
crankRows: Array<types.CrankRow>;
|
||||
queueAccount: QueueAccount;
|
||||
queue: types.OracleQueueAccountData;
|
||||
|
||||
queuePubkey: PublicKey;
|
||||
queueAuthority: PublicKey;
|
||||
queueDataBuffer: PublicKey;
|
||||
crankDataBuffer: PublicKey;
|
||||
|
||||
readyAggregators: Array<[AggregatorAccount, AggregatorPdaAccounts]>;
|
||||
|
||||
nonce?: number;
|
||||
|
@ -510,10 +515,12 @@ export class CrankAccount extends Account<types.CrankAccountData> {
|
|||
public async packAndPop(
|
||||
params: {
|
||||
payoutTokenWallet: PublicKey;
|
||||
crank: types.CrankAccountData;
|
||||
crankRows: Array<types.CrankRow>;
|
||||
queueAccount: QueueAccount;
|
||||
queue: types.OracleQueueAccountData;
|
||||
|
||||
queuePubkey: PublicKey;
|
||||
queueAuthority: PublicKey;
|
||||
queueDataBuffer: PublicKey;
|
||||
crankDataBuffer: PublicKey;
|
||||
|
||||
readyAggregators: Array<[AggregatorAccount, AggregatorPdaAccounts]>;
|
||||
|
||||
nonce?: number;
|
||||
|
|
|
@ -166,6 +166,8 @@ describe('Crank Tests', () => {
|
|||
return (await SolanaClock.fetch(ctx.program.connection)).unixTimestamp;
|
||||
};
|
||||
|
||||
const crank = await crankAccount.loadData();
|
||||
|
||||
let timestamp = await getTimestamp();
|
||||
|
||||
const nextAvailable = (await crankAccount.loadCrank()).reduce(
|
||||
|
@ -225,10 +227,12 @@ describe('Crank Tests', () => {
|
|||
ctx.payer.publicKey,
|
||||
{
|
||||
payoutTokenWallet: userTokenAddress,
|
||||
crank: await crankAccount.loadData(),
|
||||
crankRows: initialCrankRows,
|
||||
queueAccount,
|
||||
queue,
|
||||
|
||||
queuePubkey: queueAccount.publicKey,
|
||||
queueAuthority: queue.authority,
|
||||
queueDataBuffer: queue.dataBuffer,
|
||||
crankDataBuffer: crank.dataBuffer,
|
||||
|
||||
readyAggregators: readyAggregators,
|
||||
failOpenOnMismatch: true,
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue