-
Notifications
You must be signed in to change notification settings - Fork 670
/
reward_validator_tx.go
56 lines (44 loc) · 1.66 KB
/
reward_validator_tx.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.
package txs
import (
"github.com/ava-labs/avalanchego/ids"
"github.com/ava-labs/avalanchego/snow"
"github.com/ava-labs/avalanchego/utils/set"
"github.com/ava-labs/avalanchego/vms/components/avax"
)
var _ UnsignedTx = (*RewardValidatorTx)(nil)
// RewardValidatorTx is a transaction that represents a proposal to
// remove a validator that is currently validating from the validator set.
//
// If this transaction is accepted and the next block accepted is a Commit
// block, the validator is removed and the address that the validator specified
// receives the staked AVAX as well as a validating reward.
//
// If this transaction is accepted and the next block accepted is an Abort
// block, the validator is removed and the address that the validator specified
// receives the staked AVAX but no reward.
type RewardValidatorTx struct {
// ID of the tx that created the delegator/validator being removed/rewarded
TxID ids.ID `serialize:"true" json:"txID"`
unsignedBytes []byte // Unsigned byte representation of this data
}
func (tx *RewardValidatorTx) SetBytes(unsignedBytes []byte) {
tx.unsignedBytes = unsignedBytes
}
func (*RewardValidatorTx) InitCtx(*snow.Context) {}
func (tx *RewardValidatorTx) Bytes() []byte {
return tx.unsignedBytes
}
func (*RewardValidatorTx) InputIDs() set.Set[ids.ID] {
return nil
}
func (*RewardValidatorTx) Outputs() []*avax.TransferableOutput {
return nil
}
func (*RewardValidatorTx) SyntacticVerify(*snow.Context) error {
return nil
}
func (tx *RewardValidatorTx) Visit(visitor Visitor) error {
return visitor.RewardValidatorTx(tx)
}