Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/tzip 16 #1014

Merged
merged 26 commits into from
Jul 30, 2021
Merged

Feature/tzip 16 #1014

merged 26 commits into from
Jul 30, 2021

Conversation

piotrkosecki
Copy link
Contributor

Resolves #999

Implemented handling of the tzip-16 metadata fetching as described in the ticket.

sql/conseil.sql Outdated
address text NOT NULL,
raw_metadata text NOT NULL,
name text NOT NULL,
desctiption text,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

import scala.concurrent.{ExecutionContext, Future}
import scala.util.Try

class MetadataProcessor(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A comment explaining the purpose of this class and how it works would be very useful here.


object Tzip16 {

private def proceduralDecode(hex: String): String = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please leave a note about the function here.

fetch[(Tables.RegisteredTokensRow, Tables.BigMapContentsRow, String), Option[(String, Tzip16Metadata)], Future, List, Throwable]
.run(addresses)

def getHttpMetadataWithRegisteredTokensRow(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove.

val showHashes = hashes.mkString(", ")
logger
.error(
s"I encountered problems while fetching baking rights from TZIP-16 for blocks $showHashes. The error says ${err.getMessage}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix please

case ((ipfs, http), acc) if acc._3.startsWith("ipfs") => (acc :: ipfs, http)
case ((ipfs, http), acc) if acc._3.startsWith("http") => (ipfs, acc :: http)
}
println(metadata)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove please.

@sonarcloud
Copy link

sonarcloud bot commented Jul 30, 2021

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 7 Code Smells

No Coverage information No Coverage information
4.9% 4.9% Duplication

@vishakh vishakh merged commit 7040979 into master Jul 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handling tzip-16 compatible contracts
2 participants