You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
expectedError: "cannot get tokens with witness: please initialize curve",
115
116
},
117
+
{
118
+
name: "curve is not nil",
119
+
curve: math.Curves[math.FP256BN_AMCL],
120
+
wantErr: false,
121
+
validate: func(tokens []*math.G1, data []*token2.TokenDataWitness) error {
122
+
iflen(tokens) !=0 {
123
+
returnerrors.New("tokens should be empty")
124
+
}
125
+
iflen(data) !=0 {
126
+
returnerrors.New("tokens should be empty")
127
+
}
128
+
returnnil
129
+
},
130
+
},
131
+
{
132
+
name: "number of generators is not equal to number of vector elements",
133
+
values: []uint64{10},
134
+
tokenType: "token type",
135
+
pp: nil,
136
+
curve: math.Curves[math.FP256BN_AMCL],
137
+
wantErr: true,
138
+
expectedError: "cannot get tokens with witness: failed to compute token [0]: number of generators is not equal to number of vector elements, [0]!=[3]",
139
+
},
140
+
{
141
+
name: "success",
142
+
values: []uint64{10},
143
+
tokenType: "token type",
144
+
pp: []*math.G1{
145
+
math.Curves[math.FP256BN_AMCL].NewG1(),
146
+
math.Curves[math.FP256BN_AMCL].NewG1(),
147
+
math.Curves[math.FP256BN_AMCL].NewG1(),
148
+
},
149
+
curve: math.Curves[math.FP256BN_AMCL],
150
+
wantErr: false,
151
+
validate: func(toks []*math.G1, data []*token2.TokenDataWitness) error {
0 commit comments