Skip to content

Commit 81b3f8e

Browse files
committed
Merge remote-tracking branch 'origin/new-msg-sender'
2 parents 9161024 + 2c38793 commit 81b3f8e

11 files changed

+203
-13
lines changed

api/openapi.json

+6
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,12 @@
430430
"boc": {
431431
"format": "cell",
432432
"type": "string"
433+
},
434+
"meta": {
435+
"additionalProperties": {
436+
"type": "string"
437+
},
438+
"type": "object"
433439
}
434440
},
435441
"type": "object"

api/openapi.yml

+4
Original file line numberDiff line numberDiff line change
@@ -3156,6 +3156,10 @@ components:
31563156
items:
31573157
type: string
31583158
format: cell
3159+
meta:
3160+
type: object
3161+
additionalProperties:
3162+
type: string
31593163
EmulationBoc:
31603164
description: bag-of-cells serialized to base64/hex and additional parameters to configure emulation
31613165
required: true

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ require (
2424
github.com/sourcegraph/conc v0.3.0
2525
github.com/stretchr/testify v1.9.0
2626
github.com/tonkeeper/scam_backoffice_rules v0.0.0-20241106130559-c44de2d4177b
27-
github.com/tonkeeper/tongo v1.10.3
27+
github.com/tonkeeper/tongo v1.13.0
2828
go.opentelemetry.io/otel v1.24.0
2929
go.opentelemetry.io/otel/metric v1.24.0
3030
go.opentelemetry.io/otel/trace v1.24.0

go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,8 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT
270270
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
271271
github.com/tonkeeper/scam_backoffice_rules v0.0.0-20241106130559-c44de2d4177b h1:udp2XHUF2gba2mrHbPcEjmeedRoXvpldO+3mXDiKJ2A=
272272
github.com/tonkeeper/scam_backoffice_rules v0.0.0-20241106130559-c44de2d4177b/go.mod h1:SqZXYO9vbID8ku+xnnaKXeNGmehxigODGrk5V1KqbRA=
273-
github.com/tonkeeper/tongo v1.10.3 h1:T1xGxikAfVRDLd5SUWDOCKZurlUDRoChoXzFvy8AGsw=
274-
github.com/tonkeeper/tongo v1.10.3/go.mod h1:MjgIgAytFarjCoVjMLjYEtpZNN1f2G/pnZhKjr28cWs=
273+
github.com/tonkeeper/tongo v1.13.0 h1:LesxO+HFrLSkhDYMXLl+zlabZpVTnaMNHUqwkIhzl0c=
274+
github.com/tonkeeper/tongo v1.13.0/go.mod h1:MjgIgAytFarjCoVjMLjYEtpZNN1f2G/pnZhKjr28cWs=
275275
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
276276
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
277277
github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ=

pkg/api/event_handlers.go

+6
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ func (h *Handler) SendBlockchainMessage(ctx context.Context, request *oas.SendBl
7373
if !request.Boc.IsSet() && len(request.Batch) == 0 {
7474
return toError(http.StatusBadRequest, fmt.Errorf("boc not found"))
7575
}
76+
var meta map[string]string
77+
if request.Meta.IsSet() {
78+
meta = request.Meta.Value
79+
}
7680
if request.Boc.IsSet() {
7781
m, err := decodeMessage(request.Boc.Value)
7882
if err != nil {
@@ -86,6 +90,7 @@ func (h *Handler) SendBlockchainMessage(ctx context.Context, request *oas.SendBl
8690
MsgBoc: m.base64,
8791
Payload: m.payload,
8892
Details: h.ctxToDetails(ctx),
93+
Meta: meta,
8994
}
9095
sendMessageCounter.Inc()
9196
if err := h.msgSender.SendMessage(ctx, msgCopy); err != nil {
@@ -114,6 +119,7 @@ func (h *Handler) SendBlockchainMessage(ctx context.Context, request *oas.SendBl
114119
MsgBoc: m.base64,
115120
Payload: m.payload,
116121
Details: h.ctxToDetails(ctx),
122+
Meta: meta,
117123
}
118124
copies = append(copies, msgCopy)
119125
}

pkg/api/staking_handlers.go

+2-4
Original file line numberDiff line numberDiff line change
@@ -268,10 +268,8 @@ func (h *Handler) GetStakingPoolHistory(ctx context.Context, params oas.GetStaki
268268
return nil, toError(http.StatusNotFound, err)
269269
}
270270
logAddress := tlb.MsgAddress{SumType: "AddrExtern"}
271-
logAddress.AddrExtern = &struct {
272-
Len tlb.Uint9
273-
ExternalAddress boc.BitString
274-
}{Len: 256, ExternalAddress: g.Must(boc.BitStringFromFiftHex("0000000000000000000000000000000000000000000000000000000000000003"))}
271+
addr := g.Must(boc.BitStringFromFiftHex("0000000000000000000000000000000000000000000000000000000000000003"))
272+
logAddress.AddrExtern = &addr
275273
logs, err := h.storage.GetLogs(ctx, pool.ID, &logAddress, 100, 0)
276274
if err != nil {
277275
return nil, toError(http.StatusInternalServerError, err)

pkg/blockchain/msg_sender.go

+2
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ type ExtInMsgCopy struct {
4949
// Accounts is set when the message is emulated.
5050
Accounts map[tongo.AccountID]struct{}
5151

52+
Meta map[string]string
53+
5254
SendFailed bool // default is false, so we are good with backward compatibility.
5355
}
5456

pkg/core/transactions.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,5 @@ func externalAddressFromTlb(address tlb.MsgAddress) *ExternalAddress {
190190
if address.SumType != "AddrExtern" {
191191
return nil
192192
}
193-
external := address.AddrExtern.ExternalAddress
194-
return &external
193+
return address.AddrExtern
195194
}

pkg/litestorage/transactions.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func (s *LiteStorage) GetLogs(ctx context.Context, account tongo.AccountID, dest
3535
if destination.SumType == "AddrNone" && m.DestinationExtern != nil {
3636
continue
3737
}
38-
if destination.SumType == "AddrExtern" && (m.DestinationExtern == nil || m.DestinationExtern.ToFiftHex() != destination.AddrExtern.ExternalAddress.ToFiftHex()) {
38+
if destination.SumType == "AddrExtern" && (m.DestinationExtern == nil || m.DestinationExtern.ToFiftHex() != destination.AddrExtern.ToFiftHex()) {
3939
continue
4040
}
4141
}

pkg/oas/oas_json_gen.go

+108-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/oas/oas_schemas_gen.go

+70-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)