Skip to content

Commit

Permalink
not found fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nolag committed Dec 14, 2023
1 parent 282bfeb commit 107298f
Show file tree
Hide file tree
Showing 12 changed files with 35 additions and 33 deletions.
2 changes: 1 addition & 1 deletion core/scripts/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ require (
github.com/shirou/gopsutil/v3 v3.23.11 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704 // indirect
github.com/smartcontractkit/chainlink-common v0.1.7-0.20231213203435-f213bca2982d // indirect
github.com/smartcontractkit/chainlink-common v0.1.7-0.20231214161317-be5f8947cf55 // 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-20231127231053-2232d3a6766d // 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 @@ -1148,8 +1148,8 @@ github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704 h1:T3lFWumv
github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704/go.mod h1:2QuJdEouTWjh5BDy5o/vgGXQtR4Gz8yH1IYB5eT7u4M=
github.com/smartcontractkit/chainlink-automation v1.0.1 h1:vVjBFq2Zsz21kPy1Pb0wpjF9zrbJX+zjXphDeeR4XZk=
github.com/smartcontractkit/chainlink-automation v1.0.1/go.mod h1:INSchkV3ntyDdlZKGWA030MPDpp6pbeuiRkRKYFCm2k=
github.com/smartcontractkit/chainlink-common v0.1.7-0.20231213203435-f213bca2982d h1:azq9Vi7aWsq7HOUIYKFCD3Xksuz03q+UFUUkhPwYByc=
github.com/smartcontractkit/chainlink-common v0.1.7-0.20231213203435-f213bca2982d/go.mod h1:IdlfCN9rUs8Q/hrOYe8McNBIwEOHEsi0jilb3Cw77xs=
github.com/smartcontractkit/chainlink-common v0.1.7-0.20231214161317-be5f8947cf55 h1:p1Q9M8xAhLgemHi155g/0MEwTltBTIouyIBAs3GpsLE=
github.com/smartcontractkit/chainlink-common v0.1.7-0.20231214161317-be5f8947cf55/go.mod h1:IdlfCN9rUs8Q/hrOYe8McNBIwEOHEsi0jilb3Cw77xs=
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231128204301-ee4297eff679 h1:iu1pNbUoSDTrp+7BUtfTygZ2C0f5C2ZOBQhIoJjp+S0=
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=
Expand Down
20 changes: 10 additions & 10 deletions core/services/ocr2/plugins/median/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,17 +199,17 @@ type medianContract struct {
}

type latestTransmissionDetailsResponse struct {
configDigest ocr2types.ConfigDigest
epoch uint32
round uint8
latestAnswer *big.Int
latestTimestamp time.Time
ConfigDigest ocr2types.ConfigDigest
Epoch uint32
Round uint8
LatestAnswer *big.Int
LatestTimestamp time.Time
}

type latestRoundRequested struct {
configDigest ocr2types.ConfigDigest
epoch uint32
round uint8
ConfigDigest ocr2types.ConfigDigest
Epoch uint32
Round uint8
}

func (m *medianContract) LatestTransmissionDetails(ctx context.Context) (configDigest ocr2types.ConfigDigest, epoch uint32, round uint8, latestAnswer *big.Int, latestTimestamp time.Time, err error) {
Expand All @@ -220,7 +220,7 @@ func (m *medianContract) LatestTransmissionDetails(ctx context.Context) (configD
return
}

return resp.configDigest, resp.epoch, resp.round, resp.latestAnswer, resp.latestTimestamp, err
return resp.ConfigDigest, resp.Epoch, resp.Round, resp.LatestAnswer, resp.LatestTimestamp, err
}

func (m *medianContract) LatestRoundRequested(ctx context.Context, lookback time.Duration) (configDigest ocr2types.ConfigDigest, epoch uint32, round uint8, err error) {
Expand All @@ -231,7 +231,7 @@ func (m *medianContract) LatestRoundRequested(ctx context.Context, lookback time
return
}

return resp.configDigest, resp.epoch, resp.round, err
return resp.ConfigDigest, resp.Epoch, resp.Round, err
}

func newMedianContract(chainReader types.ChainReader, address common.Address) *medianContract {
Expand Down
5 changes: 3 additions & 2 deletions core/services/relay/evm/chain_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,9 @@ func (cr *chainReader) getLatestValueFromLogPoller(ctx context.Context, contract
log, err := cr.lp.LatestLogByEventSigWithConfs(hash, ae.addr, logpoller.Finalized)
if err != nil {
cr.lggr.Errorf("!!!!!!!!!!\nNo sig err:\n%v\n!!!!!!!!!!\n", err)
if strings.Contains(err.Error(), "not found") {
return fmt.Errorf("%w: %w", commontypes.ErrNotFound, err)
errStr := err.Error()
if strings.Contains(errStr, "not found") || strings.Contains(errStr, "no rows") {
return nil
}
return fmt.Errorf("%w: %w", commontypes.ErrInternal, err)
}
Expand Down
2 changes: 1 addition & 1 deletion core/services/relay/evm/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
// SliceToArrayVerifySizeHook verifies that slices have the correct size when converting to an array
// sizeVerifyBigIntHook allows our custom types that verify the number fits in the on-chain type to be converted as-if
// it was a *big.Int
var evmDecoderHooks = []mapstructure.DecodeHookFunc{decodeAccountHook, codec.BigIntHook, codec.SliceToArrayVerifySizeHook, sizeVerifyBigIntHook}
var evmDecoderHooks = []mapstructure.DecodeHookFunc{decodeAccountHook, codec.EpochToTimeHook, codec.BigIntHook, codec.SliceToArrayVerifySizeHook, sizeVerifyBigIntHook}

func NewCodec(conf types.CodecConfig) (commontypes.RemoteCodec, error) {
fmt.Printf("!!!!!!!!!!\nNewCodec\n%#v\n!!!!!!!!!!\n", conf.ChainCodecConfigs)
Expand Down
11 changes: 6 additions & 5 deletions core/services/relay/evm/decoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ type decoder struct {
var _ commontypes.Decoder = &decoder{}

func (m *decoder) Decode(ctx context.Context, raw []byte, into any, itemType string) error {
fmt.Printf("!!!!!!!!!!\\nDecode\\n%s\\n!!!!!!!!!!\\n", itemType)
fmt.Printf("!!!!!!!!!!\nDecode\n%s\n!!!!!!!!!!\n", itemType)
info, ok := m.Definitions[itemType]
if !ok {
fmt.Printf("!!!!!!!!!!\\nDecode err not found type\\n%s\\n!!!!!!!!!!\\n", itemType)
fmt.Printf("!!!!!!!!!!\nDecode err not found type\n%s\n!!!!!!!!!!\n", itemType)
return commontypes.ErrInvalidType
}

decode, err := extractDecoding(info, raw)
if err != nil {
fmt.Printf("!!!!!!!!!!\\nDecode err: %v\\n%s\\n!!!!!!!!!!\\n", err, itemType)
fmt.Printf("!!!!!!!!!!\nDecode err: %v\n%s\n!!!!!!!!!!\n", err, itemType)
return err
}

Expand Down Expand Up @@ -55,7 +55,7 @@ func (m *decoder) GetMaxDecodingSize(ctx context.Context, n int, itemType string
b := make([]byte, 2048) // adjust buffer size to be larger than expected stack
nb := runtime.Stack(b, false)
s := string(b[:nb])
fmt.Printf("!!!!!!!!!!\\nGetMaxDecodingSize\\n%s\\n\\n%v\\n%s!!!!!!!!!!\\n", itemType, m.Definitions, s)
fmt.Printf("!!!!!!!!!!\nGetMaxDecodingSize\n%s\n\n%v\n%s!!!!!!!!!!\n", itemType, m.Definitions, s)

return m.Definitions[itemType].GetMaxSize(n)
}
Expand Down Expand Up @@ -90,8 +90,9 @@ func mapstructureDecode(src, dest any) error {
Squash: true,
})
if err != nil || mDecoder.Decode(src) != nil {
fmt.Printf("!!!!!!!!!!\\nDecode item error: %v\\n%v\\n!!!!!!!!!!\\n", err, mDecoder.Decode(src))
fmt.Printf("!!!!!!!!!!\nDecode item error: %v\n%v\n!!!!!!!!!!\n", err, mDecoder.Decode(src))
return commontypes.ErrInvalidType
}
fmt.Printf("!!!!!!!!!!\nDecode item success\n%#v\n%#v\n!!!!!!!!!!\n", dest, src)
return nil
}
10 changes: 5 additions & 5 deletions core/services/relay/evm/encoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ type encoder struct {
var _ commontypes.Encoder = &encoder{}

func (e *encoder) Encode(ctx context.Context, item any, itemType string) ([]byte, error) {
fmt.Printf("!!!!!!!!!!\\nEncode: %#v\\n%s\\n!!!!!!!!!!\\n", item, itemType)
fmt.Printf("!!!!!!!!!!\nEncode: %#v\n%s\n!!!!!!!!!!\n", item, itemType)
info, ok := e.Definitions[itemType]
if !ok {
fmt.Printf("!!!!!!!!!!\\nEncode error not found\\n%s\\n!!!!!!!!!!\\n", itemType)
fmt.Printf("!!!!!!!!!!\nEncode error not found\n%s\n!!!!!!!!!!\n", itemType)
return nil, commontypes.ErrInvalidType
}

Expand All @@ -31,9 +31,9 @@ func (e *encoder) Encode(ctx context.Context, item any, itemType string) ([]byte

b, err := encode(reflect.ValueOf(item), info)
if err == nil {
fmt.Printf("!!!!!!!!!!\\nEncode success\\n%s\\n!!!!!!!!!!\\n", itemType)
fmt.Printf("!!!!!!!!!!\nEncode success\n%s\n!!!!!!!!!!\n", itemType)
} else {
fmt.Printf("!!!!!!!!!!\\nEncode error\\n%v\\n%s\\n!!!!!!!!!!\\n", err, itemType)
fmt.Printf("!!!!!!!!!!\nEncode error\n%v\n%s\n!!!!!!!!!!\n", err, itemType)
}
return b, err
}
Expand All @@ -42,7 +42,7 @@ func (e *encoder) GetMaxEncodingSize(ctx context.Context, n int, itemType string
b := make([]byte, 2048) // adjust buffer size to be larger than expected stack
nb := runtime.Stack(b, false)
s := string(b[:nb])
fmt.Printf("!!!!!!!!!!\\nGetMaxEncodingSize\\n%s\\n\\n%v\\n%s!!!!!!!!!!\\n", itemType, e.Definitions, s)
fmt.Printf("!!!!!!!!!!\nGetMaxEncodingSize\n%s\n\n%v\n%s!!!!!!!!!!\n", itemType, e.Definitions, s)
return e.Definitions[itemType].GetMaxSize(n)
}

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ require (
github.com/shopspring/decimal v1.3.1
github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704
github.com/smartcontractkit/chainlink-automation v1.0.1
github.com/smartcontractkit/chainlink-common v0.1.7-0.20231213203435-f213bca2982d
github.com/smartcontractkit/chainlink-common v0.1.7-0.20231214161317-be5f8947cf55
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231128204301-ee4297eff679
github.com/smartcontractkit/chainlink-data-streams v0.0.0-20231204152908-a6e3fe8ff2a1
github.com/smartcontractkit/chainlink-feeds v0.0.0-20231127231053-2232d3a6766d
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1134,8 +1134,8 @@ github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704 h1:T3lFWumv
github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704/go.mod h1:2QuJdEouTWjh5BDy5o/vgGXQtR4Gz8yH1IYB5eT7u4M=
github.com/smartcontractkit/chainlink-automation v1.0.1 h1:vVjBFq2Zsz21kPy1Pb0wpjF9zrbJX+zjXphDeeR4XZk=
github.com/smartcontractkit/chainlink-automation v1.0.1/go.mod h1:INSchkV3ntyDdlZKGWA030MPDpp6pbeuiRkRKYFCm2k=
github.com/smartcontractkit/chainlink-common v0.1.7-0.20231213203435-f213bca2982d h1:azq9Vi7aWsq7HOUIYKFCD3Xksuz03q+UFUUkhPwYByc=
github.com/smartcontractkit/chainlink-common v0.1.7-0.20231213203435-f213bca2982d/go.mod h1:IdlfCN9rUs8Q/hrOYe8McNBIwEOHEsi0jilb3Cw77xs=
github.com/smartcontractkit/chainlink-common v0.1.7-0.20231214161317-be5f8947cf55 h1:p1Q9M8xAhLgemHi155g/0MEwTltBTIouyIBAs3GpsLE=
github.com/smartcontractkit/chainlink-common v0.1.7-0.20231214161317-be5f8947cf55/go.mod h1:IdlfCN9rUs8Q/hrOYe8McNBIwEOHEsi0jilb3Cw77xs=
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231128204301-ee4297eff679 h1:iu1pNbUoSDTrp+7BUtfTygZ2C0f5C2ZOBQhIoJjp+S0=
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=
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/actions/ocr2_helpers_local.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion integration-tests/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ require (
github.com/segmentio/ksuid v1.0.4
github.com/slack-go/slack v0.12.2
github.com/smartcontractkit/chainlink-automation v1.0.1
github.com/smartcontractkit/chainlink-common v0.1.7-0.20231213203435-f213bca2982d
github.com/smartcontractkit/chainlink-common v0.1.7-0.20231214161317-be5f8947cf55
github.com/smartcontractkit/chainlink-testing-framework v1.22.0
github.com/smartcontractkit/chainlink-vrf v0.0.0-20231120191722-fef03814f868
github.com/smartcontractkit/chainlink/v2 v2.0.0-00010101000000-000000000000
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1432,8 +1432,8 @@ github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704 h1:T3lFWumv
github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704/go.mod h1:2QuJdEouTWjh5BDy5o/vgGXQtR4Gz8yH1IYB5eT7u4M=
github.com/smartcontractkit/chainlink-automation v1.0.1 h1:vVjBFq2Zsz21kPy1Pb0wpjF9zrbJX+zjXphDeeR4XZk=
github.com/smartcontractkit/chainlink-automation v1.0.1/go.mod h1:INSchkV3ntyDdlZKGWA030MPDpp6pbeuiRkRKYFCm2k=
github.com/smartcontractkit/chainlink-common v0.1.7-0.20231213203435-f213bca2982d h1:azq9Vi7aWsq7HOUIYKFCD3Xksuz03q+UFUUkhPwYByc=
github.com/smartcontractkit/chainlink-common v0.1.7-0.20231213203435-f213bca2982d/go.mod h1:IdlfCN9rUs8Q/hrOYe8McNBIwEOHEsi0jilb3Cw77xs=
github.com/smartcontractkit/chainlink-common v0.1.7-0.20231214161317-be5f8947cf55 h1:p1Q9M8xAhLgemHi155g/0MEwTltBTIouyIBAs3GpsLE=
github.com/smartcontractkit/chainlink-common v0.1.7-0.20231214161317-be5f8947cf55/go.mod h1:IdlfCN9rUs8Q/hrOYe8McNBIwEOHEsi0jilb3Cw77xs=
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231128204301-ee4297eff679 h1:iu1pNbUoSDTrp+7BUtfTygZ2C0f5C2ZOBQhIoJjp+S0=
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=
Expand Down

0 comments on commit 107298f

Please sign in to comment.