Skip to content

Commit

Permalink
Add missing ctx
Browse files Browse the repository at this point in the history
  • Loading branch information
HenryNguyen5 committed Oct 17, 2024
1 parent e196f82 commit 7dfbe68
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
8 changes: 5 additions & 3 deletions core/scripts/keystone/src/03_deploy_streams_trigger_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,7 @@ func doesBridgeExist(api *nodeAPI, name string) bool {
}

func generateMercuryOCR2Config(nca []NodeKeys) MercuryOCR2Config {
ctx := context.Background()
f := uint8(1)
rawOnchainConfig := mercurytypes.OnchainConfig{
Min: big.NewInt(0),
Expand All @@ -570,7 +571,7 @@ func generateMercuryOCR2Config(nca []NodeKeys) MercuryOCR2Config {
BaseUSDFee: decimal.NewFromInt(0),
}

onchainConfig, err := (datastreamsmercury.StandardOnchainConfigCodec{}).Encode(rawOnchainConfig)
onchainConfig, err := (datastreamsmercury.StandardOnchainConfigCodec{}).Encode(ctx, rawOnchainConfig)
helpers.PanicErr(err)
reportingPluginConfig, err := json.Marshal(rawReportingPluginConfig)
helpers.PanicErr(err)
Expand Down Expand Up @@ -621,8 +622,9 @@ func generateMercuryOCR2Config(nca []NodeKeys) MercuryOCR2Config {
[]int{len(identities)}, // S
identities,
reportingPluginConfig, // reportingPluginConfig []byte,
250*time.Millisecond, // Max duration observation
int(f), // f
nil,
250*time.Millisecond, // Max duration observation
int(f), // f
onchainConfig,
)
signerAddresses, err := evm.OnchainPublicKeyToAddress(signers)
Expand Down
8 changes: 4 additions & 4 deletions core/services/relay/evm/mercury/transmitter.go
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ func (mt *mercuryTransmitter) HealthReport() map[string]error {
return report
}

func (mt *mercuryTransmitter) sendToTrigger(report ocrtypes.Report, rawReportCtx [3][32]byte, signatures []ocrtypes.AttributedOnchainSignature) error {
func (mt *mercuryTransmitter) sendToTrigger(ctx context.Context, report ocrtypes.Report, rawReportCtx [3][32]byte, signatures []ocrtypes.AttributedOnchainSignature) error {
rawSignatures := [][]byte{}
for _, sig := range signatures {
rawSignatures = append(rawSignatures, sig.Signature)
Expand All @@ -413,11 +413,11 @@ func (mt *mercuryTransmitter) sendToTrigger(report ocrtypes.Report, rawReportCtx
// after decoding and validating signatures.
}

price, err := mt.codec.BenchmarkPriceFromReport(report)
price, err := mt.codec.BenchmarkPriceFromReport(ctx, report)
if err != nil {
mt.lggr.Warn("Failed to decode benchmark price from report")
}
obsTs, err := mt.codec.ObservationTimestampFromReport(report)
obsTs, err := mt.codec.ObservationTimestampFromReport(ctx, report)
if err != nil {
mt.lggr.Warn("Failed to decode observation timestamp from report")
}
Expand All @@ -430,7 +430,7 @@ func (mt *mercuryTransmitter) Transmit(ctx context.Context, reportCtx ocrtypes.R
rawReportCtx := evmutil.RawReportContext(reportCtx)
if mt.triggerCapability != nil {
// Acting as a Capability - send report to trigger service and exit.
return mt.sendToTrigger(report, rawReportCtx, signatures)
return mt.sendToTrigger(ctx, report, rawReportCtx, signatures)
}

var rs [][32]byte
Expand Down

0 comments on commit 7dfbe68

Please sign in to comment.