Skip to content

Commit

Permalink
RpcRelayer remove add deploy if wallet not deployed
Browse files Browse the repository at this point in the history
This is now done in api waas.
  • Loading branch information
marino39 committed Dec 13, 2023
1 parent a030781 commit 2d97513
Showing 1 changed file with 0 additions and 38 deletions.
38 changes: 0 additions & 38 deletions relayer/rpc_relayer.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
"github.com/0xsequence/ethkit/go-ethereum/common/hexutil"
"github.com/0xsequence/ethkit/go-ethereum/core/types"
"github.com/0xsequence/go-sequence"
"github.com/0xsequence/go-sequence/contracts"
"github.com/0xsequence/go-sequence/core"
v1 "github.com/0xsequence/go-sequence/core/v1"
v2 "github.com/0xsequence/go-sequence/core/v2"
Expand Down Expand Up @@ -154,43 +153,6 @@ func (r *RpcRelayer) Relay(ctx context.Context, signedTxs *sequence.SignedTransa

if r.IsDeployTransaction(signedTxs) {
to = signedTxs.WalletContext.GuestModuleAddress
} else {
isDeployed, err := sequence.IsWalletDeployed(r.GetProvider(), to)
if err != nil {
return "", nil, nil, err
}

if !isDeployed {
_, factoryAddress, deployData, err := sequence.EncodeWalletDeployment(signedTxs.WalletConfig, signedTxs.WalletContext)
if err != nil {
return "", nil, nil, err
}

txns := sequence.Transactions{
{
RevertOnError: true,
To: factoryAddress,
Data: deployData,
},
{
RevertOnError: true,
To: to,
Data: execdata,
},
}

encodedTxns, err := txns.EncodedTransactions()
if err != nil {
return "", nil, nil, err
}

execdata, err = contracts.WalletMainModule.Encode("execute", encodedTxns, big.NewInt(0), []byte{})
if err != nil {
return "", nil, nil, err
}

to = signedTxs.WalletContext.GuestModuleAddress
}
}

call := &proto.MetaTxn{
Expand Down

0 comments on commit 2d97513

Please sign in to comment.