-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathvalidator_test.go
73 lines (58 loc) · 1.83 KB
/
validator_test.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
package http
import (
"testing"
"github.com/stretchr/testify/assert"
consensus "github.com/umbracle/go-eth-consensus"
)
func TestValidatorEndpoint(t *testing.T) {
n := New("http://127.0.0.1:4010", WithUntrackedKeys()).Validator()
t.Run("GetAttesterDuties", func(t *testing.T) {
_, err := n.GetAttesterDuties(1, []string{"1"})
assert.NoError(t, err)
})
t.Run("GetProposerDuties", func(t *testing.T) {
_, err := n.GetProposerDuties(1)
assert.NoError(t, err)
})
t.Run("GetCommitteeSyncDuties", func(t *testing.T) {
_, err := n.GetCommitteeSyncDuties(1, []string{"1"})
assert.NoError(t, err)
})
t.Run("GetBlock", func(t *testing.T) {
t.Skip("due to graffiti")
block := consensus.BeaconBlockAltair{}
err := n.GetBlock(&block, 1, [96]byte{})
assert.NoError(t, err)
})
t.Run("RequestAttestationData", func(t *testing.T) {
_, err := n.RequestAttestationData(1, 1)
assert.NoError(t, err)
})
t.Run("AggregateAttestation", func(t *testing.T) {
_, err := n.AggregateAttestation(1, [32]byte{})
assert.NoError(t, err)
})
t.Run("SyncCommitteeContribution", func(t *testing.T) {
_, err := n.SyncCommitteeContribution(1, 1, [32]byte{})
assert.NoError(t, err)
})
t.Run("BeaconCommitteeSubscriptions", func(t *testing.T) {
err := n.BeaconCommitteeSubscriptions([]*BeaconCommitteeSubscription{{}})
assert.NoError(t, err)
})
t.Run("SyncCommitteeSubscriptions", func(t *testing.T) {
err := n.SyncCommitteeSubscriptions([]*SyncCommitteeSubscription{{}})
assert.NoError(t, err)
})
t.Run("PrepareBeaconProposer", func(t *testing.T) {
err := n.PrepareBeaconProposer([]*ProposalPreparation{{}})
assert.NoError(t, err)
})
t.Run("RegisterValidator", func(t *testing.T) {
obj := []*SignedValidatorRegistration{
{Message: &RegisterValidatorRequest{}},
}
err := n.RegisterValidator(obj)
assert.NoError(t, err)
})
}