Skip to content

Commit

Permalink
do not return duplicate default salt wallet (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
v9n authored Dec 7, 2024
1 parent 049bc66 commit e4c5ab1
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions core/taskengine/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ var (
// These macro are define in our aggregator yaml config file under `macros`
macroEnvs map[string]string
cache *bigcache.BigCache

defaultSalt = big.NewInt(0)
)

// Set a global logger for task engine
Expand Down Expand Up @@ -169,8 +171,7 @@ func (n *Engine) MustStart() {
}

func (n *Engine) GetSmartWallets(owner common.Address) ([]*avsproto.SmartWallet, error) {
salt := big.NewInt(0)
sender, err := aa.GetSenderAddress(rpcConn, owner, salt)
sender, err := aa.GetSenderAddress(rpcConn, owner, defaultSalt)
if err != nil {
return nil, status.Errorf(codes.Code(avsproto.Error_SmartWalletNotFoundError), SmartAccountCreationError)
}
Expand All @@ -180,7 +181,7 @@ func (n *Engine) GetSmartWallets(owner common.Address) ([]*avsproto.SmartWallet,
&avsproto.SmartWallet{
Address: sender.String(),
Factory: n.smartWalletConfig.FactoryAddress.String(),
Salt: salt.String(),
Salt: defaultSalt.String(),
},
}

Expand All @@ -195,6 +196,10 @@ func (n *Engine) GetSmartWallets(owner common.Address) ([]*avsproto.SmartWallet,
w := &model.SmartWallet{}
w.FromStorageData(item.Value)

if w.Salt.Cmp(defaultSalt) == 0 {
continue
}

wallets = append(wallets, &avsproto.SmartWallet{
Address: w.Address.String(),
Factory: w.Factory.String(),
Expand Down

0 comments on commit e4c5ab1

Please sign in to comment.