@@ -138,10 +138,11 @@ type PermissionlessValidator struct {
138
138
// GenesisPermissionlessValidator should to be used for genesis validators only.
139
139
type GenesisPermissionlessValidator struct {
140
140
GenesisValidator
141
- RewardOwner * Owner `json:"rewardOwner,omitempty"`
142
- DelegationFee json.Float32 `json:"delegationFee"`
143
- ExactDelegationFee * json.Uint32 `json:"exactDelegationFee,omitempty"`
144
- Staked []UTXO `json:"staked,omitempty"`
141
+ RewardOwner * Owner `json:"rewardOwner,omitempty"`
142
+ DelegationFee json.Float32 `json:"delegationFee"`
143
+ ExactDelegationFee * json.Uint32 `json:"exactDelegationFee,omitempty"`
144
+ Staked []UTXO `json:"staked,omitempty"`
145
+ Signer * signer.ProofOfPossession `json:"signer,omitempty"`
145
146
}
146
147
147
148
// PermissionedValidator is the repr. of a permissioned validator sent over APIs.
@@ -315,21 +316,39 @@ func (*StaticService) BuildGenesis(_ *http.Request, args *BuildGenesisArgs, repl
315
316
delegationFee = uint32 (* vdr .ExactDelegationFee )
316
317
}
317
318
318
- tx := & txs. Tx { Unsigned : & txs. AddValidatorTx {
319
- BaseTx : txs.BaseTx {BaseTx : avax.BaseTx {
319
+ var (
320
+ baseTx = txs.BaseTx {BaseTx : avax.BaseTx {
320
321
NetworkID : uint32 (args .NetworkID ),
321
322
BlockchainID : ids .Empty ,
322
- }},
323
- Validator : txs.Validator {
323
+ }}
324
+ validator = txs.Validator {
324
325
NodeID : vdr .NodeID ,
325
326
Start : uint64 (args .Time ),
326
327
End : uint64 (vdr .EndTime ),
327
328
Wght : weight ,
328
- },
329
- StakeOuts : stake ,
330
- RewardsOwner : owner ,
331
- DelegationShares : delegationFee ,
332
- }}
329
+ }
330
+ tx * txs.Tx
331
+ )
332
+ if vdr .Signer == nil {
333
+ tx = & txs.Tx {Unsigned : & txs.AddValidatorTx {
334
+ BaseTx : baseTx ,
335
+ Validator : validator ,
336
+ StakeOuts : stake ,
337
+ RewardsOwner : owner ,
338
+ DelegationShares : delegationFee ,
339
+ }}
340
+ } else {
341
+ tx = & txs.Tx {Unsigned : & txs.AddPermissionlessValidatorTx {
342
+ BaseTx : baseTx ,
343
+ Validator : validator ,
344
+ Signer : vdr .Signer ,
345
+ StakeOuts : stake ,
346
+ ValidatorRewardsOwner : owner ,
347
+ DelegatorRewardsOwner : owner ,
348
+ DelegationShares : delegationFee ,
349
+ }}
350
+ }
351
+
333
352
if err := tx .Initialize (txs .GenesisCodec ); err != nil {
334
353
return err
335
354
}
0 commit comments