-
Notifications
You must be signed in to change notification settings - Fork 29
/
types.go
38 lines (28 loc) · 1003 Bytes
/
types.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
package registration
import (
"context"
"github.com/0chain/gosdk/zmagmacore/magmasc"
)
type (
// Node represent bandwidth-marketplace node that can be registered.
Node interface {
// RegistrationFuncName returns name of magma sc function used for registration Node.
RegistrationFuncName() string
// UpdateNodeFuncName returns name of magma sc function used for updating Node.
UpdateNodeFuncName() string
// IsNodeRegisteredRP returns name of magma sc relative path for checking registration of Node.
IsNodeRegisteredRP() string
// ExternalID returns external ID of Node
ExternalID() string
// Encode encodes Node in json bytes.
Encode() []byte
}
// executeSmartContract represent types for functions that executes sc functions.
executeSmartContract func(ctx context.Context, node Node) (string, error)
)
var (
// Ensure Consumer implements interface.
_ Node = (*magmasc.Consumer)(nil)
// Ensure Provider implements interface.
_ Node = (*magmasc.Provider)(nil)
)