Skip to content

Commit 3e942c1

Browse files
authored
Merge pull request #188 from Zondax/feat/lotus-v1.32.1
Support lotus v1.32.1
2 parents e2a4b9a + e7fbffa commit 3e942c1

File tree

4 files changed

+24
-15
lines changed

4 files changed

+24
-15
lines changed

.github/workflows/main.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
build:
88
runs-on: zondax-runners
99
container:
10-
image: golang:1.20
10+
image: golang:1.23.7
1111
options: --tty
1212
steps:
1313
- name: Checkout
@@ -16,7 +16,7 @@ jobs:
1616
submodules: true
1717
- uses: actions/setup-go@v5
1818
with:
19-
go-version: '^1.20'
19+
go-version: '1.23.7'
2020
- name: Install dependencies
2121
run: apt update && apt install -yy build-essential
2222
- name: Build
@@ -25,7 +25,7 @@ jobs:
2525
test:
2626
runs-on: zondax-runners
2727
container:
28-
image: golang:1.20
28+
image: golang:1.23.7
2929
options: --tty
3030
environment: DEVNET
3131
steps:
@@ -35,7 +35,7 @@ jobs:
3535
submodules: true
3636
- uses: actions/setup-go@v5
3737
with:
38-
go-version: '^1.20'
38+
go-version: '1.23.7'
3939
- name: Install dependencies
4040
run: apt update && apt install -yy build-essential
4141
- name: Test

construction_onchain_test.go

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020
"encoding/hex"
2121
"encoding/json"
2222
"fmt"
23+
"io"
2324
"net/http"
2425
"os"
2526
"testing"
@@ -65,11 +66,11 @@ func sendLotusRequest(method string, id int, params string) (map[string]interfac
6566
}
6667

6768
data := []byte(fmt.Sprintf("{\"jsonrpc\": \"2.0\",\"method\": \"%s\",\"id\": %d, \"params\": [%s]}", method, id, params))
68-
println(string(data))
69+
fmt.Println("request: ", string(data))
6970

7071
req, err := http.NewRequest("POST", lotusURL, bytes.NewBuffer(data))
7172
if err != nil {
72-
return nil, fmt.Errorf(err.Error())
73+
return nil, fmt.Errorf("error creating request: %w", err)
7374
}
7475

