@@ -43,6 +43,7 @@ type Config struct {
43
43
// Default account to use when running tests and running setup
44
44
DefaultAccount Account `yaml:"default_account"`
45
45
AdditionalAccounts AdditionalAccounts `yaml:"additional_accounts"`
46
+ PolicyAccounts PolicyAccounts `yaml:"policy_accounts"`
46
47
RPCs RPCs `yaml:"rpcs"`
47
48
Contracts Contracts `yaml:"contracts"`
48
49
ZetaChainID string `yaml:"zeta_chain_id"`
@@ -57,14 +58,19 @@ type Account struct {
57
58
58
59
// AdditionalAccounts are extra accounts required to run specific tests
59
60
type AdditionalAccounts struct {
60
- UserERC20 Account `yaml:"user_erc20"`
61
- UserZetaTest Account `yaml:"user_zeta_test"`
62
- UserZEVMMPTest Account `yaml:"user_zevm_mp_test"`
63
- UserBitcoin Account `yaml:"user_bitcoin"`
64
- UserEther Account `yaml:"user_ether"`
65
- UserMisc Account `yaml:"user_misc"`
66
- UserAdmin Account `yaml:"user_admin"`
67
- UserFungibleAdmin Account `yaml:"user_fungible_admin"`
61
+ UserERC20 Account `yaml:"user_erc20"`
62
+ UserZetaTest Account `yaml:"user_zeta_test"`
63
+ UserZEVMMPTest Account `yaml:"user_zevm_mp_test"`
64
+ UserBitcoin Account `yaml:"user_bitcoin"`
65
+ UserEther Account `yaml:"user_ether"`
66
+ UserMisc Account `yaml:"user_misc"`
67
+ UserAdmin Account `yaml:"user_admin"`
68
+ }
69
+
70
+ type PolicyAccounts struct {
71
+ EmergencyPolicyAccount Account `yaml:"emergency_policy_account"`
72
+ OperationalPolicyAccount Account `yaml:"operational_policy_account"`
73
+ AdminPolicyAccount Account `yaml:"admin_policy_account"`
68
74
}
69
75
70
76
// RPCs contains the configuration for the RPC endpoints
@@ -192,7 +198,14 @@ func (a AdditionalAccounts) AsSlice() []Account {
192
198
a .UserEther ,
193
199
a .UserMisc ,
194
200
a .UserAdmin ,
195
- a .UserFungibleAdmin ,
201
+ }
202
+ }
203
+
204
+ func (a PolicyAccounts ) AsSlice () []Account {
205
+ return []Account {
206
+ a .EmergencyPolicyAccount ,
207
+ a .OperationalPolicyAccount ,
208
+ a .AdminPolicyAccount ,
196
209
}
197
210
}
198
211
@@ -216,9 +229,21 @@ func (c Config) Validate() error {
216
229
}
217
230
err := account .Validate ()
218
231
if err != nil {
219
- return fmt .Errorf ("validating account %d: %w" , i , err )
232
+ return fmt .Errorf ("validating additional account %d: %w" , i , err )
220
233
}
221
234
}
235
+
236
+ policyAccounts := c .PolicyAccounts .AsSlice ()
237
+ for i , account := range policyAccounts {
238
+ if account .RawEVMAddress == "" {
239
+ continue
240
+ }
241
+ err := account .Validate ()
242
+ if err != nil {
243
+ return fmt .Errorf ("validating policy account %d: %w" , i , err )
244
+ }
245
+ }
246
+
222
247
return nil
223
248
}
224
249
@@ -257,7 +282,15 @@ func (c *Config) GenerateKeys() error {
257
282
if err != nil {
258
283
return err
259
284
}
260
- c .AdditionalAccounts .UserFungibleAdmin , err = generateAccount ()
285
+ c .PolicyAccounts .EmergencyPolicyAccount , err = generateAccount ()
286
+ if err != nil {
287
+ return err
288
+ }
289
+ c .PolicyAccounts .OperationalPolicyAccount , err = generateAccount ()
290
+ if err != nil {
291
+ return err
292
+ }
293
+ c .PolicyAccounts .AdminPolicyAccount , err = generateAccount ()
261
294
if err != nil {
262
295
return err
263
296
}
0 commit comments