func (w localWallet) PrefixSearch(key string) (ed25519.PublicKey, bool) {
	matches := make([]ed25519.PublicKey, 0)

	for _, storeKey := range w {
		storeKeyString := hex.EncodeToString(storeKey.PublicKey[:])
		if strings.HasPrefix(storeKeyString, key) {
			match := make(ed25519.PublicKey, len(storeKey.PublicKey))
			copy(match, storeKey.PublicKey)
			matches = append(matches, match)
		}
	}

	if len(matches) == 1 {
		return matches[0], true
	}

	return nil, false
}
// searches for a key in the localWallet starting with the given string
// in the case of ambiguity the function returns (nil, false)
searches for a key in the localWallet starting with the given string
in the case of ambiguity the function returns (nil, false)
// searches for a key in the localWallet starting with the given string // in the case of ambiguity the function returns ( nil false )
func (w localWallet) PrefixSearch(key string) (ed25519.PublicKey, bool) {
	matches := make([]ed25519.PublicKey, 0)
	for _, storeKey := range w {
		storeKeyString := hex.EncodeToString(storeKey.PublicKey[:])
		if strings.HasPrefix(storeKeyString, key) {
			match := make(ed25519.PublicKey, len(storeKey.PublicKey))
			copy(match, storeKey.PublicKey)
			matches = append(matches, match)
		}
	}
	if len(matches) == 1 {
		return matches[0], true
	}
	return nil, false
}
func ( w localWallet ) PrefixSearch ( key string ) ( ed25519 . PublicKey , bool ) { matches := make ( [ ] ed25519 . PublicKey , 0 ) for _ , storeKey := range w { storeKeyString := hex . EncodeToString ( storeKey . PublicKey [ : ] ) if strings . HasPrefix ( storeKeyString , key ) { match := make ( ed25519 . PublicKey , len ( storeKey . PublicKey ) ) copy ( match , storeKey . PublicKey ) matches = append ( matches , match ) } } if len ( matches ) == 1 { return matches [ 0 ] , true } return nil , false }
searches for a key in the localWallet starting with the given string
in the case of ambiguity the function returns (nil, false)
searches for a key in the localWallet starting with the given string in the case of ambiguity the function returns ( nil false )