Skip to content

Commit 975a5a3

Browse files
committed
fix: handle errs setting values
1 parent 219a105 commit 975a5a3

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

pkg/commands/context/context_create.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,16 @@ func contextCreateAction(cCtx *cli.Context) error {
206206
bn254TableCalculator = common.MAINNET_BN254_TABLE_CALCULATOR_ADDRESS
207207
ecdsaTableCalculator = common.MAINNET_ECDSA_TABLE_CALCULATOR_ADDRESS
208208
}
209-
common.WriteToPath(contextNode, strings.Split("eigenlayer.l1.bn254_table_calculator", "."), bn254TableCalculator)
210-
common.WriteToPath(contextNode, strings.Split("eigenlayer.l1.ecdsa_table_calculator", "."), ecdsaTableCalculator)
209+
bn254TableCalculatorPath := "eigenlayer.l1.bn254_table_calculator"
210+
ecdsaTableCalculatorPath := "eigenlayer.l1.ecdsa_table_calculator"
211+
_, err = common.WriteToPath(contextNode, strings.Split(bn254TableCalculatorPath, "."), bn254TableCalculator)
212+
if err != nil {
213+
return fmt.Errorf("setting value %s to %s failed: %w", bn254TableCalculatorPath, bn254TableCalculator, err)
214+
}
215+
_, err = common.WriteToPath(contextNode, strings.Split(ecdsaTableCalculatorPath, "."), ecdsaTableCalculator)
216+
if err != nil {
217+
return fmt.Errorf("setting value %s to %s failed: %w", ecdsaTableCalculatorPath, ecdsaTableCalculator, err)
218+
}
211219

212220
// Save all updates to the yaml file
213221
if err := common.WriteYAML(yamlPath, rootNode); err != nil {

0 commit comments

Comments
 (0)