@@ -151,11 +151,11 @@ func supplementalDataFromGpbft(sd gpbft.SupplementalData) SupplementalData {
151
151
func (m Message ) ToPartialMessage () (* gpbft.PartialGMessage , error ) {
152
152
payload , err := m .Vote .ToGpbftPayload ()
153
153
if err != nil {
154
- return nil , err
154
+ return nil , fmt . Errorf ( "could not convert vote to gpbft payload: %w" , err )
155
155
}
156
156
gj , err := m .Justification .ToGpbftJustification ()
157
157
if err != nil {
158
- return nil , err
158
+ return nil , fmt . Errorf ( "could not convert justification to gpbft justification: %w" , err )
159
159
}
160
160
161
161
return & gpbft.PartialGMessage {
@@ -173,16 +173,16 @@ func (m Message) ToPartialMessage() (*gpbft.PartialGMessage, error) {
173
173
func (p Payload ) ToGpbftPayload () (gpbft.Payload , error ) {
174
174
phase , err := phaseFromString (p .Phase )
175
175
if err != nil {
176
- return gpbft.Payload {}, err
176
+ return gpbft.Payload {}, fmt . Errorf ( "could not convert phase: %w" , err )
177
177
}
178
178
sd , err := p .SupplementalData .ToGpbftSupplementalData ()
179
179
if err != nil {
180
- return gpbft.Payload {}, err
180
+ return gpbft.Payload {}, fmt . Errorf ( "could not convert supplemental data: %w" , err )
181
181
}
182
182
183
183
gv , err := ToGpbftChain (p .Value ... )
184
184
if err != nil {
185
- return gpbft.Payload {}, err
185
+ return gpbft.Payload {}, fmt . Errorf ( "could not convert value: %w" , err )
186
186
}
187
187
188
188
return gpbft.Payload {
@@ -246,14 +246,14 @@ func (j *Justification) ToGpbftJustification() (*gpbft.Justification, error) {
246
246
gsigners , _ := bitfield .NewFromIter (ri )
247
247
payload , err := j .Vote .ToGpbftPayload ()
248
248
if err != nil {
249
- return nil , err
249
+ return nil , fmt . Errorf ( "could not convert vote to gpbft payload: %w" , err )
250
250
}
251
251
252
252
// Embedded struct as json, hence the decode.
253
253
s := string (j .Signature )
254
254
decoded , err := base64 .StdEncoding .DecodeString (s )
255
255
if err != nil {
256
- return nil , err
256
+ return nil , fmt . Errorf ( "could not decode signature: %w" , err )
257
257
}
258
258
259
259
return & gpbft.Justification {
0 commit comments