7576
// Set headers
@@ -82,7 +83,15 @@ func sendLotusRequest(method string, id int, params string) (map[string]interfac
8283
// Send request
8384
resp, err := client.Do(req)
8485
if err != nil {
85-
return nil, err
86+
return nil, fmt.Errorf("error sending request: %w", err)
87+
}
88+
defer resp.Body.Close() // Ensure body is closed
89+
90+
// Check HTTP status code
91+
if resp.StatusCode < 200 || resp.StatusCode >= 300 {
92+
// Try to read body for more details, but don't fail if it's empty
93+
bodyBytes, _ := io.ReadAll(resp.Body)
94+
return nil, fmt.Errorf("received non-2xx status code: %d - %s. Body: %s", resp.StatusCode, resp.Status, string(bodyBytes))
8695
}
8796

8897
var res map[string]interface{}

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ toolchain go1.24.1
77
require (
88
github.com/filecoin-project/go-address v1.2.0
99
github.com/filecoin-project/go-crypto v0.1.0
10-
github.com/filecoin-project/go-state-types v0.16.0-rc7
11-
github.com/filecoin-project/lotus v1.32.0-rc3
10+
github.com/filecoin-project/go-state-types v0.16.0
11+
github.com/filecoin-project/lotus v1.32.1
1212
github.com/filecoin-project/specs-actors v0.9.15
1313
github.com/filecoin-project/specs-actors/v2 v2.3.6
1414
github.com/filecoin-project/specs-actors/v3 v3.1.2

go.sum

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymF
7676
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
7777
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
7878
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
79-
github.com/filecoin-project/filecoin-ffi v1.31.0 h1:4Zxkcd4n7iBPSkliooHLdYTPyb8GKiy3WN6C55H83J8=
80-
github.com/filecoin-project/filecoin-ffi v1.31.0/go.mod h1:DLq39zugT2d0hawqmw7PLKJxHZIYZ9EkQc6DZg/e0lM=
79+
github.com/filecoin-project/filecoin-ffi v1.32.0 h1:5QO1JXg5/UNVrtldJ50+iniME06Wh67vFCwZHWF1BUM=
80+
github.com/filecoin-project/filecoin-ffi v1.32.0/go.mod h1:AXLJk1PscWAwEa9CdqdiFwj1ttVJ+UIm8YQDPpTqBjg=
8181
github.com/filecoin-project/go-address v0.0.3/go.mod h1:jr8JxKsYx+lQlQZmF5i2U0Z+cGQ59wMIps/8YW/lDj8=
8282
github.com/filecoin-project/go-address v0.0.5/go.mod h1:jr8JxKsYx+lQlQZmF5i2U0Z+cGQ59wMIps/8YW/lDj8=
8383
github.com/filecoin-project/go-address v1.2.0 h1:NHmWUE/J7Pi2JZX3gZt32XuY69o9StVZeJxdBodIwOE=
@@ -124,10 +124,10 @@ github.com/filecoin-project/go-state-types v0.0.0-20200928172055-2df22083d8ab/go
124124
github.com/filecoin-project/go-state-types v0.0.0-20201102161440-c8033295a1fc/go.mod h1:ezYnPf0bNkTsDibL/psSz5dy4B5awOJ/E7P2Saeep8g=
125125
github.com/filecoin-project/go-state-types v0.1.0/go.mod h1:ezYnPf0bNkTsDibL/psSz5dy4B5awOJ/E7P2Saeep8g=
126126
github.com/filecoin-project/go-state-types v0.1.6/go.mod h1:UwGVoMsULoCK+bWjEdd/xLCvLAQFBC7EDT477SKml+Q=
127-
github.com/filecoin-project/go-state-types v0.16.0-rc7 h1:ODs527FEqmq/kKj4jXqRVGUx8t8+XLPjR9aP1f+YVus=
128-
github.com/filecoin-project/go-state-types v0.16.0-rc7/go.mod h1:YCESyrqnyu17y0MazbV6Uwma5+BrMvEKEQp5QWeIf9g=
129-
github.com/filecoin-project/lotus v1.32.0-rc3 h1:m3+Psa3/7jOHua/lXDy6DiK6ZJ3KaNKz8XOtJWjY1BM=
130-
github.com/filecoin-project/lotus v1.32.0-rc3/go.mod h1:LLGBL05a60GvOiPEGD6sNEKMDGM+fKZ2qM9NzCCVMg8=
127+
github.com/filecoin-project/go-state-types v0.16.0 h1:ajIREDzTGfq71ofIQ29iZR1WXxmkvd2nQNc6ApcP1wI=
128+
github.com/filecoin-project/go-state-types v0.16.0/go.mod h1:YCESyrqnyu17y0MazbV6Uwma5+BrMvEKEQp5QWeIf9g=
129+
github.com/filecoin-project/lotus v1.32.1 h1:C1MLLb6ZIKTYZtqVEAJ+Jbfc1Kf8U1dB9EgqXlmG7MY=
130+
github.com/filecoin-project/lotus v1.32.1/go.mod h1:eNfZ0eXGMckDBFQmL1/MJk/0UgxVKHy74z40uMrGlg4=
131131
github.com/filecoin-project/specs-actors v0.9.13/go.mod h1:TS1AW/7LbG+615j4NsjMK1qlpAwaFsG9w0V2tg2gSao=
132132
github.com/filecoin-project/specs-actors v0.9.15-0.20220514164640-94e0d5e123bd/go.mod h1:pjGEe3QlWtK20ju/aFRsiArbMX6Cn8rqEhhsiCM9xYE=
133133
github.com/filecoin-project/specs-actors v0.9.15 h1:3VpKP5/KaDUHQKAMOg4s35g/syDaEBueKLws0vbsjMc=

0 commit comments

Comments
 (0)