Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
tudor-malene committed Mar 10, 2024
1 parent b38ee73 commit c3477ee
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions tools/walletextension/rpcapi/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"crypto/sha256"
"encoding/json"
"fmt"
"reflect"
"time"

"github.com/ten-protocol/go-ten/tools/walletextension/cache"
Expand Down Expand Up @@ -74,9 +73,15 @@ func ExecAuthRPC[R any](ctx context.Context, w *Services, cfg *ExecCfg, method s
acc := user.accounts[*addr]
if acc == nil {
// todo - return an account
a := reflect.ValueOf(user.accounts).MapKeys()[0].Interface().(common.Address)
candidateAccts = append(candidateAccts, user.accounts[a])
break
if len(user.accounts) > 0 {
randomUserAddr := user.GetAllAddresses()[0]
candidateAccts = append(candidateAccts, user.accounts[*randomUserAddr])
break
}
defaultUser, err := getUser([]byte(common2.DefaultUser), w.Storage)
println(err)
randomUserAddr := defaultUser.GetAllAddresses()[0]
candidateAccts = append(candidateAccts, defaultUser.accounts[*randomUserAddr])
}
candidateAccts = append(candidateAccts, acc)

Expand Down

0 comments on commit c3477ee

Please sign in to comment.