Skip to content

Commit

Permalink
update config
Browse files Browse the repository at this point in the history
  • Loading branch information
anirudhwarrier committed Mar 26, 2024
1 parent 9929417 commit e6989f8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
11 changes: 9 additions & 2 deletions integration-tests/load/automationv2_1/automationv2_1_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package automationv2_1

import (
"context"
"encoding/hex"
"fmt"
"math"
"math/big"
Expand Down Expand Up @@ -382,6 +383,7 @@ Load Config:
PerformBurnAmount: u.PerformBurnAmount,
UpkeepGasLimit: u.UpkeepGasLimit,
SharedTrigger: u.SharedTrigger,
Feeds: u.Feeds,
}

loadConfigs = append(loadConfigs, loadCfg)
Expand Down Expand Up @@ -415,17 +417,22 @@ Load Config:
}
encodedLogTriggerConfig, err := convenienceABI.Methods["_logTriggerConfig"].Inputs.Pack(&logTriggerConfigStruct)
require.NoError(t, err, "Error encoding log trigger config")
l.Debug().Bytes("Encoded Log Trigger Config", encodedLogTriggerConfig).Msg("Encoded Log Trigger Config")
l.Debug().
Interface("logTriggerConfigStruct", logTriggerConfigStruct).
Str("Encoded Log Trigger Config", hex.EncodeToString(encodedLogTriggerConfig)).Msg("Encoded Log Trigger Config")

checkDataStruct := simple_log_upkeep_counter_wrapper.CheckData{
CheckBurnAmount: loadConfigs[i].CheckBurnAmount,
PerformBurnAmount: loadConfigs[i].PerformBurnAmount,
EventSig: bytes1,
Feeds: loadConfigs[i].Feeds,
}

encodedCheckDataStruct, err := consumerABI.Methods["_checkDataConfig"].Inputs.Pack(&checkDataStruct)
require.NoError(t, err, "Error encoding check data struct")
l.Debug().Bytes("Encoded Check Data Struct", encodedCheckDataStruct).Msg("Encoded Check Data Struct")
l.Debug().
Interface("checkDataStruct", checkDataStruct).
Str("Encoded Check Data Struct", hex.EncodeToString(encodedCheckDataStruct)).Msg("Encoded Check Data Struct")

upkeepConfig := automationv2.UpkeepConfig{
UpkeepName: fmt.Sprintf("LogTriggerUpkeep-%d", i),
Expand Down
6 changes: 6 additions & 0 deletions integration-tests/testconfig/automation/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ type Load struct {
SharedTrigger *bool `toml:"shared_trigger"`
UpkeepGasLimit *uint32 `toml:"upkeep_gas_limit"`
IsStreamsLookup *bool `toml:"is_streams_lookup"`
Feeds []string `toml:"feeds"`
}

func (c *Load) Validate() error {
Expand All @@ -93,6 +94,11 @@ func (c *Load) Validate() error {
if c.PerformBurnAmount == nil || c.PerformBurnAmount.Cmp(big.NewInt(0)) < 0 {
return errors.New("perform_burn_amount must be set to a non-negative integer")
}
if c.IsStreamsLookup == nil || *c.IsStreamsLookup {
if c.Feeds == nil {
c.Feeds = []string{}
}
}

return nil
}
Expand Down

0 comments on commit e6989f8

Please sign in to comment.