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