-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add example changeset to transfer from timelock signer account #16476
Conversation
AER Report: CI Core ran successfully ✅AER Report: Operator UI CI ran successfully ✅ |
deployment/common/changeset/example/solana_transfer_mcm_test.go
Outdated
Show resolved
Hide resolved
|
||
config := proposalutils.SingleGroupTimelockConfigV2(t) | ||
testhelpers.SavePreloadedSolAddresses(t, env, chainSelector) | ||
// Initialize the address book with a dummy address to avoid deploy precondition errors. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not 100% sure it's the same error I had, but if it is, I think we should avoid it by incorporating this change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes it's the same error, I'll keep it here in the meantime while we merge your PR. Just re approved!
deployment/common/changeset/example/solana_transfer_mcm_test.go
Outdated
Show resolved
Hide resolved
deployment/common/changeset/example/solana_transfer_mcm_test.go
Outdated
Show resolved
Hide resolved
deployment/common/changeset/example/solana_transfer_mcm_test.go
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a few comments, but nothing critical.
I must say, though, that I don't quite get the point of this example. Is there a use case for transferring funds from the timelock signer pda?
Not really, this example will be used more in the context of using the chainlink deployments framework so a user can have a instructions to sign and then call set root / execute via CLD and then easily check their balance to confirm the fund arrived to their account. It's more for "didactic" purposes |
I see, thanks for the context. I'll just throw my $0.02c -- just fyi, no action needed. I find that the external_program_cpi_stub program is great for this type of didactic test/example. I was able to experiment and validate quite a bit of logic in the mcms e2e tests thanks to its API, that is tailored for automated tests. |
Thanks Gustavo, yeah I did check on that program, I ended up doing this because using the stub program would mean adding another changeset for deploying it and another migration on the tutorial, making it a bit longer. |
You don't actually need to worry about deploying it. The cpi stub program is predeployed by CTF. Anyways, just something to consider next time. |
|
…16476) * feat: add changeset to transfer from timelock signer account * fix: linting errors * fix: code cleanup * fix: use NewTransactionFromInstruction * fix: cleanup accounts signer set
Adds an example changeset to be used on example guides that will transfer some fund from the timelock signer to the provided account via mcms.
AI Summary
This pull request introduces a new changeset for transferring funds from a timelock signer PDA to a specified address within the Solana blockchain environment. It includes the implementation of the changeset and its corresponding tests, as well as modifications to existing helper functions to support the new functionality.
New Changeset Implementation:
deployment/common/changeset/example/solana_transfer_mcm.go
: Added theTransferFromTimelock
changeset which includes methods to verify preconditions and apply the changeset to transfer funds from the timelock signer PDA to the specified address.Testing:
deployment/common/changeset/example/solana_transfer_mcm_test.go
: Added comprehensive tests for theTransferFromTimelock
changeset, including setup for the testing environment and validation of preconditions and application of the changeset.Helper Function Modifications:
deployment/common/changeset/solana/helpers.go
: Modified theFundFromDeployerKey
function to use a new helper functionFundFromAddressIxs
which creates transfer instructions from a specified address. This change supports the new changeset by enabling fund transfers from the timelock signer PDA.