Skip to content

Commit

Permalink
storage: nil out transaction .Error on unknown result
Browse files Browse the repository at this point in the history
  • Loading branch information
pro-wh committed Sep 3, 2024
1 parent 651eef7 commit 33dd673
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions .changelog/704.bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
storage: nil out transaction .Error on unknown result
6 changes: 5 additions & 1 deletion storage/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -1531,7 +1531,11 @@ func (c *StorageClient) RuntimeTransactions(ctx context.Context, p apiTypes.GetR
); err != nil {
return nil, wrapError(err)
}
if t.Success != nil && *t.Success {
// If success field is unset (i.e. encrypted "Unknown" result) or
// successful, some database versions have non-null error module/code
// from before the fields were nullable. There's no error information,
// so empty this stuff out.
if t.Success == nil || *t.Success {
t.Error = nil
}
if encryptionEnvelopeFormat != nil { // a rudimentary check to determine if the tx was encrypted
Expand Down

0 comments on commit 33dd673

Please sign in to comment.