Skip to content

Commit

Permalink
Updated SubscribeOnTransactions test
Browse files Browse the repository at this point in the history
  • Loading branch information
xssnick committed Jan 12, 2024
1 parent c8412ad commit 1d8937b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions ton/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ func TestAPIClient_SubscribeOnTransactions(t *testing.T) {
defer cancel()
ctx := api.Client().StickyContext(_ctx)

addr := address.MustParseAddr("EQCD39VS5jcptHL8vMjEXrzGaRcCVYto7HUn4bpAOg8xqB2N")
addr := address.MustParseAddr("Ef8zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzM0vF")

b, err := api.CurrentMasterchainInfo(ctx)
if err != nil {
Expand All @@ -672,7 +672,7 @@ func TestAPIClient_SubscribeOnTransactions(t *testing.T) {
t.Fatal("get acc err:", err.Error())
return
}
initLT := acc.LastTxLT - 600000000000
initLT := acc.LastTxLT - 10
log.Println(initLT)
lastLT := initLT

Expand All @@ -682,16 +682,19 @@ func TestAPIClient_SubscribeOnTransactions(t *testing.T) {
ch := make(chan *tlb.Transaction)
go api.SubscribeOnTransactions(ctx, addr, lastLT, ch)

gotTx := false
for tx := range ch {
if lastLT > tx.LT {
t.Fatal("incorrect tx order")
}
lastLT = tx.LT

gotTx = true
println(tx.Now, tx.String())
cancel()
}

if lastLT == initLT {
if !gotTx {
t.Fatal("no transactions")
}
}
Expand Down

0 comments on commit 1d8937b

Please sign in to comment.