mirror of
https://github.com/luxfi/proto.git
synced 2026-10-30 15:21:09 +00:00
- Rename InitCtx → InitRuntime throughout - Update imports for new package versions - Update utxo/secp256k1fx usage - Update consensus context references
47 lines
1.1 KiB
Go
47 lines
1.1 KiB
Go
// Copyright (C) 2019-2025, Lux Industries, Inc. All rights reserved.
|
|
// See the file LICENSE for licensing terms.
|
|
|
|
package txs
|
|
|
|
import (
|
|
"github.com/luxfi/runtime"
|
|
|
|
"github.com/luxfi/ids"
|
|
"github.com/luxfi/vm/components/verify"
|
|
)
|
|
|
|
var _ UnsignedTx = (*DisableL1ValidatorTx)(nil)
|
|
|
|
type DisableL1ValidatorTx struct {
|
|
// Metadata, inputs and outputs
|
|
BaseTx `serialize:"true"`
|
|
// ID corresponding to the validator
|
|
ValidationID ids.ID `serialize:"true" json:"validationID"`
|
|
// Authorizes this validator to be disabled
|
|
DisableAuth verify.Verifiable `serialize:"true" json:"disableAuthorization"`
|
|
}
|
|
|
|
func (tx *DisableL1ValidatorTx) SyntacticVerify(rt *runtime.Runtime) error {
|
|
switch {
|
|
case tx == nil:
|
|
return ErrNilTx
|
|
case tx.SyntacticallyVerified:
|
|
// already passed syntactic verification
|
|
return nil
|
|
}
|
|
|
|
if err := tx.BaseTx.SyntacticVerify(rt); err != nil {
|
|
return err
|
|
}
|
|
if err := tx.DisableAuth.Verify(); err != nil {
|
|
return err
|
|
}
|
|
|
|
tx.SyntacticallyVerified = true
|
|
return nil
|
|
}
|
|
|
|
func (tx *DisableL1ValidatorTx) Visit(visitor Visitor) error {
|
|
return visitor.DisableL1ValidatorTx(tx)
|
|
}
|