Skip to content

Commit

Permalink
Allow re-use of chain reader tests outside go testing to allow applic…
Browse files Browse the repository at this point in the history
…ations to test against actual chains and optomize the use of the contracts.
  • Loading branch information
nolag committed May 21, 2024
1 parent a25ce4d commit d3ecbda
Show file tree
Hide file tree
Showing 15 changed files with 504 additions and 400 deletions.
4 changes: 2 additions & 2 deletions core/capabilities/streams/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
type Codec struct {
}

func (c Codec) Unwrap(raw values.Value) ([]datastreams.FeedReport, error) {
func (c Codec) UnwrapValid(wrapped values.Value, allowedSigners [][]byte, minRequiredSignatures int) ([]datastreams.FeedReport, error) {
dest := []datastreams.FeedReport{}
err := raw.UnwrapTo(&dest)
err := wrapped.UnwrapTo(&dest)
// TODO (KS-196): validate reports
return dest, err
}
Expand Down
3 changes: 2 additions & 1 deletion core/capabilities/syncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ func (s *registrySyncer) Start(ctx context.Context) error {
if slices.Contains(workflowDONPeers, myId) {
s.lggr.Info("member of a workflow DON - starting remote subscribers")
codec := streams.NewCodec()
aggregator := triggers.NewMercuryRemoteAggregator(codec, s.lggr)
// TODO (KS-196): validate reports
aggregator := triggers.NewMercuryRemoteAggregator(codec, nil, 0, s.lggr)
triggerCap := remote.NewTriggerSubscriber(config, triggerInfo, triggerCapabilityDonInfo, workflowDonInfo, s.dispatcher, aggregator, s.lggr)
err = s.registry.Add(ctx, triggerCap)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion core/chains/evm/client/simulated_backend_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ func (c *SimulatedBackendClient) EstimateGas(ctx context.Context, call ethereum.

// SuggestGasPrice recommends a gas price.
func (c *SimulatedBackendClient) SuggestGasPrice(ctx context.Context) (*big.Int, error) {
panic("unimplemented")
return c.b.SuggestGasPrice(ctx)
}

// BatchCallContext makes a batch rpc call.
Expand Down
2 changes: 1 addition & 1 deletion core/scripts/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ require (
github.com/prometheus/client_golang v1.17.0
github.com/shopspring/decimal v1.3.1
github.com/smartcontractkit/chainlink-automation v1.0.3
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240517134904-f4446b816a28
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240521170829-83ce604cf618
github.com/smartcontractkit/chainlink-vrf v0.0.0-20240222010609-cd67d123c772
github.com/smartcontractkit/chainlink/v2 v2.0.0-00010101000000-000000000000
github.com/smartcontractkit/libocr v0.0.0-20240419185742-fd3cab206b2c
Expand Down
4 changes: 2 additions & 2 deletions core/scripts/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1185,8 +1185,8 @@ github.com/smartcontractkit/chain-selectors v1.0.10 h1:t9kJeE6B6G+hKD0GYR4kGJSCq
github.com/smartcontractkit/chain-selectors v1.0.10/go.mod h1:d4Hi+E1zqjy9HqMkjBE5q1vcG9VGgxf5VxiRHfzi2kE=
github.com/smartcontractkit/chainlink-automation v1.0.3 h1:h/ijT0NiyV06VxYVgcNfsE3+8OEzT3Q0Z9au0z1BPWs=
github.com/smartcontractkit/chainlink-automation v1.0.3/go.mod h1:RjboV0Qd7YP+To+OrzHGXaxUxoSONveCoAK2TQ1INLU=
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240517134904-f4446b816a28 h1:Pr8/CdiTNnzRwpYc2z7NpHYbw3Dpl1eqiqt9/J/Bcqc=
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240517134904-f4446b816a28/go.mod h1:s+68EchlrXqHKRW3JJgZLEARvzMSKRI5+cE5Zx7pVJA=
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240521170829-83ce604cf618 h1:0aR8bbEaUXObEVvn6jayWO0zE0Hn0m+xv1R5V2hvQ6w=
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240521170829-83ce604cf618/go.mod h1:s+68EchlrXqHKRW3JJgZLEARvzMSKRI5+cE5Zx7pVJA=
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240508101745-af1ed7bc8a69 h1:Sec/GpBpUVaTEax1kSHlTvkzF/+d3w5roAQXaj5+SLA=
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240508101745-af1ed7bc8a69/go.mod h1:ZQKf+0OLzCLYIisH/OdOIQuFRI6bDuw+jPBTATyHfFM=
github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240220203239-09be0ea34540 h1:xFSv8561jsLtF6gYZr/zW2z5qUUAkcFkApin2mnbYTo=
Expand Down
Loading

0 comments on commit d3ecbda

Please sign in to comment.