Skip to content

Commit

Permalink
Add missing initialization code for Aptos
Browse files Browse the repository at this point in the history
  • Loading branch information
archseer committed Jul 16, 2024
1 parent d6986f7 commit dd494d7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
9 changes: 9 additions & 0 deletions core/cmd/shell_local.go
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,9 @@ func (s *Shell) runNode(c *cli.Context) error {
if s.Config.StarkNetEnabled() {
enabledChains = append(enabledChains, chaintype.StarkNet)
}
if s.Config.AptosEnabled() {
enabledChains = append(enabledChains, chaintype.Aptos)
}
err2 := app.GetKeyStore().OCR2().EnsureKeys(rootCtx, enabledChains...)
if err2 != nil {
return errors.Wrap(err2, "failed to ensure ocr key")
Expand Down Expand Up @@ -464,6 +467,12 @@ func (s *Shell) runNode(c *cli.Context) error {
return errors.Wrap(err2, "failed to ensure starknet key")
}
}
if s.Config.AptosEnabled() {
err2 := app.GetKeyStore().Aptos().EnsureKey(rootCtx)
if err2 != nil {
return errors.Wrap(err2, "failed to ensure aptos key")
}
}

err2 := app.GetKeyStore().CSA().EnsureKey(rootCtx)
if err2 != nil {
Expand Down
7 changes: 7 additions & 0 deletions core/internal/cltest/cltest.go
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,13 @@ func NewApplicationWithConfig(t testing.TB, cfg chainlink.GeneralConfig, flagsAn
}
initOps = append(initOps, chainlink.InitStarknet(testCtx, relayerFactory, starkCfg))
}
if cfg.AptosEnabled() {
aptosCfg := chainlink.AptosFactoryConfig{
Keystore: keyStore.Aptos(),
TOMLConfigs: cfg.AptosConfigs(),
}
initOps = append(initOps, chainlink.InitAptos(testCtx, relayerFactory, aptosCfg))
}
relayChainInterops, err := chainlink.NewCoreRelayerChainInteroperators(initOps...)
if err != nil {
t.Fatal(err)
Expand Down

0 comments on commit dd494d7

Please sign in to comment.