Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.17
go-version: "1.20"
- name: golangci-lint
uses: golangci/golangci-lint-action@v3.4.0
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.17
go-version: "1.20"

- name: Build
run: go build -v ./...
Expand Down
7 changes: 6 additions & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,12 @@ func (c *Client) SubmitPFB(ctx context.Context, namespace Namespace, data []byte
if rpcErr != "" {
return nil, errors.New(rpcErr)
}
return &res, nil

var respErr error
if res.Code != 0 {
respErr = errors.Join(err, fmt.Errorf("codespace: %s, code: %v, err: %s", res.Codespace, res.Code, res.Logs.String()))
}
return &res, respErr
}

func (c *Client) NamespacedShares(ctx context.Context, namespace Namespace, height uint64) ([][]byte, error) {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/celestiaorg/go-cnc

go 1.19
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we want to update the version, we should be doing it in a separate PR

go 1.20

require (
github.com/go-resty/resty/v2 v2.7.0
Expand Down
13 changes: 13 additions & 0 deletions types.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package cnc

import (
"encoding/json"

"github.com/gogo/protobuf/types"
)

Expand Down Expand Up @@ -63,6 +65,17 @@ type ABCIMessageLog struct {
Events StringEvents `protobuf:"bytes,3,rep,name=events,proto3,castrepeated=StringEvents" json:"events"`
}

// String implements the fmt.Stringer interface for the ABCIMessageLogs type.
func (logs ABCIMessageLogs) String() string {
if logs != nil {
raw, err := json.Marshal(logs)
if err == nil {
return string(raw)
}
}
return ""
}

// StringAttributes defines a slice of StringEvents objects.
type StringEvents []StringEvent

Expand Down