Skip to content

Commit

Permalink
More debug stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
nolag committed Dec 19, 2023
1 parent 8acbccb commit 7999d45
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 14 deletions.
2 changes: 1 addition & 1 deletion core/scripts/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ require (
github.com/smartcontractkit/chainlink-common v0.1.7-0.20231218192030-a1f59aa9e04b // indirect
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231128204301-ee4297eff679 // indirect
github.com/smartcontractkit/chainlink-data-streams v0.0.0-20231204152908-a6e3fe8ff2a1 // indirect
github.com/smartcontractkit/chainlink-feeds v0.0.0-20231219191350-07dbf91e3312 // indirect
github.com/smartcontractkit/chainlink-feeds v0.0.0-20231219204752-f623ecc16802 // indirect
github.com/smartcontractkit/chainlink-solana v1.0.3-0.20231130211003-6d1bb2f0b68a // indirect
github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20231128204445-3d61b12a0006 // indirect
github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20230906073235-9e478e5e19f1 // indirect
Expand Down
4 changes: 2 additions & 2 deletions core/scripts/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1154,8 +1154,8 @@ github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231128204301-ee4297eff67
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231128204301-ee4297eff679/go.mod h1:2Jx7bTEk4ujFQdsZpZq3A0BydvaVPs6mX8clUfxHOEM=
github.com/smartcontractkit/chainlink-data-streams v0.0.0-20231204152908-a6e3fe8ff2a1 h1:xYqRgZO0nMSO8CBCMR0r3WA+LZ4kNL8a6bnbyk/oBtQ=
github.com/smartcontractkit/chainlink-data-streams v0.0.0-20231204152908-a6e3fe8ff2a1/go.mod h1:GuPvyXryvbiUZIHmPeLBz4L+yJKeyGUjrDfd1KNne+o=
github.com/smartcontractkit/chainlink-feeds v0.0.0-20231219191350-07dbf91e3312 h1:PmJRQUEd46glRHQWCrMyRTWfTocG5SlMovIOei25+ho=
github.com/smartcontractkit/chainlink-feeds v0.0.0-20231219191350-07dbf91e3312/go.mod h1:Mr81s6sKCXcIyxv6cJ4OOPEdbxLCY6BkO7NiP26AOJ0=
github.com/smartcontractkit/chainlink-feeds v0.0.0-20231219204752-f623ecc16802 h1:gTbzH7DfK6N4RbO+SAAdJUnkaZ5Gu5IHjZdF40Fufbg=
github.com/smartcontractkit/chainlink-feeds v0.0.0-20231219204752-f623ecc16802/go.mod h1:Mr81s6sKCXcIyxv6cJ4OOPEdbxLCY6BkO7NiP26AOJ0=
github.com/smartcontractkit/chainlink-solana v1.0.3-0.20231130211003-6d1bb2f0b68a h1:JoyTazNcqXvZoMQjNfB0eapnlaoMS6pI0NeRvouRvog=
github.com/smartcontractkit/chainlink-solana v1.0.3-0.20231130211003-6d1bb2f0b68a/go.mod h1:rioELYwPY2xBtzPRN/D08Y7iTPbIQEjPknYdJK51CzQ=
github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20231128204445-3d61b12a0006 h1:1GzOKT53e8N7ZPwsyf1hSbKsynZmXmLOIL3DMvGq9sc=
Expand Down
2 changes: 1 addition & 1 deletion core/services/relay/evm/chain_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func (cr *chainReader) getLatestValueFromLogPoller(ctx context.Context, contract
return err
}

log, err := cr.lp.LatestLogByEventSigWithConfs(hash, ae.addr, logpoller.Finalized)
log, err := cr.lp.LatestLogByEventSigWithConfs(hash, ae.addr, logpoller.Unconfirmed)
if err != nil {
errStr := err.Error()
if strings.Contains(errStr, "not found") || strings.Contains(errStr, "no rows") {
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ require (
github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704 // indirect
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231128204301-ee4297eff679 // indirect
github.com/smartcontractkit/chainlink-data-streams v0.0.0-20231204152908-a6e3fe8ff2a1 // indirect
github.com/smartcontractkit/chainlink-feeds v0.0.0-20231219191350-07dbf91e3312 // indirect
github.com/smartcontractkit/chainlink-feeds v0.0.0-20231219204752-f623ecc16802 // indirect
github.com/smartcontractkit/chainlink-solana v1.0.3-0.20231130211003-6d1bb2f0b68a // indirect
github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20231128204445-3d61b12a0006 // indirect
github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20230906073235-9e478e5e19f1 // indirect
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1438,8 +1438,8 @@ github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231128204301-ee4297eff67
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231128204301-ee4297eff679/go.mod h1:2Jx7bTEk4ujFQdsZpZq3A0BydvaVPs6mX8clUfxHOEM=
github.com/smartcontractkit/chainlink-data-streams v0.0.0-20231204152908-a6e3fe8ff2a1 h1:xYqRgZO0nMSO8CBCMR0r3WA+LZ4kNL8a6bnbyk/oBtQ=
github.com/smartcontractkit/chainlink-data-streams v0.0.0-20231204152908-a6e3fe8ff2a1/go.mod h1:GuPvyXryvbiUZIHmPeLBz4L+yJKeyGUjrDfd1KNne+o=
github.com/smartcontractkit/chainlink-feeds v0.0.0-20231219191350-07dbf91e3312 h1:PmJRQUEd46glRHQWCrMyRTWfTocG5SlMovIOei25+ho=
github.com/smartcontractkit/chainlink-feeds v0.0.0-20231219191350-07dbf91e3312/go.mod h1:Mr81s6sKCXcIyxv6cJ4OOPEdbxLCY6BkO7NiP26AOJ0=
github.com/smartcontractkit/chainlink-feeds v0.0.0-20231219204752-f623ecc16802 h1:gTbzH7DfK6N4RbO+SAAdJUnkaZ5Gu5IHjZdF40Fufbg=
github.com/smartcontractkit/chainlink-feeds v0.0.0-20231219204752-f623ecc16802/go.mod h1:Mr81s6sKCXcIyxv6cJ4OOPEdbxLCY6BkO7NiP26AOJ0=
github.com/smartcontractkit/chainlink-solana v1.0.3-0.20231130211003-6d1bb2f0b68a h1:JoyTazNcqXvZoMQjNfB0eapnlaoMS6pI0NeRvouRvog=
github.com/smartcontractkit/chainlink-solana v1.0.3-0.20231130211003-6d1bb2f0b68a/go.mod h1:rioELYwPY2xBtzPRN/D08Y7iTPbIQEjPknYdJK51CzQ=
github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20231128204445-3d61b12a0006 h1:1GzOKT53e8N7ZPwsyf1hSbKsynZmXmLOIL3DMvGq9sc=
Expand Down
33 changes: 26 additions & 7 deletions integration-tests/smoke/chain_reader_and_codec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ func TestOCRv2BasicWithChainReaderAndCodec(t *testing.T) {
require.NoError(t, err, "Error configuring OCRv2 aggregator contracts")
fmt.Println("built agg")

err = env.MockAdapter.SetAdapterBasedIntValuePath("ocr2", []string{http.MethodGet, http.MethodPost}, 50)
require.NoError(t, err)

err = actions.StartNewOCR2Round(1, aggregatorContracts, env.EVMClient, time.Minute*5, l)

require.NoError(t, err, "Error starting new OCR2 round")
Expand All @@ -95,10 +98,8 @@ func TestOCRv2BasicWithChainReaderAndCodec(t *testing.T) {
require.NoError(t, err, "Getting latest answer from OCR contract shouldn't fail")
fmt.Println("get latest")

require.Equal(t, int64(5), roundData.Answer.Int64(),
"Expected latest answer from OCR contract to be 5 but got %d",
roundData.Answer.Int64(),
)
fmt.Printf("want 50 it's %v\n", roundData.Answer.Int64())

fmt.Println("answer")

err = env.MockAdapter.SetAdapterBasedIntValuePath("ocr2", []string{http.MethodGet, http.MethodPost}, 10)
Expand All @@ -113,11 +114,29 @@ func TestOCRv2BasicWithChainReaderAndCodec(t *testing.T) {
require.NoError(t, err, "Error getting latest OCR answer")
fmt.Println("got answer 2")

require.Equal(t, int64(10), roundData.Answer.Int64(),
fmt.Printf("want 10 it's %v\n", roundData.Answer.Int64())

err = env.MockAdapter.SetAdapterBasedIntValuePath("ocr2", []string{http.MethodGet, http.MethodPost}, 15)
require.NoError(t, err)
fmt.Println("adapter 2")

err = actions.StartNewOCR2Round(3, aggregatorContracts, env.EVMClient, time.Minute*5, l)
require.NoError(t, err)
fmt.Println("new round 3")

roundData, err = aggregatorContracts[0].GetRound(testcontext.Get(t), big.NewInt(3))
require.NoError(t, err, "Error getting latest OCR answer")
fmt.Println("got answer 3")

fmt.Printf("want 15 it's %v\n", roundData.Answer.Int64())

/*require.Equal(t, int64(10), roundData.Answer.Int64(),
"Expected latest answer from OCR contract to be 10 but got %d",
roundData.Answer.Int64(),
)
)*/

fmt.Println("values equal")
fmt.Println("SLEEPING NOW")
time.Sleep(time.Hour)
fmt.Println("DONE SLEEPING")
require.Fail(t, "Capture logs")
}

0 comments on commit 7999d45

Please sign in to comment.