Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions relayer/chain/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,13 @@ func newChain(cfg *config.TOMLConfig, loopKs loop.Keystore, lggr logger.Logger,

if cfg.Chain.Workflow != nil {
cfg.Chain.Workflow.PublicKey = accounts[0]
if cfg.Chain.Workflow.FromAddress == "" {
addr, err := utils.HexPublicKeyToAddressString(accounts[0])
if err != nil {
return nil, fmt.Errorf("failed to derive account address from public key: %w", err)
}
cfg.Chain.Workflow.FromAddress = addr
}
}

ch := &chain{
Expand Down
4 changes: 2 additions & 2 deletions relayer/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ type ConfigSet struct { //nolint:revive

type WorkflowConfig struct {
ForwarderAddress string
// FromAddress string
PublicKey string
FromAddress string // explicit account address (optional, derived from PublicKey if empty)
PublicKey string
}

type Chain struct {
Expand Down
3 changes: 2 additions & 1 deletion relayer/write_target/aptos/write_target.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ func NewAptosWriteTarget(ctx context.Context, chain chain.Chain, lggr logger.Log
"forwarder": {
Functions: map[string]*chainwriter.ChainWriterFunction{
"report": {
PublicKey: config.Workflow.PublicKey,
PublicKey: config.Workflow.PublicKey,
FromAddress: config.Workflow.FromAddress,
Params: []crconfig.AptosFunctionParam{
{
Name: "Receiver",
Expand Down
Loading