Skip to content

Commit

Permalink
feat: add V3 wallet config support in Deploy method
Browse files Browse the repository at this point in the history
  • Loading branch information
shunkakinoki committed Mar 4, 2025
1 parent 2b1199d commit 4777b97
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 0 additions & 2 deletions relayer/local_relayer.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,6 @@ func (r *LocalRelayer) Relay(ctx context.Context, signedTxs *sequence.SignedTran
}

func (r *LocalRelayer) RelayV3(ctx context.Context, signedTxs *sequence.SignedTransactions, quote ...*sequence.RelayerFeeQuote) (sequence.MetaTxnID, *types.Transaction, ethtxn.WaitReceipt, error) {
fmt.Println("Relaying V3 Local Relayer")

sender := r.Sender

to, execdata, err := sequence.EncodeTransactionsForRelayingV3(
Expand Down
14 changes: 13 additions & 1 deletion wallet.go
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,19 @@ func (w *Wallet[C]) Deploy(ctx context.Context) (MetaTxnID, *types.Transaction,
return "", nil, nil, err
}

return w.relayer.Relay(ctx, signerTxn)
_, isV1 := core.WalletConfig(w.config).(*v1.WalletConfig)
_, isV2 := core.WalletConfig(w.config).(*v2.WalletConfig)
_, isV3 := core.WalletConfig(w.config).(*v3.WalletConfig)

if isV1 || isV2 {
return w.relayer.Relay(ctx, signerTxn)
}

if isV3 {
return w.relayer.RelayV3(ctx, signerTxn)
}

return "", nil, nil, fmt.Errorf("unknown wallet config type")
}

// func (w *Wallet) UpdateConfig() // TODO in future
Expand Down

0 comments on commit 4777b97

Please sign in to comment.