Files
proto/p/txs/set_l1_validator_weight_tx.go
zeekay 73a0a922f0 fix: update API to use InitRuntime instead of InitCtx
- Rename InitCtx → InitRuntime throughout
- Update imports for new package versions
- Update utxo/secp256k1fx usage
- Update consensus context references
2026-01-26 09:37:09 -08:00

42 lines
990 B
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/vm/types"
)
var _ UnsignedTx = (*SetL1ValidatorWeightTx)(nil)
type SetL1ValidatorWeightTx struct {
// Metadata, inputs and outputs
BaseTx `serialize:"true"`
// Message is expected to be a signed Warp message containing an
// AddressedCall payload with the SetL1ValidatorWeight message.
Message types.JSONByteSlice `serialize:"true" json:"message"`
}
func (tx *SetL1ValidatorWeightTx) 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
}
tx.SyntacticallyVerified = true
return nil
}
func (tx *SetL1ValidatorWeightTx) Visit(visitor Visitor) error {
return visitor.SetL1ValidatorWeightTx(tx)
}