Skip to content

Commit 088f197

Browse files
committed
Lint fix
1 parent 7365278 commit 088f197

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

pkg/ton/debug/decoders/jetton/common.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import (
44
"github.com/xssnick/tonutils-go/tvm/cell"
55

66
cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment"
7-
"github.com/smartcontractkit/chainlink-ton/pkg/bindings/jetton"
87

8+
"github.com/smartcontractkit/chainlink-ton/pkg/bindings/jetton"
99
"github.com/smartcontractkit/chainlink-ton/pkg/ton/debug/lib"
1010
"github.com/smartcontractkit/chainlink-ton/pkg/ton/tvm"
1111
)

pkg/ton/debug/lib/lib.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ func DecodeJSONMapFromCell(msg *cell.Cell, tlbs map[uint64]interface{}) (string,
107107
inst := reflect.New(rt).Interface() // pointer to zero value
108108

109109
// attempt decode - replace tlb.FromCell with the actual decode API you have
110-
if err := tlb.LoadFromCell(inst, r); err != nil {
110+
if err = tlb.LoadFromCell(inst, r); err != nil {
111111
return "", nil, fmt.Errorf("failed to decode message for opcode 0x%X: %w", opCode, err)
112112
}
113113

@@ -151,7 +151,7 @@ func DecodeJSONMapFromCell(msg *cell.Cell, tlbs map[uint64]interface{}) (string,
151151
return "", nil, fmt.Errorf("failed to unmarshal BOC to cell: %s: %s: %w", ck, cBOC, err)
152152
}
153153

154-
// 3.3. Try to decode recursively using NewMessageInfoFromCell
154+
// 3.3. Try to decode recursively
155155
_, cMap, err := DecodeJSONMapFromCell(cVal, tlbs)
156156
if err != nil {
157157
// fallback to original BOC representation if fails
@@ -198,7 +198,7 @@ func NewTLBMap(types []interface{}) (map[uint64]interface{}, error) {
198198
// Notice: func extracted from tonutils-go tlb package
199199
func loadMagic(tag string) (uint64, error) {
200200
var sz, base int
201-
if strings.HasPrefix(tag, "#") {
201+
if strings.HasPrefix(tag, "#") { //nolint:gocritic // vendored from tonutils-go
202202
base = 16
203203
sz = (len(tag) - 1) * 4
204204
} else if strings.HasPrefix(tag, "$") {
@@ -209,14 +209,15 @@ func loadMagic(tag string) (uint64, error) {
209209
}
210210

211211
if sz > 64 {
212-
return 0, fmt.Errorf("too big magic value type in tag")
212+
return 0, fmt.Errorf("too big magic value type in tag") //nolint:perfsprint // vendored from tonutils-go
213213
}
214214

215215
magic, err := strconv.ParseInt(tag[1:], base, 64)
216216
if err != nil {
217-
return 0, fmt.Errorf("corrupted magic value in tag")
217+
return 0, fmt.Errorf("corrupted magic value in tag") //nolint:perfsprint // vendored from tonutils-go
218218
}
219-
return uint64(magic), nil
219+
220+
return uint64(magic), nil //nolint:gosec // vendored from tonutils-go
220221
}
221222

222223
type messageInfo struct {

0 commit comments

Comments
 (0)