Skip to content

Commit

Permalink
miscellaneous gauntlet deployment fixes (#97)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
aalu1418 authored Jan 12, 2022
1 parent 67b1c13 commit 33b3281
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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!)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}
`)
Expand Down
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -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,
Expand Down Expand Up @@ -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 || ''
Expand All @@ -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,
Expand Down

0 comments on commit 33b3281

Please sign in to comment.