From 33b32814de74eacdd5a846fc6de1ca0bf802f7cd Mon Sep 17 00:00:00 2001 From: Aaron Lu <50029043+aalu1418@users.noreply.github.com> Date: Wed, 12 Jan 2022 09:49:40 -0500 Subject: [PATCH] miscellaneous gauntlet deployment fixes (#97) * miscellaneous gauntlet deployment fixes * prettier * make total length of feed storage configurable * fix: payee is the associated token address, add logging for historical length * prettier * remove unused parameter --- .../src/commands/abstract/index.ts | 1 + .../src/commands/contracts/ocr2/initialize.ts | 1 + .../src/commands/contracts/store/createFeed.ts | 12 +++++++++--- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/abstract/index.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/abstract/index.ts index 540ebbfa5..9008e4d58 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/abstract/index.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/abstract/index.ts @@ -120,6 +120,7 @@ export default class GeneratorCommand extends SolanaCommand { !!walletBalance && SolanaCommand.lamportsToSol(walletBalance.lamports) }`, ) + logger.warn('Gauntlet deploying does not support upgradeable programs. Use the Solana CLI if this is required.') await prompt(`Deployment cost is ${SolanaCommand.lamportsToSol(balanceRequired)} SOL, continue?`) logger.loading(`Deploying ${this.opts.contract.id}...`) const tx = await this.deploy(this.opts.contract.bytecode!, this.opts.contract.programKeypair!) diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/initialize.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/initialize.ts index 3e358123a..44ba6f84a 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/initialize.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/initialize.ts @@ -111,6 +111,7 @@ export default class Initialize extends SolanaCommand { STATE ACCOUNTS: - State: ${state.publicKey} - Transmissions: ${transmissions} + - StoreAuthority: ${storeAuthority.toString()} - Payer: ${this.provider.wallet.publicKey} - Owner: ${owner.publicKey} `) diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/store/createFeed.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/store/createFeed.ts index 1ed4730f5..e71d1f8d2 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/store/createFeed.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/store/createFeed.ts @@ -1,5 +1,5 @@ import { Result } from '@chainlink/gauntlet-core' -import { logger, BN } from '@chainlink/gauntlet-core/dist/utils' +import { logger, BN, prompt } from '@chainlink/gauntlet-core/dist/utils' import { SolanaCommand, TransactionResponse } from '@chainlink/gauntlet-solana' import { Keypair, PublicKey } from '@solana/web3.js' import { CONTRACT_LIST, getContract } from '../../../lib/contracts' @@ -26,7 +26,7 @@ export default class CreateFeed extends SolanaCommand { const rdd = getRDD(this.flags.rdd) const aggregator = rdd.contracts[this.flags.state] return { - store: aggregator.store, + store: aggregator.storeAccount, granularity: this.flags.granularity, liveLength: this.flags.liveLength, decimals: aggregator.decimals, @@ -54,7 +54,7 @@ export default class CreateFeed extends SolanaCommand { const granularity = new BN(input.granularity) const liveLength = new BN(input.liveLength) - const length = new BN(8096) + const length = new BN(this.flags.length || 8096) const feedAccountLength = new BN(8 + 128 + length.toNumber() * 24) const decimals = new BN(input.decimals) const description = input.description || '' @@ -69,8 +69,14 @@ export default class CreateFeed extends SolanaCommand { console.log(` - Decimals: ${decimals} - Description: ${description} + - Live Length: ${liveLength.toNumber()} + - Granularity (historical): ${granularity.toNumber()} + - Historical Length: ${length.toNumber() - liveLength.toNumber()} + - Total Length: ${length.toNumber()} `) + await prompt('Continue creating new OCR 2 feed?') + const tx = await program.rpc.createFeed(description, decimals, granularity, liveLength, { accounts: { store: store,