Skip to content

Commit 5dc1fdb

Browse files
committed
fixup! 6a8b7ad
1 parent b3d2909 commit 5dc1fdb

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

backend/pkg/api/data_access/search.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,8 @@ func (d *DataAccessService) GetSearchAddress(ctx context.Context, chainId uint64
152152
foundAddress := *eth1AddressSearchItem[0]
153153
return &t.SearchAddress{
154154
Address: t.Address{
155-
Hash: t.Hash("0x" + foundAddress.Address),
156-
Label: foundAddress.Name,
157-
IsContract: foundAddress.Token != "",
155+
Hash: t.Hash("0x" + foundAddress.Address),
156+
// TODO: implement finding contract status / name
158157
},
159158
}, nil
160159
}
@@ -207,6 +206,8 @@ func (d *DataAccessService) GetSearchEpoch(ctx context.Context, chainId uint64,
207206
}
208207

209208
func (d *DataAccessService) GetSearchToken(ctx context.Context, chainId uint64, address []byte) (*t.SearchToken, error) {
209+
// TODO: find erc721 and erc1155 tokens
210+
// currently only erc20 tokens supported
210211
eth1AddressSearchItem, err := d.bigtable.SearchForAddress(address, 1)
211212
if err != nil {
212213
return nil, fmt.Errorf("failed to search for address %s: %w", hexutil.Encode(address), err)

backend/pkg/api/types/search.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package types
22

3-
// search types to be used between the data access layer and the api layer, shouldn't be exported to typescript
4-
53
type PostSearchRequest struct {
64
Input string `json:"input"`
75
Networks []interface{} `json:"networks,omitempty" tstype:"(number | string)[]"`
@@ -53,7 +51,7 @@ type SearchEpoch struct {
5351

5452
type SearchToken struct {
5553
Address Address `json:"address"`
56-
Token string `json:"token" tstype:"'erc20' | 'erc721' | 'erc1155'"`
54+
Token string `json:"token" tstype:"'erc20' | 'erc721' | 'erc1155'"` // currently only erc20 tokens can be found
5755
}
5856

5957
type SearchResult struct {

0 commit comments

Comments
 (0)