Skip to content

Commit

Permalink
Some fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
aopoltorzhicky committed Sep 14, 2022
1 parent 84a1445 commit 7052a16
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions build/dipdup.mainnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ metadata:
- https://ipfs.io
fallback: ${IPFS_NODE_URI}
bootstrap:
- /dnsaddr/ipfs.infura.io/tcp/5001/https
timeout: ${IPFS_TIMEOUT:-10}
delay: 10
http_timeout: 5
Expand Down
1 change: 1 addition & 0 deletions build/dipdup.thumbs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ metadata:
- https://ipfs.io
fallback: ${IPFS_NODE_URI}
bootstrap:
- /dnsaddr/ipfs.infura.io/tcp/5001/https
timeout: 10
delay: 10

Expand Down
1 change: 1 addition & 0 deletions build/dipdup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ metadata:
ipfs:
dir: /etc/metadata/ipfs
bootstrap:
- /dnsaddr/ipfs.infura.io/tcp/5001/https
gateways:
- https://ipfs.infura.io
- https://dweb.link
Expand Down
2 changes: 1 addition & 1 deletion cmd/metadata/contract.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func (indexer *Indexer) resolveContractMetadata(ctx context.Context, cm *models.
indexer.logContractMetadata(*cm, "Failed", "warn")
}
} else {
cm.Metadata = helpers.Escape(resolved.Data)
// cm.Metadata = helpers.Escape(resolved.Data)
if utf8.Valid(cm.Metadata) {
cm.Status = models.StatusApplied
cm.Error = ""
Expand Down
2 changes: 1 addition & 1 deletion cmd/metadata/models/contract_metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ type ContractMetadata struct {
Link string `json:"link"`
Status Status `json:"status"`
RetryCount int8 `json:"retry_count" pg:",use_zero"`
Metadata JSONB `json:"metadata,omitempty" pg:",type:jsonb,use_zero"`
Metadata JSONB `json:"metadata,omitempty" pg:",type:json,use_zero"`
Error string `json:"error,omitempty"`
}

Expand Down
4 changes: 2 additions & 2 deletions cmd/metadata/models/token_metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ type TokenMetadata struct {
Network string `json:"network" pg:",unique:token"`
Contract string `json:"contract" pg:",unique:token"`
Link string `json:"link"`
Metadata JSONB `json:"metadata,omitempty" pg:",type:jsonb,use_zero"`
Metadata JSONB `json:"metadata,omitempty" pg:",type:json,use_zero"`
RetryCount int8 `json:"retry_count" pg:",use_zero"`
Status Status `json:"status"`
ImageProcessed bool `json:"image_processed" pg:",use_zero,notnull"`
Expand Down Expand Up @@ -175,7 +175,7 @@ func (tokens *Tokens) Save(metadata []*TokenMetadata) error {
savings := make([]*TokenMetadata, 0)
has := make(map[string]struct{})
for i := len(metadata) - 1; i >= 0; i-- {
id := fmt.Sprintf("%s_%d", metadata[i].Contract, metadata[i].TokenID)
id := fmt.Sprintf("%s_%s", metadata[i].Contract, metadata[i].TokenID.String())
if _, ok := has[id]; !ok {
has[id] = struct{}{}
savings = append(savings, metadata[i])
Expand Down
2 changes: 1 addition & 1 deletion cmd/metadata/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ func (indexer *Indexer) resolveTokenMetadata(ctx context.Context, tm *models.Tok
indexer.logTokenMetadata(*tm, "failed", "warn")
}
} else {
resolved.Data = helpers.Escape(resolved.Data)
// resolved.Data = helpers.Escape(resolved.Data)
if utf8.Valid(resolved.Data) {
tm.Status = models.StatusApplied
tm.Error = ""
Expand Down

0 comments on commit 7052a16

Please sign in to comment.