@@ -26,24 +26,36 @@ func Test_NewConfigurer(t *testing.T) {
26
26
auth := solana .MustPrivateKeyFromBase58 ("DmPfeHBC8Brf8s5qQXi25bmJ996v6BHRtaLc6AH51yFGSqQpUMy1oHkbbXobPNBdgGH2F29PAmoq9ZZua4K9vCc" )
27
27
chainSelector := types .ChainSelector (cselectors .SOLANA_DEVNET .Selector )
28
28
29
+ newAuthorityAccount := solana .NewWallet ().PublicKey ()
30
+
29
31
tests := []struct {
30
- name string
31
- constructorFn func () * Configurer
32
- wantSkipTransaction bool
32
+ name string
33
+ constructorFn func () * Configurer
34
+ wantSkipTransaction bool
35
+ wantAuthorityAccount solana.PublicKey
33
36
}{
34
37
{
35
38
name : "standard args" ,
36
39
constructorFn : func () * Configurer {
37
40
return NewConfigurer (client , auth , chainSelector )
38
41
},
39
- wantSkipTransaction : false ,
42
+ wantSkipTransaction : false ,
43
+ wantAuthorityAccount : auth .PublicKey (),
40
44
},
41
45
{
42
46
name : "skip transaction option" ,
43
47
constructorFn : func () * Configurer {
44
48
return NewConfigurer (client , auth , chainSelector , WithDoNotSendInstructionsOnChain ())
45
49
},
46
- wantSkipTransaction : true ,
50
+ wantSkipTransaction : true ,
51
+ wantAuthorityAccount : auth .PublicKey (),
52
+ },
53
+ {
54
+ name : "override authorityAccount" ,
55
+ constructorFn : func () * Configurer {
56
+ return NewConfigurer (client , auth , chainSelector , WithAuthorityAccount (newAuthorityAccount ))
57
+ },
58
+ wantAuthorityAccount : newAuthorityAccount ,
47
59
},
48
60
}
49
61
@@ -54,6 +66,7 @@ func Test_NewConfigurer(t *testing.T) {
54
66
55
67
require .NotNil (t , configurer )
56
68
require .Equal (t , tt .wantSkipTransaction , configurer .skipSend )
69
+ require .Equal (t , tt .wantAuthorityAccount , configurer .authorityAccount )
57
70
})
58
71
}
59
72
}
@@ -67,6 +80,7 @@ func TestConfigurer_SetConfig(t *testing.T) {
67
80
require .NoError (t , err )
68
81
defaultMcmConfig := & types.Config {Quorum : 1 , Signers : []common.Address {common .HexToAddress ("0x1" )}}
69
82
clearRoot := false
83
+ newAuthorityAccount := solana .NewWallet ().PublicKey ()
70
84
71
85
tests := []struct {
72
86
name string
@@ -118,6 +132,20 @@ func TestConfigurer_SetConfig(t *testing.T) {
118
132
bindings .NewSetConfigInstructionBuilder ().Build (),
119
133
},
120
134
},
135
+ {
136
+ name : "success - override authorityAccount acciybt" ,
137
+ auth : auth ,
138
+ options : []configurerOption {WithDoNotSendInstructionsOnChain (), WithAuthorityAccount (newAuthorityAccount )},
139
+ mcmConfig : defaultMcmConfig ,
140
+ setup : func (t * testing.T , configurer * Configurer , mockJSONRPCClient * mocks.JSONRPCClient ) { t .Helper () },
141
+ wantHash : "" ,
142
+ wantInstructions : []solana.Instruction {
143
+ bindings .NewInitSignersInstructionBuilder ().Build (),
144
+ bindings .NewAppendSignersInstructionBuilder ().Build (),
145
+ bindings .NewFinalizeSignersInstructionBuilder ().Build (),
146
+ bindings .NewSetConfigInstructionBuilder ().Build (),
147
+ },
148
+ },
121
149
{
122
150
name : "failure: too many signers" ,
123
151
auth : auth ,
0 commit comments