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

feat(extractor): add GnoScan link to metadata #13

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions extractor/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
// Define constants
const (
packageMetadataFile = "pkg_metadata.json"
gnoscanPathURL = "https://gnoscan.io/realms/details?path="
)

var (
Expand Down
2 changes: 2 additions & 0 deletions extractor/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ import (
type Metadata struct {
Creator string `json:"creator"` // the creator of the source code (deployer)
Deposit string `json:"deposit"` // the deposit associated with the deployment
PkgPath string `json:"pkgpath"`
}

// metadataFromMsg extracts the metadata from a message
func metadataFromMsg(msg vm.MsgAddPackage) Metadata {
return Metadata{
Creator: msg.Creator.String(),
Deposit: msg.Deposit.String(),
PkgPath: gnoscanPathURL + msg.Package.Path,
}
}
Empty file.
Empty file.
Empty file.
2 changes: 1 addition & 1 deletion test2.gno.land/metadata.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"latest_block_height": 863638
"latest_block_height": 865077
}
2 changes: 1 addition & 1 deletion test3.gno.land/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## TXs
```
3730
4034
```

## addpkgs
Expand Down
172 changes: 172 additions & 0 deletions test3.gno.land/backup_0238349-0240043.jsonl

Large diffs are not rendered by default.

84 changes: 84 additions & 0 deletions test3.gno.land/backup_0240043-0241594.jsonl

Large diffs are not rendered by default.

48 changes: 48 additions & 0 deletions test3.gno.land/backup_0241560-0243072.jsonl

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test3.gno.land/metadata.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"latest_block_height": 241560
"latest_block_height": 243072
}