Skip to content

chore: port solana generate view#49

Merged
ecPablo merged 1 commit intomainfrom
ecpablo/port-sol-gen-view
May 8, 2026
Merged

chore: port solana generate view#49
ecPablo merged 1 commit intomainfrom
ecpablo/port-sol-gen-view

Conversation

@ecPablo
Copy link
Copy Markdown
Contributor

@ecPablo ecPablo commented May 8, 2026

Adds missing GenerateView for solana state loading

@ecPablo ecPablo marked this pull request as ready for review May 8, 2026 16:13
@ecPablo ecPablo requested a review from a team as a code owner May 8, 2026 16:13
Copilot AI review requested due to automatic review settings May 8, 2026 16:13
@ecPablo ecPablo enabled auto-merge (squash) May 8, 2026 16:14
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a Solana GenerateView helper on MCMSWithTimelockPrograms to produce an MCMSWithTimelockViewSolana using the MCMS Solana SDK inspectors, plus a Validate method intended to ensure required state is present.

Changes:

  • Added MCMSWithTimelockPrograms.Validate() to sanity-check loaded Solana program/account keys.
  • Added MCMSWithTimelockPrograms.GenerateView(ctx, chain) to generate an MCMS+Timelock view using on-chain inspectors.
  • Introduced new imports (context and pkg/contract/mcms/view/v1_0) to support view generation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

timelockInspector := mcmssolanasdk.NewTimelockInspector(chain.Client)

return v1_0.GenerateMCMSWithTimelockViewSolana(ctx, inspector, timelockInspector, s.McmProgram,
s.ProposerMcmSeed, s.CancellerMcmSeed, s.BypasserMcmSeed, s.TimelockProgram, s.TimelockSeed)
Comment on lines +39 to +40
// Validate checks that all fields are non-nil, ensuring it's ready
// for use generating views or interactions.
Comment on lines +44 to +47
}
if s.TimelockProgram.IsZero() {
return errors.New("timelock program not found")
}
Comment on lines +39 to +47
// Validate checks that all fields are non-nil, ensuring it's ready
// for use generating views or interactions.
func (s *MCMSWithTimelockPrograms) Validate() error {
if s.McmProgram.IsZero() {
return errors.New("mcm program not found")
}
if s.TimelockProgram.IsZero() {
return errors.New("timelock program not found")
}
@ecPablo ecPablo merged commit c49ce9d into main May 8, 2026
18 checks passed
@ecPablo ecPablo deleted the ecpablo/port-sol-gen-view branch May 8, 2026 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants