forked from ava-labs/avalanchego
-
Notifications
You must be signed in to change notification settings - Fork 3
/
staker_tx.go
56 lines (45 loc) · 1.22 KB
/
staker_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-2023, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.
package txs
import (
"time"
"github.com/MetalBlockchain/metalgo/ids"
"github.com/MetalBlockchain/metalgo/utils/crypto/bls"
"github.com/MetalBlockchain/metalgo/vms/components/avax"
"github.com/MetalBlockchain/metalgo/vms/platformvm/fx"
)
// ValidatorTx defines the interface for a validator transaction that supports
// delegation.
type ValidatorTx interface {
UnsignedTx
PermissionlessStaker
ValidationRewardsOwner() fx.Owner
DelegationRewardsOwner() fx.Owner
Shares() uint32
}
type DelegatorTx interface {
UnsignedTx
PermissionlessStaker
RewardsOwner() fx.Owner
}
type StakerTx interface {
UnsignedTx
Staker
}
type PermissionlessStaker interface {
Staker
Outputs() []*avax.TransferableOutput
Stake() []*avax.TransferableOutput
}
type Staker interface {
SubnetID() ids.ID
NodeID() ids.NodeID
// PublicKey returns the BLS public key registered by this transaction. If
// there was no key registered by this transaction, it will return false.
PublicKey() (*bls.PublicKey, bool, error)
StartTime() time.Time
EndTime() time.Time
Weight() uint64
PendingPriority() Priority
CurrentPriority() Priority
}