-
Notifications
You must be signed in to change notification settings - Fork 5
/
bls.go
117 lines (98 loc) · 2.08 KB
/
bls.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
package ast
import "github.com/dipdup-net/go-lib/tools/consts"
//
// bls12_381_fr
//
// BLS12381fr -
type BLS12381fr struct {
Default
}
// NewBLS12381fr -
func NewBLS12381fr(depth int) *BLS12381fr {
return &BLS12381fr{
Default: NewDefault(consts.BLS12381FR, 0, depth),
}
}
// ToJSONSchema -
func (b *BLS12381fr) ToJSONSchema() (*JSONSchema, error) {
return getStringJSONSchema(b.Default), nil
}
// Distinguish -
func (b *BLS12381fr) Distinguish(x Distinguishable) (*MiguelNode, error) {
second, ok := x.(*BLS12381fr)
if !ok {
return nil, nil
}
return b.Default.Distinguish(&second.Default)
}
// FindByName -
func (b *BLS12381fr) FindByName(name string, isEntrypoint bool) Node {
if b.GetName() == name {
return b
}
return nil
}
//
// bls12_381_g1
//
// BLS12381g1 -
type BLS12381g1 struct {
Default
}
// NewBLS12381g1 -
func NewBLS12381g1(depth int) *BLS12381g1 {
return &BLS12381g1{
Default: NewDefault(consts.BLS12381G1, 0, depth),
}
}
// ToJSONSchema -
func (b *BLS12381g1) ToJSONSchema() (*JSONSchema, error) {
return getStringJSONSchema(b.Default), nil
}
// Distinguish -
func (b *BLS12381g1) Distinguish(x Distinguishable) (*MiguelNode, error) {
second, ok := x.(*BLS12381g1)
if !ok {
return nil, nil
}
return b.Default.Distinguish(&second.Default)
}
// FindByName -
func (b *BLS12381g1) FindByName(name string, isEntrypoint bool) Node {
if b.GetName() == name {
return b
}
return nil
}
//
// bls12_381_g2
//
// BLS12381g2 -
type BLS12381g2 struct {
Default
}
// NewBLS12381g2 -
func NewBLS12381g2(depth int) *BLS12381g2 {
return &BLS12381g2{
Default: NewDefault(consts.BLS12381G2, 0, depth),
}
}
// ToJSONSchema -
func (b *BLS12381g2) ToJSONSchema() (*JSONSchema, error) {
return getStringJSONSchema(b.Default), nil
}
// Distinguish -
func (b *BLS12381g2) Distinguish(x Distinguishable) (*MiguelNode, error) {
second, ok := x.(*BLS12381g2)
if !ok {
return nil, nil
}
return b.Default.Distinguish(&second.Default)
}
// FindByName -
func (b *BLS12381g2) FindByName(name string, isEntrypoint bool) Node {
if b.GetName() == name {
return b
}
return nil
}