Skip to content

Commit 4a6d4e4

Browse files
review: add inline docs for NewConfigurer and SetConfig
1 parent 83d08b3 commit 4a6d4e4

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

sdk/solana/configurer.go

+14-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ type Configurer struct {
2828
}
2929

3030
// NewConfigurer creates a new Configurer for Solana chains.
31+
//
32+
// options:
33+
//
34+
// WithDoNotSendInstructionsOnChain: when selected, the Configurer instance will not
35+
// send the Solana instructions to the blockchain.
3136
func NewConfigurer(
3237
client *rpc.Client, auth solana.PrivateKey, chainSelector types.ChainSelector, options ...configurerOption,
3338
) *Configurer {
@@ -53,7 +58,15 @@ func WithDoNotSendInstructionsOnChain() configurerOption {
5358
}
5459

5560
// SetConfig sets the configuration for the MCM contract on the Solana chain.
56-
func (c *Configurer) SetConfig(ctx context.Context, mcmAddress string, cfg *types.Config, clearRoot bool) (types.TransactionResult, error) {
61+
//
62+
// The list of instructions needed to set the configuration is returned in the
63+
// `RawData` field. And if the instructions were sent on chain (which they are
64+
// unless the `WithDoNotSendInstructionsOnChain` option was selected in the
65+
// constructor), the signature of the last instruction is returned in the
66+
// `Hash` field.
67+
func (c *Configurer) SetConfig(
68+
ctx context.Context, mcmAddress string, cfg *types.Config, clearRoot bool,
69+
) (types.TransactionResult, error) {
5770
programID, pdaSeed, err := ParseContractAddress(mcmAddress)
5871
if err != nil {
5972
return types.TransactionResult{}, err

0 commit comments

Comments
 (0)