mirror of
https://github.com/sonr-io/sonr.git
synced 2026-08-03 01:41:44 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1d569d35b4 | ||
|
|
4e8db8d3d4 | ||
|
|
02f161f76c | ||
|
|
c17bdebffd | ||
|
|
279ab6e5e3 | ||
|
|
0a16e41c78 | ||
|
|
45c4e0c850 | ||
|
|
32563a551d | ||
|
|
a824c23022 | ||
|
|
58a02be5cf | ||
|
|
5df9d4a3e5 | ||
|
|
a3edb65613 | ||
|
|
3637f27369 | ||
|
|
8811f56559 | ||
|
|
e1db07cc25 | ||
|
|
e928ce22b4 | ||
|
|
2970497683 | ||
|
|
25cddbada6 | ||
|
|
35348fef6a | ||
|
|
f6879f1c12 | ||
|
|
c3e8fcc3d3 | ||
|
|
8ac1ccaa34 | ||
|
|
a7d604555a | ||
|
|
8bc356774a | ||
|
|
1dfba6ffbb | ||
|
|
e4c8997bf3 | ||
|
|
980c474bdf | ||
|
|
ded13c232c | ||
|
|
a8b6eead26 | ||
|
|
81c800ce54 | ||
|
|
c983b77c4f | ||
|
|
b5dc577d01 | ||
|
|
ca51df20d6 | ||
|
|
b19d5d06a0 | ||
|
|
2772e568d5 | ||
|
|
59944e19db | ||
|
|
ba4483b5ec | ||
|
|
fbc640b7c4 | ||
|
|
af6e07323b | ||
|
|
e926e5b9d6 | ||
|
|
ddf745f39a | ||
|
|
d0dddbfe01 | ||
|
|
c608a067ed | ||
|
|
fa7b11198e | ||
|
|
8bd68c4269 | ||
|
|
55f3e0f7e0 | ||
|
|
f7f0c11587 | ||
|
|
b633d21ea8 | ||
|
|
2d5cb7e5b8 | ||
|
|
dba9a119ef | ||
|
|
6fc52fd62d | ||
|
|
37fb0b3aca | ||
|
|
c35d3bb1ae | ||
|
|
ab476712af | ||
|
|
e424faaba2 | ||
|
|
b68b47ab32 | ||
|
|
bda8171af4 | ||
|
|
bac98b5e38 | ||
|
|
0f2a5bf2b4 | ||
|
|
9ebd80f740 | ||
|
|
a76d264a0c | ||
|
|
0be7ed7ecf | ||
|
|
5c6303486c | ||
|
|
2ccd2cea22 | ||
|
|
d93c19c2ab | ||
|
|
4e98504813 | ||
|
|
ab0bd3a5e1 | ||
|
|
62628ed0d8 | ||
|
|
b1e5464843 | ||
|
|
8e1359f126 | ||
|
|
f84a87574c | ||
|
|
1c16d367ed | ||
|
|
dc191fdbba | ||
|
|
875c410443 | ||
|
|
bcf5dfa70c | ||
|
|
77d76938a3 | ||
|
|
1267bc426a | ||
|
|
5e74045f3d | ||
|
|
3adf42925d | ||
|
|
f95fa2c906 | ||
|
|
ac2f65844c | ||
|
|
546dd7b4ad | ||
|
|
fcf4ab5b4f | ||
|
|
c57d5e8f1a | ||
|
|
cd57226a45 | ||
|
|
f5a11061ac | ||
|
|
93a3d814d6 | ||
|
|
a0e24880c3 | ||
|
|
e63ec7f22a | ||
|
|
6910a415a2 | ||
|
|
fccb42761c | ||
|
|
f75ff0d3be | ||
|
|
931ac2308d | ||
|
|
42c5ab642e | ||
|
|
8d8935c045 | ||
|
|
3baec2745b | ||
|
|
df72b55fe3 | ||
|
|
cbc5a35bcd | ||
|
|
959562c5ff | ||
|
|
84aa1dd79e | ||
|
|
d49a579cd6 | ||
|
|
1a3641e605 | ||
|
|
a05d1bb5d2 | ||
|
|
aaea70786b | ||
|
|
3d17feef0a | ||
|
|
9e938adc29 | ||
|
|
8ef7a7eab7 | ||
|
|
03f822b117 | ||
|
|
ae56055640 | ||
|
|
75c65228fc | ||
|
|
52b9f60261 | ||
|
|
edb109b542 | ||
|
|
d62fb30eb8 | ||
|
|
c1bdcc2d93 | ||
|
|
35bedf8f65 | ||
|
|
7f54ad66f7 | ||
|
|
0b70938525 | ||
|
|
5a2ac6ae31 | ||
|
|
3aed1522cd | ||
|
|
b5ad833965 | ||
|
|
a8c48d4961 | ||
|
|
b56c98c678 | ||
|
|
cea6b77fdd | ||
|
|
5bc9ff07c0 | ||
|
|
08451a846c | ||
|
|
fa6bb93c78 | ||
|
|
f5f0578dcc | ||
|
|
ca2aa476d9 | ||
|
|
ab33d8235f | ||
|
|
730cda4390 |
@@ -1,49 +0,0 @@
|
|||||||
root = "."
|
|
||||||
testdata_dir = "testdata"
|
|
||||||
tmp_dir = "tmp"
|
|
||||||
|
|
||||||
[build]
|
|
||||||
delay = 1000
|
|
||||||
cmd = "devbox run build:motr"
|
|
||||||
exclude_dir = ["assets", "tmp", "vendor", "testdata"]
|
|
||||||
exclude_file = []
|
|
||||||
exclude_regex = ["_test.go"]
|
|
||||||
exclude_unchanged = true
|
|
||||||
follow_symlink = false
|
|
||||||
full_bin = "devbox run start"
|
|
||||||
include_dir = ["cmd/dwn", "cmd/motr", "internal", "models", "pkl"]
|
|
||||||
include_ext = ["go", "templ", "html", "pkl", "js", "mjs", "proto"]
|
|
||||||
include_file = [
|
|
||||||
"Dockerfile",
|
|
||||||
".goreleaser.yaml",
|
|
||||||
"go.mod",
|
|
||||||
"devbox.json",
|
|
||||||
".air.toml",
|
|
||||||
]
|
|
||||||
kill_delay = "10s"
|
|
||||||
log = "build-errors.log"
|
|
||||||
poll = false
|
|
||||||
poll_interval = 0
|
|
||||||
post_cmd = ["devbox run stop"]
|
|
||||||
pre_cmd = ["templ generate"]
|
|
||||||
rerun = false
|
|
||||||
rerun_delay = 1000
|
|
||||||
send_interrupt = true
|
|
||||||
stop_on_error = false
|
|
||||||
|
|
||||||
[color]
|
|
||||||
build = "yellow"
|
|
||||||
main = "magenta"
|
|
||||||
runner = "green"
|
|
||||||
watcher = "cyan"
|
|
||||||
|
|
||||||
[log]
|
|
||||||
main_only = true
|
|
||||||
time = true
|
|
||||||
|
|
||||||
[misc]
|
|
||||||
clean_on_exit = true
|
|
||||||
|
|
||||||
[screen]
|
|
||||||
clear_on_rebuild = true
|
|
||||||
keep_scroll = true
|
|
||||||
@@ -2,6 +2,6 @@
|
|||||||
name = "cz_conventional_commits"
|
name = "cz_conventional_commits"
|
||||||
tag_format = "v$version"
|
tag_format = "v$version"
|
||||||
version_scheme = "semver"
|
version_scheme = "semver"
|
||||||
version = "0.4.2"
|
version = "0.5.11"
|
||||||
update_changelog_on_bump = true
|
update_changelog_on_bump = true
|
||||||
major_version_zero = true
|
major_version_zero = true
|
||||||
|
|||||||
@@ -0,0 +1,38 @@
|
|||||||
|
name: Bug Report
|
||||||
|
description: File a bug report.
|
||||||
|
title: "ERROR: "
|
||||||
|
labels: ["#BUG", "#HELP"]
|
||||||
|
projects: ["onsonr/39"]
|
||||||
|
body:
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Operating System
|
||||||
|
description: What operating system are you using?
|
||||||
|
placeholder: "Example: macOS Big Sur"
|
||||||
|
value: operating system
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: dropdown
|
||||||
|
attributes:
|
||||||
|
label: Network
|
||||||
|
description: What network are you using?
|
||||||
|
multiple: false
|
||||||
|
options:
|
||||||
|
- LocalNet
|
||||||
|
- TestNet
|
||||||
|
- MainNet
|
||||||
|
default: 0
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: checkboxes
|
||||||
|
attributes:
|
||||||
|
label: Code of Conduct
|
||||||
|
description:
|
||||||
|
The Code of Conduct helps create a safe space for everyone. We require
|
||||||
|
that everyone agrees to it.
|
||||||
|
options:
|
||||||
|
- label: I agree to follow this project's [Code of Conduct](link/to/coc)
|
||||||
|
required: true
|
||||||
|
- type: markdown
|
||||||
|
attributes:
|
||||||
|
value: "Thanks for completing our form!"
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
blank_issues_enabled: false
|
||||||
|
contact_links:
|
||||||
|
- name: Community Discussions
|
||||||
|
url: https://github.com/orgs/onsonr/discussions
|
||||||
|
about: Please submit ideas and suggestions here.
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
name: Tracking issue
|
||||||
|
description: Use this template for tracking new features.
|
||||||
|
title: "(v0.6): FEATURE NAME"
|
||||||
|
labels: ["#TRACK", "#OKR"]
|
||||||
|
assignees: ["prnk28"]
|
||||||
|
projects: ["onsonr/37"]
|
||||||
|
body:
|
||||||
|
- type: checkboxes
|
||||||
|
attributes:
|
||||||
|
label: Is this associated with a milestone?
|
||||||
|
description: This is a tracking issue for tracking a new feature for a given milestone.
|
||||||
|
options:
|
||||||
|
- label: I have confirmed this is an OKR tracking issue
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Objective
|
||||||
|
description: Explain the objective of the feature and add any relevant links.
|
||||||
|
render: markdown
|
||||||
|
validations:
|
||||||
|
required: false
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Task List
|
||||||
|
description: |
|
||||||
|
Break down the objective into a list of tasks to be completed.
|
||||||
|
value: |
|
||||||
|
- [ ]
|
||||||
|
validations:
|
||||||
|
required: false
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
---
|
||||||
|
name: Default Todo
|
||||||
|
about: Break down feature requirements into tasks.
|
||||||
|
title: "Name of the new task"
|
||||||
|
labels:
|
||||||
|
- "#TODO"
|
||||||
|
- "#OKR"
|
||||||
|
assignees: "prnk28"
|
||||||
|
projects: "onsonr/37"
|
||||||
|
---
|
||||||
|
|
||||||
|
### Description
|
||||||
|
|
||||||
|
The expected deliverable of the task.
|
||||||
|
|
||||||
|
### Associated Files
|
||||||
|
|
||||||
|
These files will be modified by this task.
|
||||||
|
|
||||||
|
### References
|
||||||
|
|
||||||
|
Use these documents to help you complete the task.
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
<!--- Provide a general summary of your changes in the Title above -->
|
||||||
|
|
||||||
|
## Description
|
||||||
|
|
||||||
|
<!--- Describe your changes in detail -->
|
||||||
|
|
||||||
|
## Related Issue(s)
|
||||||
|
|
||||||
|
<!--- This project only accepts pull requests related to open issues -->
|
||||||
|
<!--- If suggesting a new feature or change, please discuss it in an issue first -->
|
||||||
|
<!--- If fixing a bug, there should be an issue describing it with steps to reproduce -->
|
||||||
|
<!--- Please link to the issue here: -->
|
||||||
|
|
||||||
|
## Motivation and Context
|
||||||
|
|
||||||
|
<!--- Why is this change required? What problem does it solve? -->
|
||||||
|
<!--- If it fixes an open issue, please link to the issue here. -->
|
||||||
|
|
||||||
|
## How Has This Been Tested?
|
||||||
|
|
||||||
|
<!--- Please describe in detail how you tested your changes. -->
|
||||||
|
<!--- Include details of your testing environment, and the tests you ran to -->
|
||||||
|
<!--- see how your change affects other areas of the code, etc. -->
|
||||||
|
|
||||||
|
## Screenshots (if appropriate):
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
# To get started with Dependabot version updates, you'll need to specify which
|
||||||
|
# package ecosystems to update and where the package manifests are located.
|
||||||
|
# Please see the documentation for all configuration options:
|
||||||
|
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
|
||||||
|
|
||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
- package-ecosystem: "gomod" # See documentation for possible values
|
||||||
|
directory: "/" # Location of package manifests
|
||||||
|
schedule:
|
||||||
|
interval: "weekly"
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
feature: ["feature/*", "feat/*"]
|
||||||
|
fix: fix/*
|
||||||
|
chore :hammer:: chore/*
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
name: Deploy Hway (sonr.id)
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- develop
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
deploy:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
name: Deploy Sonr.ID on Cloudflare
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Install devbox
|
||||||
|
uses: jetify-com/devbox-install-action@v0.11.0
|
||||||
|
- name: Deploy
|
||||||
|
uses: cloudflare/wrangler-action@v3
|
||||||
|
with:
|
||||||
|
apiToken: ${{ secrets.CF_WORKERS_TOKEN }}
|
||||||
|
workingDirectory: web
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
name: PR Labeler
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
types: [opened]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
pr-labeler:
|
||||||
|
permissions:
|
||||||
|
contents: read # for TimonVS/pr-labeler-action to read config file
|
||||||
|
pull-requests: write # for TimonVS/pr-labeler-action to add labels in PR
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: TimonVS/pr-labeler-action@v5
|
||||||
|
with:
|
||||||
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
configuration-path: .github/pr-labeler.yml # optional, .github/pr-labeler.yml is the default value
|
||||||
@@ -24,6 +24,25 @@ jobs:
|
|||||||
input: proto
|
input: proto
|
||||||
buf_token: ${{ secrets.BUF_TOKEN }}
|
buf_token: ${{ secrets.BUF_TOKEN }}
|
||||||
|
|
||||||
|
#
|
||||||
|
# upload_configs:
|
||||||
|
# runs-on: ubuntu-latest
|
||||||
|
# name: Publish to configs.sonr.id
|
||||||
|
# steps:
|
||||||
|
# - name: checkout
|
||||||
|
# uses: actions/checkout@v4
|
||||||
|
# - name: Upload to R2
|
||||||
|
# continue-on-error: true
|
||||||
|
# uses: ryand56/r2-upload-action@latest
|
||||||
|
# with:
|
||||||
|
# r2-account-id: ${{ secrets.R2_ACCOUNT_ID }}
|
||||||
|
# r2-access-key-id: ${{ secrets.R2_ACCESS_KEY_ID }}
|
||||||
|
# r2-secret-access-key: ${{ secrets.R2_SECRET_ACCESS_KEY }}
|
||||||
|
# r2-bucket: configs
|
||||||
|
# source-dir: config
|
||||||
|
# destination-dir: ./pkl
|
||||||
|
#
|
||||||
|
|
||||||
upload_pkl:
|
upload_pkl:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
name: Publish to pkl.sh
|
name: Publish to pkl.sh
|
||||||
@@ -53,5 +72,5 @@ jobs:
|
|||||||
r2-access-key-id: ${{ secrets.R2_ACCESS_KEY_ID }}
|
r2-access-key-id: ${{ secrets.R2_ACCESS_KEY_ID }}
|
||||||
r2-secret-access-key: ${{ secrets.R2_SECRET_ACCESS_KEY }}
|
r2-secret-access-key: ${{ secrets.R2_SECRET_ACCESS_KEY }}
|
||||||
r2-bucket: nebula
|
r2-bucket: nebula
|
||||||
source-dir: pkg/nebula/assets
|
source-dir: nebula/assets
|
||||||
destination-dir: .
|
destination-dir: .
|
||||||
|
|||||||
@@ -0,0 +1,60 @@
|
|||||||
|
name: Run Tests
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- feature/*
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test-unit:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
name: Run Unit Tests
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
repository: onsonr/sonr
|
||||||
|
fetch-depth: 0
|
||||||
|
fetch-tags: true
|
||||||
|
|
||||||
|
- uses: actions/setup-go@v5
|
||||||
|
with:
|
||||||
|
go-version: "1.22"
|
||||||
|
check-latest: true
|
||||||
|
- run: make test-unit
|
||||||
|
|
||||||
|
test-race:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
name: Run Race Tests
|
||||||
|
continue-on-error: true
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
repository: onsonr/sonr
|
||||||
|
fetch-depth: 0
|
||||||
|
fetch-tags: true
|
||||||
|
|
||||||
|
- uses: actions/setup-go@v5
|
||||||
|
with:
|
||||||
|
go-version: "1.22"
|
||||||
|
check-latest: true
|
||||||
|
- run: make test-race
|
||||||
|
|
||||||
|
test-cover:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
name: Run Coverage Tests
|
||||||
|
continue-on-error: true
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
repository: onsonr/sonr
|
||||||
|
fetch-depth: 0
|
||||||
|
fetch-tags: true
|
||||||
|
|
||||||
|
- uses: actions/setup-go@v5
|
||||||
|
with:
|
||||||
|
go-version: "1.22"
|
||||||
|
check-latest: true
|
||||||
|
- run: make test-cover
|
||||||
@@ -27,6 +27,12 @@ jobs:
|
|||||||
go-version: "1.22"
|
go-version: "1.22"
|
||||||
check-latest: true
|
check-latest: true
|
||||||
|
|
||||||
|
- name: Login to Docker Hub
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
|
||||||
- name: Release
|
- name: Release
|
||||||
uses: goreleaser/goreleaser-action@v6
|
uses: goreleaser/goreleaser-action@v6
|
||||||
with:
|
with:
|
||||||
@@ -37,3 +43,6 @@ jobs:
|
|||||||
GITHUB_TOKEN: ${{ secrets.GH_RELEASER_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GH_RELEASER_TOKEN }}
|
||||||
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
|
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
|
||||||
GITHUB_PERSONAL_AUTH_TOKEN: ${{ secrets.GH_RELEASER_TOKEN }}
|
GITHUB_PERSONAL_AUTH_TOKEN: ${{ secrets.GH_RELEASER_TOKEN }}
|
||||||
|
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
||||||
|
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }}
|
||||||
|
|||||||
+7
-46
@@ -1,3 +1,4 @@
|
|||||||
|
# yaml-language-server: $schema=https://goreleaser.com/static/schema-pro.json
|
||||||
version: 2
|
version: 2
|
||||||
project_name: sonr
|
project_name: sonr
|
||||||
|
|
||||||
@@ -13,26 +14,6 @@ builds:
|
|||||||
ldflags:
|
ldflags:
|
||||||
- -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}}
|
- -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}}
|
||||||
|
|
||||||
- id: motr
|
|
||||||
goos: [linux, darwin]
|
|
||||||
goarch: [amd64, arm64]
|
|
||||||
main: ./cmd/motr
|
|
||||||
binary: motr
|
|
||||||
builder: go
|
|
||||||
gobinary: go
|
|
||||||
command: build
|
|
||||||
ldflags:
|
|
||||||
- -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}}
|
|
||||||
|
|
||||||
- id: dwn
|
|
||||||
goos: [js]
|
|
||||||
goarch: [wasm]
|
|
||||||
main: ./cmd/dwn/dwn.go
|
|
||||||
binary: dwn
|
|
||||||
builder: go
|
|
||||||
gobinary: go
|
|
||||||
command: build
|
|
||||||
|
|
||||||
archives:
|
archives:
|
||||||
- id: sonr
|
- id: sonr
|
||||||
builds: [sonr]
|
builds: [sonr]
|
||||||
@@ -42,19 +23,11 @@ archives:
|
|||||||
- src: README*
|
- src: README*
|
||||||
- src: CHANGELOG*
|
- src: CHANGELOG*
|
||||||
|
|
||||||
- id: motr
|
|
||||||
builds: [motr]
|
|
||||||
name_template: '{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ with .Arm }}v{{ . }}{{ end }}{{ with .Mips }}_{{ . }}{{ end }}{{ if not (eq .Amd64 "v1") }}{{ .Amd64 }}{{ end }}'
|
|
||||||
format: tar.gz
|
|
||||||
files:
|
|
||||||
- src: README*
|
|
||||||
- src: CHANGELOG*
|
|
||||||
|
|
||||||
release:
|
release:
|
||||||
github:
|
github:
|
||||||
owner: onsonr
|
owner: onsonr
|
||||||
name: sonr
|
name: sonr
|
||||||
name_template: '{{.Now.Format "2006.01.02"}}'
|
name_template: "Release {{.Version}}"
|
||||||
draft: false
|
draft: false
|
||||||
replace_existing_draft: true
|
replace_existing_draft: true
|
||||||
replace_existing_artifacts: true
|
replace_existing_artifacts: true
|
||||||
@@ -62,7 +35,6 @@ release:
|
|||||||
- glob: ./CHANGELOG*
|
- glob: ./CHANGELOG*
|
||||||
- glob: ./README*
|
- glob: ./README*
|
||||||
- glob: ./LICENSE*
|
- glob: ./LICENSE*
|
||||||
- glob: ./pkl/*
|
|
||||||
|
|
||||||
brews:
|
brews:
|
||||||
- name: sonr
|
- name: sonr
|
||||||
@@ -71,7 +43,7 @@ brews:
|
|||||||
name: goreleaserbot
|
name: goreleaserbot
|
||||||
email: bot@goreleaser.com
|
email: bot@goreleaser.com
|
||||||
directory: Formula
|
directory: Formula
|
||||||
caveats: "Run a local sonr node and access it with the motr proxy"
|
caveats: "Run a local sonr node and access it with the hway proxy"
|
||||||
homepage: "https://sonr.io/"
|
homepage: "https://sonr.io/"
|
||||||
description: "Sonr is a decentralized, permissionless, and censorship-resistant identity network."
|
description: "Sonr is a decentralized, permissionless, and censorship-resistant identity network."
|
||||||
dependencies:
|
dependencies:
|
||||||
@@ -82,18 +54,7 @@ brews:
|
|||||||
branch: master
|
branch: master
|
||||||
token: "{{ .Env.GITHUB_PERSONAL_AUTH_TOKEN }}"
|
token: "{{ .Env.GITHUB_PERSONAL_AUTH_TOKEN }}"
|
||||||
|
|
||||||
- name: motr
|
announce:
|
||||||
ids: [motr]
|
telegram:
|
||||||
commit_author:
|
enabled: true
|
||||||
name: goreleaserbot
|
chat_id: -1002222617755
|
||||||
email: bot@goreleaser.com
|
|
||||||
directory: Formula
|
|
||||||
caveats: "Use motr to interact with the Sonr network"
|
|
||||||
homepage: "https://sonr.io/"
|
|
||||||
description: "Motr is a proxy for interacting with the Sonr network."
|
|
||||||
dependencies:
|
|
||||||
- name: ipfs
|
|
||||||
repository:
|
|
||||||
owner: onsonr
|
|
||||||
name: homebrew-tap
|
|
||||||
branch: master
|
|
||||||
|
|||||||
+184
-2
@@ -1,3 +1,185 @@
|
|||||||
|
## v0.5.11 (2024-10-10)
|
||||||
|
|
||||||
|
### Feat
|
||||||
|
|
||||||
|
- nebula assets served from CDN
|
||||||
|
- use CDN for nebula frontend assets
|
||||||
|
- add static hero section content to homepage
|
||||||
|
- add wrangler scripts for development, build, and deployment
|
||||||
|
- remove build configuration
|
||||||
|
- move gateway web code to dedicated directory
|
||||||
|
- add PubKey fast reflection
|
||||||
|
- **macaroon**: add transaction allowlist/denylist caveats
|
||||||
|
- add PR labeler
|
||||||
|
- **devbox**: remove hway start command
|
||||||
|
- add GitHub Actions workflow for running tests
|
||||||
|
- add workflow for deploying Hway to Cloudflare Workers
|
||||||
|
- Publish configs to R2
|
||||||
|
- integrate nebula UI with worker-assets-gen
|
||||||
|
- extract reusable layout components
|
||||||
|
- Implement service worker for IPFS vault
|
||||||
|
- implement CDN support for assets
|
||||||
|
- add payment method support
|
||||||
|
- add support for public key management
|
||||||
|
- add ModalForm component
|
||||||
|
- add LoginStart and RegisterStart routes
|
||||||
|
- implement authentication views
|
||||||
|
- add json tags to config structs
|
||||||
|
- implement templ forms for consent privacy, credential assert, credential register, and profile details
|
||||||
|
- **vault**: introduce assembly of the initial vault
|
||||||
|
- add client logos to homepage
|
||||||
|
- add tailwind utility classes
|
||||||
|
- implement new profile card component
|
||||||
|
|
||||||
|
### Fix
|
||||||
|
|
||||||
|
- Correct source directory for asset publishing
|
||||||
|
- install dependencies before nebula build
|
||||||
|
- update Schema service to use new API endpoint
|
||||||
|
- fix broken logo image path
|
||||||
|
|
||||||
|
### Refactor
|
||||||
|
|
||||||
|
- remove unnecessary branch configuration from scheduled release workflow
|
||||||
|
- update dwn configuration generation import path
|
||||||
|
- use nebula/routes instead of nebula/global
|
||||||
|
- move index template to routes package
|
||||||
|
- remove cdn package and move assets to global styles
|
||||||
|
- move nebula assets to hway build directory
|
||||||
|
- remove docker build and deployment
|
||||||
|
- rename internal/session package to internal/ctx
|
||||||
|
- remove unused fields from
|
||||||
|
- rename PR_TEMPLATE to PULL_REQUEST_TEMPLATE
|
||||||
|
- remove devbox.json init hook
|
||||||
|
- rename sonrd dockerfile to Dockerfile
|
||||||
|
- remove unused dependency
|
||||||
|
- rename 'global/cdn' to 'assets'
|
||||||
|
- move CDN assets to separate folder
|
||||||
|
- move Pkl module definitions to dedicated package
|
||||||
|
- move CDN assets to js/ folder
|
||||||
|
- remove unused component templates
|
||||||
|
- move ui components to global
|
||||||
|
- move view handlers to router package
|
||||||
|
|
||||||
|
## v0.5.10 (2024-10-07)
|
||||||
|
|
||||||
|
### Feat
|
||||||
|
|
||||||
|
- **blocks**: remove button component
|
||||||
|
|
||||||
|
## v0.5.9 (2024-10-06)
|
||||||
|
|
||||||
|
### Feat
|
||||||
|
|
||||||
|
- add Motr support
|
||||||
|
- update UIUX PKL to utilize optional fields
|
||||||
|
|
||||||
|
### Fix
|
||||||
|
|
||||||
|
- Update source directory for asset publishing
|
||||||
|
|
||||||
|
## v0.5.8 (2024-10-04)
|
||||||
|
|
||||||
|
### Refactor
|
||||||
|
|
||||||
|
- Remove unused logs configuration
|
||||||
|
|
||||||
|
## v0.5.7 (2024-10-04)
|
||||||
|
|
||||||
|
### Feat
|
||||||
|
|
||||||
|
- **devbox**: use process-compose for testnet services
|
||||||
|
- remove motr.mjs dependency
|
||||||
|
- add markdown rendering to issue templates
|
||||||
|
- update issue templates for better clarity
|
||||||
|
- add issue templates for tracking and task issues
|
||||||
|
- add issue templates for bug report and tracking
|
||||||
|
- introduce docker-compose based setup
|
||||||
|
|
||||||
|
### Refactor
|
||||||
|
|
||||||
|
- update issue template headings
|
||||||
|
- rename bug-report issue template to bug
|
||||||
|
|
||||||
|
## v0.5.6 (2024-10-03)
|
||||||
|
|
||||||
|
### Feat
|
||||||
|
|
||||||
|
- add hway and sonr processes to dev environment
|
||||||
|
|
||||||
|
## v0.5.5 (2024-10-03)
|
||||||
|
|
||||||
|
### Feat
|
||||||
|
|
||||||
|
- add rudimentary DidController table
|
||||||
|
- update home section with new features
|
||||||
|
- introduce Home model and refactor views
|
||||||
|
- **nebula**: create Home model for home page
|
||||||
|
|
||||||
|
### Refactor
|
||||||
|
|
||||||
|
- reorganize pkl files for better separation of concerns
|
||||||
|
- rename msg_server_test.go to rpc_test.go
|
||||||
|
|
||||||
|
## v0.5.4 (2024-10-02)
|
||||||
|
|
||||||
|
## v0.5.3 (2024-10-02)
|
||||||
|
|
||||||
|
### Fix
|
||||||
|
|
||||||
|
- remove unnecessary telegram message template
|
||||||
|
|
||||||
|
## v0.5.2 (2024-10-02)
|
||||||
|
|
||||||
|
### Feat
|
||||||
|
|
||||||
|
- **service**: integrate group module (#1104)
|
||||||
|
|
||||||
|
### Refactor
|
||||||
|
|
||||||
|
- revert version bump to 0.5.1
|
||||||
|
|
||||||
|
## v0.5.1 (2024-10-02)
|
||||||
|
|
||||||
|
### Refactor
|
||||||
|
|
||||||
|
- move Motr API to state package
|
||||||
|
|
||||||
|
## v0.5.0 (2024-10-02)
|
||||||
|
|
||||||
|
### Feat
|
||||||
|
|
||||||
|
- allow multiple macaroons with the same id
|
||||||
|
|
||||||
|
## v0.4.5 (2024-10-02)
|
||||||
|
|
||||||
|
### Fix
|
||||||
|
|
||||||
|
- use correct secret for docker login
|
||||||
|
|
||||||
|
## v0.4.4 (2024-10-02)
|
||||||
|
|
||||||
|
## v0.4.3 (2024-10-02)
|
||||||
|
|
||||||
|
### Feat
|
||||||
|
|
||||||
|
- **release**: add docker images for sonrd and motr
|
||||||
|
- update homepage with new visual design
|
||||||
|
- add DID to vault genesis schema
|
||||||
|
- add video component
|
||||||
|
- add video component
|
||||||
|
- add hx-get attribute to primary button in hero section
|
||||||
|
|
||||||
|
### Fix
|
||||||
|
|
||||||
|
- **layout**: add missing favicon
|
||||||
|
- **hero**: Use hx-swap for primary button to prevent flicker
|
||||||
|
|
||||||
|
### Refactor
|
||||||
|
|
||||||
|
- use single GITHUB_TOKEN for release workflow
|
||||||
|
- update workflow variables
|
||||||
|
|
||||||
## v0.4.2 (2024-10-01)
|
## v0.4.2 (2024-10-01)
|
||||||
|
|
||||||
### Refactor
|
### Refactor
|
||||||
@@ -30,7 +212,7 @@
|
|||||||
- **cta**: Fix typo in CTA title
|
- **cta**: Fix typo in CTA title
|
||||||
- change bento section title to reflect security focus
|
- change bento section title to reflect security focus
|
||||||
- adjust hero image dimensions
|
- adjust hero image dimensions
|
||||||
- **Input**: Change type from to
|
- **Input**: Change type from to
|
||||||
- update hero image height in config.pkl
|
- update hero image height in config.pkl
|
||||||
|
|
||||||
### Refactor
|
### Refactor
|
||||||
@@ -40,7 +222,7 @@
|
|||||||
- update hero image dimensions
|
- update hero image dimensions
|
||||||
- move nebula configuration to static file
|
- move nebula configuration to static file
|
||||||
- rename buf-publish.yml to publish-assets.yml
|
- rename buf-publish.yml to publish-assets.yml
|
||||||
- remove unused field from
|
- remove unused field from
|
||||||
|
|
||||||
## v0.4.0 (2024-09-30)
|
## v0.4.0 (2024-09-30)
|
||||||
|
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ endif
|
|||||||
|
|
||||||
install: go.sum
|
install: go.sum
|
||||||
go install -mod=readonly $(BUILD_FLAGS) ./cmd/sonrd
|
go install -mod=readonly $(BUILD_FLAGS) ./cmd/sonrd
|
||||||
go install -mod=readonly $(BUILD_FLAGS) ./cmd/motr
|
go install -mod=readonly $(BUILD_FLAGS) ./cmd/hway
|
||||||
|
|
||||||
########################################
|
########################################
|
||||||
### Tools & dependencies
|
### Tools & dependencies
|
||||||
@@ -183,13 +183,10 @@ protoVer=0.13.2
|
|||||||
protoImageName=ghcr.io/cosmos/proto-builder:$(protoVer)
|
protoImageName=ghcr.io/cosmos/proto-builder:$(protoVer)
|
||||||
protoImage=$(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace $(protoImageName)
|
protoImage=$(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace $(protoImageName)
|
||||||
|
|
||||||
proto-all: proto-format proto-lint proto-gen format
|
|
||||||
|
|
||||||
proto-gen:
|
proto-gen:
|
||||||
@echo "Generating Protobuf files"
|
@echo "Generating Protobuf files"
|
||||||
@go install cosmossdk.io/orm/cmd/protoc-gen-go-cosmos-orm@latest
|
@go install cosmossdk.io/orm/cmd/protoc-gen-go-cosmos-orm@latest
|
||||||
@$(protoImage) sh ./scripts/protocgen.sh
|
@$(protoImage) sh ./scripts/protocgen.sh
|
||||||
# generate the stubs for the proto files from the proto directory
|
|
||||||
spawn stub-gen
|
spawn stub-gen
|
||||||
|
|
||||||
proto-format:
|
proto-format:
|
||||||
@@ -291,43 +288,51 @@ sh-testnet: mod-tidy
|
|||||||
|
|
||||||
.PHONY: setup-testnet set-testnet-configs testnet testnet-basic sh-testnet
|
.PHONY: setup-testnet set-testnet-configs testnet testnet-basic sh-testnet
|
||||||
|
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
### templ & vault ###
|
### custom generation ###
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
.PHONY: dwn motr templ pkl nebula
|
.PHONY: templ-gen pkl-gen
|
||||||
|
|
||||||
motr:
|
templ-gen:
|
||||||
@echo "(motr) Building motr gateway"
|
|
||||||
go build -o ./build/motr ./cmd/motr
|
|
||||||
|
|
||||||
dwn:
|
|
||||||
@echo "(dwn) Building dwn.wasm -> IPFS Vault"
|
|
||||||
GOOS=js GOARCH=wasm go build -o ./pkg/dwn/app.wasm ./cmd/dwn/dwn.go
|
|
||||||
|
|
||||||
templ:
|
|
||||||
@echo "(templ) Generating templ files"
|
@echo "(templ) Generating templ files"
|
||||||
go install github.com/a-h/templ/cmd/templ@latest
|
|
||||||
templ generate
|
templ generate
|
||||||
|
|
||||||
nebula:
|
pkl-gen:
|
||||||
@echo "(nebula) Building nebula"
|
|
||||||
cd pkg/nebula && bun run build
|
|
||||||
|
|
||||||
pkl:
|
|
||||||
@echo "(pkl) Building PKL"
|
@echo "(pkl) Building PKL"
|
||||||
go run github.com/apple/pkl-go/cmd/pkl-gen-go ./pkl/dwn.pkl
|
go run github.com/apple/pkl-go/cmd/pkl-gen-go ./pkl/DWN.pkl
|
||||||
go run github.com/apple/pkl-go/cmd/pkl-gen-go ./pkl/orm.pkl
|
go run github.com/apple/pkl-go/cmd/pkl-gen-go ./pkl/ORM.pkl
|
||||||
go run github.com/apple/pkl-go/cmd/pkl-gen-go ./pkl/txns.pkl
|
go run github.com/apple/pkl-go/cmd/pkl-gen-go ./pkl/Txns.pkl
|
||||||
go run github.com/apple/pkl-go/cmd/pkl-gen-go ./pkl/uiux.pkl
|
|
||||||
|
|
||||||
start-caddy:
|
|
||||||
@echo "(start-caddy) Starting caddy"
|
|
||||||
./build/caddy run --config ./config/caddy/Caddyfile
|
|
||||||
|
|
||||||
start-motr: motr
|
|
||||||
@echo "(start-proxy) Starting proxy server"
|
###############################################################################
|
||||||
./build/motr start
|
### motr, hway & nebula ###
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
.PHONY: motr-build hway-build nebula-build
|
||||||
|
|
||||||
|
nebula-build:
|
||||||
|
@echo "(ui) Building nebula"
|
||||||
|
cd nebula && bun install && bun run build
|
||||||
|
rm -rf ./nebula/node_modules
|
||||||
|
|
||||||
|
motr-build: templ-gen pkl-gen
|
||||||
|
@echo "(dwn) Building motr.wasm -> Service Worker IPFS Vault"
|
||||||
|
GOOS=js GOARCH=wasm go build -o ./pkg/dwn/app.wasm ./cmd/motr/main.go
|
||||||
|
|
||||||
|
hway-build: nebula-build templ-gen
|
||||||
|
@echo "(hway) Building Highway gateway"
|
||||||
|
GOOS=js GOARCH=wasm go build -o ./cmd/hway/build/app.wasm ./cmd/hway/main.go
|
||||||
|
|
||||||
|
hway-dev:
|
||||||
|
@echo "(hway) Serving Highway gateway"
|
||||||
|
bunx wrangler dev
|
||||||
|
|
||||||
|
hway-deploy:
|
||||||
|
@echo "(hway) Deploying Highway gateway"
|
||||||
|
bunx wrangler deploy
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
### help ###
|
### help ###
|
||||||
|
|||||||
+2877
-20
File diff suppressed because it is too large
Load Diff
+102
-2956
File diff suppressed because it is too large
Load Diff
+87
-817
File diff suppressed because it is too large
Load Diff
+1123
-167
File diff suppressed because it is too large
Load Diff
@@ -176,20 +176,193 @@ func NewGrantTable(db ormtable.Schema) (GrantTable, error) {
|
|||||||
return grantTable{table.(ormtable.AutoIncrementTable)}, nil
|
return grantTable{table.(ormtable.AutoIncrementTable)}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type MacaroonTable interface {
|
||||||
|
Insert(ctx context.Context, macaroon *Macaroon) error
|
||||||
|
InsertReturningId(ctx context.Context, macaroon *Macaroon) (uint64, error)
|
||||||
|
LastInsertedSequence(ctx context.Context) (uint64, error)
|
||||||
|
Update(ctx context.Context, macaroon *Macaroon) error
|
||||||
|
Save(ctx context.Context, macaroon *Macaroon) error
|
||||||
|
Delete(ctx context.Context, macaroon *Macaroon) error
|
||||||
|
Has(ctx context.Context, id uint64) (found bool, err error)
|
||||||
|
// Get returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found.
|
||||||
|
Get(ctx context.Context, id uint64) (*Macaroon, error)
|
||||||
|
HasBySubjectOrigin(ctx context.Context, subject string, origin string) (found bool, err error)
|
||||||
|
// GetBySubjectOrigin returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found.
|
||||||
|
GetBySubjectOrigin(ctx context.Context, subject string, origin string) (*Macaroon, error)
|
||||||
|
List(ctx context.Context, prefixKey MacaroonIndexKey, opts ...ormlist.Option) (MacaroonIterator, error)
|
||||||
|
ListRange(ctx context.Context, from, to MacaroonIndexKey, opts ...ormlist.Option) (MacaroonIterator, error)
|
||||||
|
DeleteBy(ctx context.Context, prefixKey MacaroonIndexKey) error
|
||||||
|
DeleteRange(ctx context.Context, from, to MacaroonIndexKey) error
|
||||||
|
|
||||||
|
doNotImplement()
|
||||||
|
}
|
||||||
|
|
||||||
|
type MacaroonIterator struct {
|
||||||
|
ormtable.Iterator
|
||||||
|
}
|
||||||
|
|
||||||
|
func (i MacaroonIterator) Value() (*Macaroon, error) {
|
||||||
|
var macaroon Macaroon
|
||||||
|
err := i.UnmarshalMessage(&macaroon)
|
||||||
|
return &macaroon, err
|
||||||
|
}
|
||||||
|
|
||||||
|
type MacaroonIndexKey interface {
|
||||||
|
id() uint32
|
||||||
|
values() []interface{}
|
||||||
|
macaroonIndexKey()
|
||||||
|
}
|
||||||
|
|
||||||
|
// primary key starting index..
|
||||||
|
type MacaroonPrimaryKey = MacaroonIdIndexKey
|
||||||
|
|
||||||
|
type MacaroonIdIndexKey struct {
|
||||||
|
vs []interface{}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x MacaroonIdIndexKey) id() uint32 { return 0 }
|
||||||
|
func (x MacaroonIdIndexKey) values() []interface{} { return x.vs }
|
||||||
|
func (x MacaroonIdIndexKey) macaroonIndexKey() {}
|
||||||
|
|
||||||
|
func (this MacaroonIdIndexKey) WithId(id uint64) MacaroonIdIndexKey {
|
||||||
|
this.vs = []interface{}{id}
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
type MacaroonSubjectOriginIndexKey struct {
|
||||||
|
vs []interface{}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x MacaroonSubjectOriginIndexKey) id() uint32 { return 1 }
|
||||||
|
func (x MacaroonSubjectOriginIndexKey) values() []interface{} { return x.vs }
|
||||||
|
func (x MacaroonSubjectOriginIndexKey) macaroonIndexKey() {}
|
||||||
|
|
||||||
|
func (this MacaroonSubjectOriginIndexKey) WithSubject(subject string) MacaroonSubjectOriginIndexKey {
|
||||||
|
this.vs = []interface{}{subject}
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this MacaroonSubjectOriginIndexKey) WithSubjectOrigin(subject string, origin string) MacaroonSubjectOriginIndexKey {
|
||||||
|
this.vs = []interface{}{subject, origin}
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
type macaroonTable struct {
|
||||||
|
table ormtable.AutoIncrementTable
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this macaroonTable) Insert(ctx context.Context, macaroon *Macaroon) error {
|
||||||
|
return this.table.Insert(ctx, macaroon)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this macaroonTable) Update(ctx context.Context, macaroon *Macaroon) error {
|
||||||
|
return this.table.Update(ctx, macaroon)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this macaroonTable) Save(ctx context.Context, macaroon *Macaroon) error {
|
||||||
|
return this.table.Save(ctx, macaroon)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this macaroonTable) Delete(ctx context.Context, macaroon *Macaroon) error {
|
||||||
|
return this.table.Delete(ctx, macaroon)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this macaroonTable) InsertReturningId(ctx context.Context, macaroon *Macaroon) (uint64, error) {
|
||||||
|
return this.table.InsertReturningPKey(ctx, macaroon)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this macaroonTable) LastInsertedSequence(ctx context.Context) (uint64, error) {
|
||||||
|
return this.table.LastInsertedSequence(ctx)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this macaroonTable) Has(ctx context.Context, id uint64) (found bool, err error) {
|
||||||
|
return this.table.PrimaryKey().Has(ctx, id)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this macaroonTable) Get(ctx context.Context, id uint64) (*Macaroon, error) {
|
||||||
|
var macaroon Macaroon
|
||||||
|
found, err := this.table.PrimaryKey().Get(ctx, &macaroon, id)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if !found {
|
||||||
|
return nil, ormerrors.NotFound
|
||||||
|
}
|
||||||
|
return &macaroon, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this macaroonTable) HasBySubjectOrigin(ctx context.Context, subject string, origin string) (found bool, err error) {
|
||||||
|
return this.table.GetIndexByID(1).(ormtable.UniqueIndex).Has(ctx,
|
||||||
|
subject,
|
||||||
|
origin,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this macaroonTable) GetBySubjectOrigin(ctx context.Context, subject string, origin string) (*Macaroon, error) {
|
||||||
|
var macaroon Macaroon
|
||||||
|
found, err := this.table.GetIndexByID(1).(ormtable.UniqueIndex).Get(ctx, &macaroon,
|
||||||
|
subject,
|
||||||
|
origin,
|
||||||
|
)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if !found {
|
||||||
|
return nil, ormerrors.NotFound
|
||||||
|
}
|
||||||
|
return &macaroon, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this macaroonTable) List(ctx context.Context, prefixKey MacaroonIndexKey, opts ...ormlist.Option) (MacaroonIterator, error) {
|
||||||
|
it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...)
|
||||||
|
return MacaroonIterator{it}, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this macaroonTable) ListRange(ctx context.Context, from, to MacaroonIndexKey, opts ...ormlist.Option) (MacaroonIterator, error) {
|
||||||
|
it, err := this.table.GetIndexByID(from.id()).ListRange(ctx, from.values(), to.values(), opts...)
|
||||||
|
return MacaroonIterator{it}, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this macaroonTable) DeleteBy(ctx context.Context, prefixKey MacaroonIndexKey) error {
|
||||||
|
return this.table.GetIndexByID(prefixKey.id()).DeleteBy(ctx, prefixKey.values()...)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this macaroonTable) DeleteRange(ctx context.Context, from, to MacaroonIndexKey) error {
|
||||||
|
return this.table.GetIndexByID(from.id()).DeleteRange(ctx, from.values(), to.values())
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this macaroonTable) doNotImplement() {}
|
||||||
|
|
||||||
|
var _ MacaroonTable = macaroonTable{}
|
||||||
|
|
||||||
|
func NewMacaroonTable(db ormtable.Schema) (MacaroonTable, error) {
|
||||||
|
table := db.GetTable(&Macaroon{})
|
||||||
|
if table == nil {
|
||||||
|
return nil, ormerrors.TableNotFound.Wrap(string((&Macaroon{}).ProtoReflect().Descriptor().FullName()))
|
||||||
|
}
|
||||||
|
return macaroonTable{table.(ormtable.AutoIncrementTable)}, nil
|
||||||
|
}
|
||||||
|
|
||||||
type StateStore interface {
|
type StateStore interface {
|
||||||
GrantTable() GrantTable
|
GrantTable() GrantTable
|
||||||
|
MacaroonTable() MacaroonTable
|
||||||
|
|
||||||
doNotImplement()
|
doNotImplement()
|
||||||
}
|
}
|
||||||
|
|
||||||
type stateStore struct {
|
type stateStore struct {
|
||||||
grant GrantTable
|
grant GrantTable
|
||||||
|
macaroon MacaroonTable
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x stateStore) GrantTable() GrantTable {
|
func (x stateStore) GrantTable() GrantTable {
|
||||||
return x.grant
|
return x.grant
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (x stateStore) MacaroonTable() MacaroonTable {
|
||||||
|
return x.macaroon
|
||||||
|
}
|
||||||
|
|
||||||
func (stateStore) doNotImplement() {}
|
func (stateStore) doNotImplement() {}
|
||||||
|
|
||||||
var _ StateStore = stateStore{}
|
var _ StateStore = stateStore{}
|
||||||
@@ -200,7 +373,13 @@ func NewStateStore(db ormtable.Schema) (StateStore, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
macaroonTable, err := NewMacaroonTable(db)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
return stateStore{
|
return stateStore{
|
||||||
grantTable,
|
grantTable,
|
||||||
|
macaroonTable,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|||||||
+824
-14
@@ -657,6 +657,714 @@ func (x *fastReflection_Grant) ProtoMethods() *protoiface.Methods {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
md_Macaroon protoreflect.MessageDescriptor
|
||||||
|
fd_Macaroon_id protoreflect.FieldDescriptor
|
||||||
|
fd_Macaroon_controller protoreflect.FieldDescriptor
|
||||||
|
fd_Macaroon_subject protoreflect.FieldDescriptor
|
||||||
|
fd_Macaroon_origin protoreflect.FieldDescriptor
|
||||||
|
fd_Macaroon_expiry_height protoreflect.FieldDescriptor
|
||||||
|
fd_Macaroon_macaroon protoreflect.FieldDescriptor
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
file_macaroon_v1_state_proto_init()
|
||||||
|
md_Macaroon = File_macaroon_v1_state_proto.Messages().ByName("Macaroon")
|
||||||
|
fd_Macaroon_id = md_Macaroon.Fields().ByName("id")
|
||||||
|
fd_Macaroon_controller = md_Macaroon.Fields().ByName("controller")
|
||||||
|
fd_Macaroon_subject = md_Macaroon.Fields().ByName("subject")
|
||||||
|
fd_Macaroon_origin = md_Macaroon.Fields().ByName("origin")
|
||||||
|
fd_Macaroon_expiry_height = md_Macaroon.Fields().ByName("expiry_height")
|
||||||
|
fd_Macaroon_macaroon = md_Macaroon.Fields().ByName("macaroon")
|
||||||
|
}
|
||||||
|
|
||||||
|
var _ protoreflect.Message = (*fastReflection_Macaroon)(nil)
|
||||||
|
|
||||||
|
type fastReflection_Macaroon Macaroon
|
||||||
|
|
||||||
|
func (x *Macaroon) ProtoReflect() protoreflect.Message {
|
||||||
|
return (*fastReflection_Macaroon)(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Macaroon) slowProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_macaroon_v1_state_proto_msgTypes[1]
|
||||||
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
var _fastReflection_Macaroon_messageType fastReflection_Macaroon_messageType
|
||||||
|
var _ protoreflect.MessageType = fastReflection_Macaroon_messageType{}
|
||||||
|
|
||||||
|
type fastReflection_Macaroon_messageType struct{}
|
||||||
|
|
||||||
|
func (x fastReflection_Macaroon_messageType) Zero() protoreflect.Message {
|
||||||
|
return (*fastReflection_Macaroon)(nil)
|
||||||
|
}
|
||||||
|
func (x fastReflection_Macaroon_messageType) New() protoreflect.Message {
|
||||||
|
return new(fastReflection_Macaroon)
|
||||||
|
}
|
||||||
|
func (x fastReflection_Macaroon_messageType) Descriptor() protoreflect.MessageDescriptor {
|
||||||
|
return md_Macaroon
|
||||||
|
}
|
||||||
|
|
||||||
|
// Descriptor returns message descriptor, which contains only the protobuf
|
||||||
|
// type information for the message.
|
||||||
|
func (x *fastReflection_Macaroon) Descriptor() protoreflect.MessageDescriptor {
|
||||||
|
return md_Macaroon
|
||||||
|
}
|
||||||
|
|
||||||
|
// Type returns the message type, which encapsulates both Go and protobuf
|
||||||
|
// type information. If the Go type information is not needed,
|
||||||
|
// it is recommended that the message descriptor be used instead.
|
||||||
|
func (x *fastReflection_Macaroon) Type() protoreflect.MessageType {
|
||||||
|
return _fastReflection_Macaroon_messageType
|
||||||
|
}
|
||||||
|
|
||||||
|
// New returns a newly allocated and mutable empty message.
|
||||||
|
func (x *fastReflection_Macaroon) New() protoreflect.Message {
|
||||||
|
return new(fastReflection_Macaroon)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Interface unwraps the message reflection interface and
|
||||||
|
// returns the underlying ProtoMessage interface.
|
||||||
|
func (x *fastReflection_Macaroon) Interface() protoreflect.ProtoMessage {
|
||||||
|
return (*Macaroon)(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Range iterates over every populated field in an undefined order,
|
||||||
|
// calling f for each field descriptor and value encountered.
|
||||||
|
// Range returns immediately if f returns false.
|
||||||
|
// While iterating, mutating operations may only be performed
|
||||||
|
// on the current field descriptor.
|
||||||
|
func (x *fastReflection_Macaroon) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {
|
||||||
|
if x.Id != uint64(0) {
|
||||||
|
value := protoreflect.ValueOfUint64(x.Id)
|
||||||
|
if !f(fd_Macaroon_id, value) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if x.Controller != "" {
|
||||||
|
value := protoreflect.ValueOfString(x.Controller)
|
||||||
|
if !f(fd_Macaroon_controller, value) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if x.Subject != "" {
|
||||||
|
value := protoreflect.ValueOfString(x.Subject)
|
||||||
|
if !f(fd_Macaroon_subject, value) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if x.Origin != "" {
|
||||||
|
value := protoreflect.ValueOfString(x.Origin)
|
||||||
|
if !f(fd_Macaroon_origin, value) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if x.ExpiryHeight != int64(0) {
|
||||||
|
value := protoreflect.ValueOfInt64(x.ExpiryHeight)
|
||||||
|
if !f(fd_Macaroon_expiry_height, value) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if x.Macaroon != "" {
|
||||||
|
value := protoreflect.ValueOfString(x.Macaroon)
|
||||||
|
if !f(fd_Macaroon_macaroon, value) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Has reports whether a field is populated.
|
||||||
|
//
|
||||||
|
// Some fields have the property of nullability where it is possible to
|
||||||
|
// distinguish between the default value of a field and whether the field
|
||||||
|
// was explicitly populated with the default value. Singular message fields,
|
||||||
|
// member fields of a oneof, and proto2 scalar fields are nullable. Such
|
||||||
|
// fields are populated only if explicitly set.
|
||||||
|
//
|
||||||
|
// In other cases (aside from the nullable cases above),
|
||||||
|
// a proto3 scalar field is populated if it contains a non-zero value, and
|
||||||
|
// a repeated field is populated if it is non-empty.
|
||||||
|
func (x *fastReflection_Macaroon) Has(fd protoreflect.FieldDescriptor) bool {
|
||||||
|
switch fd.FullName() {
|
||||||
|
case "macaroon.v1.Macaroon.id":
|
||||||
|
return x.Id != uint64(0)
|
||||||
|
case "macaroon.v1.Macaroon.controller":
|
||||||
|
return x.Controller != ""
|
||||||
|
case "macaroon.v1.Macaroon.subject":
|
||||||
|
return x.Subject != ""
|
||||||
|
case "macaroon.v1.Macaroon.origin":
|
||||||
|
return x.Origin != ""
|
||||||
|
case "macaroon.v1.Macaroon.expiry_height":
|
||||||
|
return x.ExpiryHeight != int64(0)
|
||||||
|
case "macaroon.v1.Macaroon.macaroon":
|
||||||
|
return x.Macaroon != ""
|
||||||
|
default:
|
||||||
|
if fd.IsExtension() {
|
||||||
|
panic(fmt.Errorf("proto3 declared messages do not support extensions: macaroon.v1.Macaroon"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message macaroon.v1.Macaroon does not contain field %s", fd.FullName()))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Clear clears the field such that a subsequent Has call reports false.
|
||||||
|
//
|
||||||
|
// Clearing an extension field clears both the extension type and value
|
||||||
|
// associated with the given field number.
|
||||||
|
//
|
||||||
|
// Clear is a mutating operation and unsafe for concurrent use.
|
||||||
|
func (x *fastReflection_Macaroon) Clear(fd protoreflect.FieldDescriptor) {
|
||||||
|
switch fd.FullName() {
|
||||||
|
case "macaroon.v1.Macaroon.id":
|
||||||
|
x.Id = uint64(0)
|
||||||
|
case "macaroon.v1.Macaroon.controller":
|
||||||
|
x.Controller = ""
|
||||||
|
case "macaroon.v1.Macaroon.subject":
|
||||||
|
x.Subject = ""
|
||||||
|
case "macaroon.v1.Macaroon.origin":
|
||||||
|
x.Origin = ""
|
||||||
|
case "macaroon.v1.Macaroon.expiry_height":
|
||||||
|
x.ExpiryHeight = int64(0)
|
||||||
|
case "macaroon.v1.Macaroon.macaroon":
|
||||||
|
x.Macaroon = ""
|
||||||
|
default:
|
||||||
|
if fd.IsExtension() {
|
||||||
|
panic(fmt.Errorf("proto3 declared messages do not support extensions: macaroon.v1.Macaroon"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message macaroon.v1.Macaroon does not contain field %s", fd.FullName()))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get retrieves the value for a field.
|
||||||
|
//
|
||||||
|
// For unpopulated scalars, it returns the default value, where
|
||||||
|
// the default value of a bytes scalar is guaranteed to be a copy.
|
||||||
|
// For unpopulated composite types, it returns an empty, read-only view
|
||||||
|
// of the value; to obtain a mutable reference, use Mutable.
|
||||||
|
func (x *fastReflection_Macaroon) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value {
|
||||||
|
switch descriptor.FullName() {
|
||||||
|
case "macaroon.v1.Macaroon.id":
|
||||||
|
value := x.Id
|
||||||
|
return protoreflect.ValueOfUint64(value)
|
||||||
|
case "macaroon.v1.Macaroon.controller":
|
||||||
|
value := x.Controller
|
||||||
|
return protoreflect.ValueOfString(value)
|
||||||
|
case "macaroon.v1.Macaroon.subject":
|
||||||
|
value := x.Subject
|
||||||
|
return protoreflect.ValueOfString(value)
|
||||||
|
case "macaroon.v1.Macaroon.origin":
|
||||||
|
value := x.Origin
|
||||||
|
return protoreflect.ValueOfString(value)
|
||||||
|
case "macaroon.v1.Macaroon.expiry_height":
|
||||||
|
value := x.ExpiryHeight
|
||||||
|
return protoreflect.ValueOfInt64(value)
|
||||||
|
case "macaroon.v1.Macaroon.macaroon":
|
||||||
|
value := x.Macaroon
|
||||||
|
return protoreflect.ValueOfString(value)
|
||||||
|
default:
|
||||||
|
if descriptor.IsExtension() {
|
||||||
|
panic(fmt.Errorf("proto3 declared messages do not support extensions: macaroon.v1.Macaroon"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message macaroon.v1.Macaroon does not contain field %s", descriptor.FullName()))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set stores the value for a field.
|
||||||
|
//
|
||||||
|
// For a field belonging to a oneof, it implicitly clears any other field
|
||||||
|
// that may be currently set within the same oneof.
|
||||||
|
// For extension fields, it implicitly stores the provided ExtensionType.
|
||||||
|
// When setting a composite type, it is unspecified whether the stored value
|
||||||
|
// aliases the source's memory in any way. If the composite value is an
|
||||||
|
// empty, read-only value, then it panics.
|
||||||
|
//
|
||||||
|
// Set is a mutating operation and unsafe for concurrent use.
|
||||||
|
func (x *fastReflection_Macaroon) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) {
|
||||||
|
switch fd.FullName() {
|
||||||
|
case "macaroon.v1.Macaroon.id":
|
||||||
|
x.Id = value.Uint()
|
||||||
|
case "macaroon.v1.Macaroon.controller":
|
||||||
|
x.Controller = value.Interface().(string)
|
||||||
|
case "macaroon.v1.Macaroon.subject":
|
||||||
|
x.Subject = value.Interface().(string)
|
||||||
|
case "macaroon.v1.Macaroon.origin":
|
||||||
|
x.Origin = value.Interface().(string)
|
||||||
|
case "macaroon.v1.Macaroon.expiry_height":
|
||||||
|
x.ExpiryHeight = value.Int()
|
||||||
|
case "macaroon.v1.Macaroon.macaroon":
|
||||||
|
x.Macaroon = value.Interface().(string)
|
||||||
|
default:
|
||||||
|
if fd.IsExtension() {
|
||||||
|
panic(fmt.Errorf("proto3 declared messages do not support extensions: macaroon.v1.Macaroon"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message macaroon.v1.Macaroon does not contain field %s", fd.FullName()))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Mutable returns a mutable reference to a composite type.
|
||||||
|
//
|
||||||
|
// If the field is unpopulated, it may allocate a composite value.
|
||||||
|
// For a field belonging to a oneof, it implicitly clears any other field
|
||||||
|
// that may be currently set within the same oneof.
|
||||||
|
// For extension fields, it implicitly stores the provided ExtensionType
|
||||||
|
// if not already stored.
|
||||||
|
// It panics if the field does not contain a composite type.
|
||||||
|
//
|
||||||
|
// Mutable is a mutating operation and unsafe for concurrent use.
|
||||||
|
func (x *fastReflection_Macaroon) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value {
|
||||||
|
switch fd.FullName() {
|
||||||
|
case "macaroon.v1.Macaroon.id":
|
||||||
|
panic(fmt.Errorf("field id of message macaroon.v1.Macaroon is not mutable"))
|
||||||
|
case "macaroon.v1.Macaroon.controller":
|
||||||
|
panic(fmt.Errorf("field controller of message macaroon.v1.Macaroon is not mutable"))
|
||||||
|
case "macaroon.v1.Macaroon.subject":
|
||||||
|
panic(fmt.Errorf("field subject of message macaroon.v1.Macaroon is not mutable"))
|
||||||
|
case "macaroon.v1.Macaroon.origin":
|
||||||
|
panic(fmt.Errorf("field origin of message macaroon.v1.Macaroon is not mutable"))
|
||||||
|
case "macaroon.v1.Macaroon.expiry_height":
|
||||||
|
panic(fmt.Errorf("field expiry_height of message macaroon.v1.Macaroon is not mutable"))
|
||||||
|
case "macaroon.v1.Macaroon.macaroon":
|
||||||
|
panic(fmt.Errorf("field macaroon of message macaroon.v1.Macaroon is not mutable"))
|
||||||
|
default:
|
||||||
|
if fd.IsExtension() {
|
||||||
|
panic(fmt.Errorf("proto3 declared messages do not support extensions: macaroon.v1.Macaroon"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message macaroon.v1.Macaroon does not contain field %s", fd.FullName()))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewField returns a new value that is assignable to the field
|
||||||
|
// for the given descriptor. For scalars, this returns the default value.
|
||||||
|
// For lists, maps, and messages, this returns a new, empty, mutable value.
|
||||||
|
func (x *fastReflection_Macaroon) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value {
|
||||||
|
switch fd.FullName() {
|
||||||
|
case "macaroon.v1.Macaroon.id":
|
||||||
|
return protoreflect.ValueOfUint64(uint64(0))
|
||||||
|
case "macaroon.v1.Macaroon.controller":
|
||||||
|
return protoreflect.ValueOfString("")
|
||||||
|
case "macaroon.v1.Macaroon.subject":
|
||||||
|
return protoreflect.ValueOfString("")
|
||||||
|
case "macaroon.v1.Macaroon.origin":
|
||||||
|
return protoreflect.ValueOfString("")
|
||||||
|
case "macaroon.v1.Macaroon.expiry_height":
|
||||||
|
return protoreflect.ValueOfInt64(int64(0))
|
||||||
|
case "macaroon.v1.Macaroon.macaroon":
|
||||||
|
return protoreflect.ValueOfString("")
|
||||||
|
default:
|
||||||
|
if fd.IsExtension() {
|
||||||
|
panic(fmt.Errorf("proto3 declared messages do not support extensions: macaroon.v1.Macaroon"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message macaroon.v1.Macaroon does not contain field %s", fd.FullName()))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// WhichOneof reports which field within the oneof is populated,
|
||||||
|
// returning nil if none are populated.
|
||||||
|
// It panics if the oneof descriptor does not belong to this message.
|
||||||
|
func (x *fastReflection_Macaroon) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor {
|
||||||
|
switch d.FullName() {
|
||||||
|
default:
|
||||||
|
panic(fmt.Errorf("%s is not a oneof field in macaroon.v1.Macaroon", d.FullName()))
|
||||||
|
}
|
||||||
|
panic("unreachable")
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetUnknown retrieves the entire list of unknown fields.
|
||||||
|
// The caller may only mutate the contents of the RawFields
|
||||||
|
// if the mutated bytes are stored back into the message with SetUnknown.
|
||||||
|
func (x *fastReflection_Macaroon) GetUnknown() protoreflect.RawFields {
|
||||||
|
return x.unknownFields
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetUnknown stores an entire list of unknown fields.
|
||||||
|
// The raw fields must be syntactically valid according to the wire format.
|
||||||
|
// An implementation may panic if this is not the case.
|
||||||
|
// Once stored, the caller must not mutate the content of the RawFields.
|
||||||
|
// An empty RawFields may be passed to clear the fields.
|
||||||
|
//
|
||||||
|
// SetUnknown is a mutating operation and unsafe for concurrent use.
|
||||||
|
func (x *fastReflection_Macaroon) SetUnknown(fields protoreflect.RawFields) {
|
||||||
|
x.unknownFields = fields
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsValid reports whether the message is valid.
|
||||||
|
//
|
||||||
|
// An invalid message is an empty, read-only value.
|
||||||
|
//
|
||||||
|
// An invalid message often corresponds to a nil pointer of the concrete
|
||||||
|
// message type, but the details are implementation dependent.
|
||||||
|
// Validity is not part of the protobuf data model, and may not
|
||||||
|
// be preserved in marshaling or other operations.
|
||||||
|
func (x *fastReflection_Macaroon) IsValid() bool {
|
||||||
|
return x != nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations.
|
||||||
|
// This method may return nil.
|
||||||
|
//
|
||||||
|
// The returned methods type is identical to
|
||||||
|
// "google.golang.org/protobuf/runtime/protoiface".Methods.
|
||||||
|
// Consult the protoiface package documentation for details.
|
||||||
|
func (x *fastReflection_Macaroon) ProtoMethods() *protoiface.Methods {
|
||||||
|
size := func(input protoiface.SizeInput) protoiface.SizeOutput {
|
||||||
|
x := input.Message.Interface().(*Macaroon)
|
||||||
|
if x == nil {
|
||||||
|
return protoiface.SizeOutput{
|
||||||
|
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
||||||
|
Size: 0,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
options := runtime.SizeInputToOptions(input)
|
||||||
|
_ = options
|
||||||
|
var n int
|
||||||
|
var l int
|
||||||
|
_ = l
|
||||||
|
if x.Id != 0 {
|
||||||
|
n += 1 + runtime.Sov(uint64(x.Id))
|
||||||
|
}
|
||||||
|
l = len(x.Controller)
|
||||||
|
if l > 0 {
|
||||||
|
n += 1 + l + runtime.Sov(uint64(l))
|
||||||
|
}
|
||||||
|
l = len(x.Subject)
|
||||||
|
if l > 0 {
|
||||||
|
n += 1 + l + runtime.Sov(uint64(l))
|
||||||
|
}
|
||||||
|
l = len(x.Origin)
|
||||||
|
if l > 0 {
|
||||||
|
n += 1 + l + runtime.Sov(uint64(l))
|
||||||
|
}
|
||||||
|
if x.ExpiryHeight != 0 {
|
||||||
|
n += 1 + runtime.Sov(uint64(x.ExpiryHeight))
|
||||||
|
}
|
||||||
|
l = len(x.Macaroon)
|
||||||
|
if l > 0 {
|
||||||
|
n += 1 + l + runtime.Sov(uint64(l))
|
||||||
|
}
|
||||||
|
if x.unknownFields != nil {
|
||||||
|
n += len(x.unknownFields)
|
||||||
|
}
|
||||||
|
return protoiface.SizeOutput{
|
||||||
|
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
||||||
|
Size: n,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) {
|
||||||
|
x := input.Message.Interface().(*Macaroon)
|
||||||
|
if x == nil {
|
||||||
|
return protoiface.MarshalOutput{
|
||||||
|
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
||||||
|
Buf: input.Buf,
|
||||||
|
}, nil
|
||||||
|
}
|
||||||
|
options := runtime.MarshalInputToOptions(input)
|
||||||
|
_ = options
|
||||||
|
size := options.Size(x)
|
||||||
|
dAtA := make([]byte, size)
|
||||||
|
i := len(dAtA)
|
||||||
|
_ = i
|
||||||
|
var l int
|
||||||
|
_ = l
|
||||||
|
if x.unknownFields != nil {
|
||||||
|
i -= len(x.unknownFields)
|
||||||
|
copy(dAtA[i:], x.unknownFields)
|
||||||
|
}
|
||||||
|
if len(x.Macaroon) > 0 {
|
||||||
|
i -= len(x.Macaroon)
|
||||||
|
copy(dAtA[i:], x.Macaroon)
|
||||||
|
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Macaroon)))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x32
|
||||||
|
}
|
||||||
|
if x.ExpiryHeight != 0 {
|
||||||
|
i = runtime.EncodeVarint(dAtA, i, uint64(x.ExpiryHeight))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x28
|
||||||
|
}
|
||||||
|
if len(x.Origin) > 0 {
|
||||||
|
i -= len(x.Origin)
|
||||||
|
copy(dAtA[i:], x.Origin)
|
||||||
|
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Origin)))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x22
|
||||||
|
}
|
||||||
|
if len(x.Subject) > 0 {
|
||||||
|
i -= len(x.Subject)
|
||||||
|
copy(dAtA[i:], x.Subject)
|
||||||
|
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Subject)))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x1a
|
||||||
|
}
|
||||||
|
if len(x.Controller) > 0 {
|
||||||
|
i -= len(x.Controller)
|
||||||
|
copy(dAtA[i:], x.Controller)
|
||||||
|
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Controller)))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x12
|
||||||
|
}
|
||||||
|
if x.Id != 0 {
|
||||||
|
i = runtime.EncodeVarint(dAtA, i, uint64(x.Id))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x8
|
||||||
|
}
|
||||||
|
if input.Buf != nil {
|
||||||
|
input.Buf = append(input.Buf, dAtA...)
|
||||||
|
} else {
|
||||||
|
input.Buf = dAtA
|
||||||
|
}
|
||||||
|
return protoiface.MarshalOutput{
|
||||||
|
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
||||||
|
Buf: input.Buf,
|
||||||
|
}, nil
|
||||||
|
}
|
||||||
|
unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) {
|
||||||
|
x := input.Message.Interface().(*Macaroon)
|
||||||
|
if x == nil {
|
||||||
|
return protoiface.UnmarshalOutput{
|
||||||
|
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
||||||
|
Flags: input.Flags,
|
||||||
|
}, nil
|
||||||
|
}
|
||||||
|
options := runtime.UnmarshalInputToOptions(input)
|
||||||
|
_ = options
|
||||||
|
dAtA := input.Buf
|
||||||
|
l := len(dAtA)
|
||||||
|
iNdEx := 0
|
||||||
|
for iNdEx < l {
|
||||||
|
preIndex := iNdEx
|
||||||
|
var wire uint64
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
wire |= uint64(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fieldNum := int32(wire >> 3)
|
||||||
|
wireType := int(wire & 0x7)
|
||||||
|
if wireType == 4 {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Macaroon: wiretype end group for non-group")
|
||||||
|
}
|
||||||
|
if fieldNum <= 0 {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Macaroon: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||||
|
}
|
||||||
|
switch fieldNum {
|
||||||
|
case 1:
|
||||||
|
if wireType != 0 {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Id", wireType)
|
||||||
|
}
|
||||||
|
x.Id = 0
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
x.Id |= uint64(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case 2:
|
||||||
|
if wireType != 2 {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Controller", wireType)
|
||||||
|
}
|
||||||
|
var stringLen uint64
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
stringLen |= uint64(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
intStringLen := int(stringLen)
|
||||||
|
if intStringLen < 0 {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
|
||||||
|
}
|
||||||
|
postIndex := iNdEx + intStringLen
|
||||||
|
if postIndex < 0 {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
|
||||||
|
}
|
||||||
|
if postIndex > l {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
x.Controller = string(dAtA[iNdEx:postIndex])
|
||||||
|
iNdEx = postIndex
|
||||||
|
case 3:
|
||||||
|
if wireType != 2 {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Subject", wireType)
|
||||||
|
}
|
||||||
|
var stringLen uint64
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
stringLen |= uint64(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
intStringLen := int(stringLen)
|
||||||
|
if intStringLen < 0 {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
|
||||||
|
}
|
||||||
|
postIndex := iNdEx + intStringLen
|
||||||
|
if postIndex < 0 {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
|
||||||
|
}
|
||||||
|
if postIndex > l {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
x.Subject = string(dAtA[iNdEx:postIndex])
|
||||||
|
iNdEx = postIndex
|
||||||
|
case 4:
|
||||||
|
if wireType != 2 {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Origin", wireType)
|
||||||
|
}
|
||||||
|
var stringLen uint64
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
stringLen |= uint64(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
intStringLen := int(stringLen)
|
||||||
|
if intStringLen < 0 {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
|
||||||
|
}
|
||||||
|
postIndex := iNdEx + intStringLen
|
||||||
|
if postIndex < 0 {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
|
||||||
|
}
|
||||||
|
if postIndex > l {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
x.Origin = string(dAtA[iNdEx:postIndex])
|
||||||
|
iNdEx = postIndex
|
||||||
|
case 5:
|
||||||
|
if wireType != 0 {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ExpiryHeight", wireType)
|
||||||
|
}
|
||||||
|
x.ExpiryHeight = 0
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
x.ExpiryHeight |= int64(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case 6:
|
||||||
|
if wireType != 2 {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Macaroon", wireType)
|
||||||
|
}
|
||||||
|
var stringLen uint64
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
stringLen |= uint64(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
intStringLen := int(stringLen)
|
||||||
|
if intStringLen < 0 {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
|
||||||
|
}
|
||||||
|
postIndex := iNdEx + intStringLen
|
||||||
|
if postIndex < 0 {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
|
||||||
|
}
|
||||||
|
if postIndex > l {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
x.Macaroon = string(dAtA[iNdEx:postIndex])
|
||||||
|
iNdEx = postIndex
|
||||||
|
default:
|
||||||
|
iNdEx = preIndex
|
||||||
|
skippy, err := runtime.Skip(dAtA[iNdEx:])
|
||||||
|
if err != nil {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
|
||||||
|
}
|
||||||
|
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
|
||||||
|
}
|
||||||
|
if (iNdEx + skippy) > l {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
if !options.DiscardUnknown {
|
||||||
|
x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...)
|
||||||
|
}
|
||||||
|
iNdEx += skippy
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if iNdEx > l {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil
|
||||||
|
}
|
||||||
|
return &protoiface.Methods{
|
||||||
|
NoUnkeyedLiterals: struct{}{},
|
||||||
|
Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown,
|
||||||
|
Size: size,
|
||||||
|
Marshal: marshal,
|
||||||
|
Unmarshal: unmarshal,
|
||||||
|
Merge: nil,
|
||||||
|
CheckInitialized: nil,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.27.0
|
// protoc-gen-go v1.27.0
|
||||||
@@ -737,6 +1445,81 @@ func (x *Grant) GetExpiryHeight() int64 {
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type Macaroon struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||||
|
Controller string `protobuf:"bytes,2,opt,name=controller,proto3" json:"controller,omitempty"`
|
||||||
|
Subject string `protobuf:"bytes,3,opt,name=subject,proto3" json:"subject,omitempty"`
|
||||||
|
Origin string `protobuf:"bytes,4,opt,name=origin,proto3" json:"origin,omitempty"`
|
||||||
|
ExpiryHeight int64 `protobuf:"varint,5,opt,name=expiry_height,json=expiryHeight,proto3" json:"expiry_height,omitempty"`
|
||||||
|
Macaroon string `protobuf:"bytes,6,opt,name=macaroon,proto3" json:"macaroon,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Macaroon) Reset() {
|
||||||
|
*x = Macaroon{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_macaroon_v1_state_proto_msgTypes[1]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Macaroon) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*Macaroon) ProtoMessage() {}
|
||||||
|
|
||||||
|
// Deprecated: Use Macaroon.ProtoReflect.Descriptor instead.
|
||||||
|
func (*Macaroon) Descriptor() ([]byte, []int) {
|
||||||
|
return file_macaroon_v1_state_proto_rawDescGZIP(), []int{1}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Macaroon) GetId() uint64 {
|
||||||
|
if x != nil {
|
||||||
|
return x.Id
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Macaroon) GetController() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Controller
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Macaroon) GetSubject() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Subject
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Macaroon) GetOrigin() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Origin
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Macaroon) GetExpiryHeight() int64 {
|
||||||
|
if x != nil {
|
||||||
|
return x.ExpiryHeight
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Macaroon) GetMacaroon() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Macaroon
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
var File_macaroon_v1_state_proto protoreflect.FileDescriptor
|
var File_macaroon_v1_state_proto protoreflect.FileDescriptor
|
||||||
|
|
||||||
var file_macaroon_v1_state_proto_rawDesc = []byte{
|
var file_macaroon_v1_state_proto_rawDesc = []byte{
|
||||||
@@ -755,17 +1538,31 @@ var file_macaroon_v1_state_proto_rawDesc = []byte{
|
|||||||
0x28, 0x03, 0x52, 0x0c, 0x65, 0x78, 0x70, 0x69, 0x72, 0x79, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74,
|
0x28, 0x03, 0x52, 0x0c, 0x65, 0x78, 0x70, 0x69, 0x72, 0x79, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74,
|
||||||
0x3a, 0x26, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x20, 0x0a, 0x06, 0x0a, 0x02, 0x69, 0x64, 0x10, 0x01,
|
0x3a, 0x26, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x20, 0x0a, 0x06, 0x0a, 0x02, 0x69, 0x64, 0x10, 0x01,
|
||||||
0x12, 0x14, 0x0a, 0x0e, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2c, 0x6f, 0x72, 0x69, 0x67,
|
0x12, 0x14, 0x0a, 0x0e, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2c, 0x6f, 0x72, 0x69, 0x67,
|
||||||
0x69, 0x6e, 0x10, 0x01, 0x18, 0x01, 0x18, 0x01, 0x42, 0x9d, 0x01, 0x0a, 0x0f, 0x63, 0x6f, 0x6d,
|
0x69, 0x6e, 0x10, 0x01, 0x18, 0x01, 0x18, 0x01, 0x22, 0xd5, 0x01, 0x0a, 0x08, 0x4d, 0x61, 0x63,
|
||||||
0x2e, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x53, 0x74,
|
0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||||
0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x31, 0x67, 0x69, 0x74, 0x68,
|
0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c,
|
||||||
0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f,
|
0x6c, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72,
|
||||||
0x6e, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2f,
|
0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74,
|
||||||
0x76, 0x31, 0x3b, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x76, 0x31, 0xa2, 0x02, 0x03,
|
0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12,
|
||||||
0x4d, 0x58, 0x58, 0xaa, 0x02, 0x0b, 0x4d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2e, 0x56,
|
0x16, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||||
0x31, 0xca, 0x02, 0x0b, 0x4d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x5c, 0x56, 0x31, 0xe2,
|
0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x65, 0x78, 0x70, 0x69, 0x72,
|
||||||
0x02, 0x17, 0x4d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50,
|
0x79, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c,
|
||||||
0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0c, 0x4d, 0x61, 0x63, 0x61,
|
0x65, 0x78, 0x70, 0x69, 0x72, 0x79, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x1a, 0x0a, 0x08,
|
||||||
0x72, 0x6f, 0x6f, 0x6e, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08,
|
||||||
|
0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x3a, 0x26, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x20,
|
||||||
|
0x0a, 0x06, 0x0a, 0x02, 0x69, 0x64, 0x10, 0x01, 0x12, 0x14, 0x0a, 0x0e, 0x73, 0x75, 0x62, 0x6a,
|
||||||
|
0x65, 0x63, 0x74, 0x2c, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x10, 0x01, 0x18, 0x01, 0x18, 0x02,
|
||||||
|
0x42, 0x9d, 0x01, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f,
|
||||||
|
0x6e, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x53, 0x74, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f,
|
||||||
|
0x50, 0x01, 0x5a, 0x31, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f,
|
||||||
|
0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6d,
|
||||||
|
0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x61, 0x63, 0x61, 0x72,
|
||||||
|
0x6f, 0x6f, 0x6e, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4d, 0x58, 0x58, 0xaa, 0x02, 0x0b, 0x4d, 0x61,
|
||||||
|
0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0b, 0x4d, 0x61, 0x63, 0x61,
|
||||||
|
0x72, 0x6f, 0x6f, 0x6e, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x17, 0x4d, 0x61, 0x63, 0x61, 0x72, 0x6f,
|
||||||
|
0x6f, 0x6e, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74,
|
||||||
|
0x61, 0xea, 0x02, 0x0c, 0x4d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x3a, 0x3a, 0x56, 0x31,
|
||||||
|
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@@ -780,9 +1577,10 @@ func file_macaroon_v1_state_proto_rawDescGZIP() []byte {
|
|||||||
return file_macaroon_v1_state_proto_rawDescData
|
return file_macaroon_v1_state_proto_rawDescData
|
||||||
}
|
}
|
||||||
|
|
||||||
var file_macaroon_v1_state_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
var file_macaroon_v1_state_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
||||||
var file_macaroon_v1_state_proto_goTypes = []interface{}{
|
var file_macaroon_v1_state_proto_goTypes = []interface{}{
|
||||||
(*Grant)(nil), // 0: macaroon.v1.Grant
|
(*Grant)(nil), // 0: macaroon.v1.Grant
|
||||||
|
(*Macaroon)(nil), // 1: macaroon.v1.Macaroon
|
||||||
}
|
}
|
||||||
var file_macaroon_v1_state_proto_depIdxs = []int32{
|
var file_macaroon_v1_state_proto_depIdxs = []int32{
|
||||||
0, // [0:0] is the sub-list for method output_type
|
0, // [0:0] is the sub-list for method output_type
|
||||||
@@ -810,6 +1608,18 @@ func file_macaroon_v1_state_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
file_macaroon_v1_state_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*Macaroon); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
type x struct{}
|
type x struct{}
|
||||||
out := protoimpl.TypeBuilder{
|
out := protoimpl.TypeBuilder{
|
||||||
@@ -817,7 +1627,7 @@ func file_macaroon_v1_state_proto_init() {
|
|||||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||||
RawDescriptor: file_macaroon_v1_state_proto_rawDesc,
|
RawDescriptor: file_macaroon_v1_state_proto_rawDesc,
|
||||||
NumEnums: 0,
|
NumEnums: 0,
|
||||||
NumMessages: 1,
|
NumMessages: 2,
|
||||||
NumExtensions: 0,
|
NumExtensions: 0,
|
||||||
NumServices: 0,
|
NumServices: 0,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,500 +0,0 @@
|
|||||||
// Code generated by protoc-gen-go-pulsar. DO NOT EDIT.
|
|
||||||
package modulev1
|
|
||||||
|
|
||||||
import (
|
|
||||||
_ "cosmossdk.io/api/cosmos/app/v1alpha1"
|
|
||||||
fmt "fmt"
|
|
||||||
runtime "github.com/cosmos/cosmos-proto/runtime"
|
|
||||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
|
||||||
protoiface "google.golang.org/protobuf/runtime/protoiface"
|
|
||||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
|
||||||
io "io"
|
|
||||||
reflect "reflect"
|
|
||||||
sync "sync"
|
|
||||||
)
|
|
||||||
|
|
||||||
var (
|
|
||||||
md_Module protoreflect.MessageDescriptor
|
|
||||||
)
|
|
||||||
|
|
||||||
func init() {
|
|
||||||
file_oracle_module_v1_module_proto_init()
|
|
||||||
md_Module = File_oracle_module_v1_module_proto.Messages().ByName("Module")
|
|
||||||
}
|
|
||||||
|
|
||||||
var _ protoreflect.Message = (*fastReflection_Module)(nil)
|
|
||||||
|
|
||||||
type fastReflection_Module Module
|
|
||||||
|
|
||||||
func (x *Module) ProtoReflect() protoreflect.Message {
|
|
||||||
return (*fastReflection_Module)(x)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *Module) slowProtoReflect() protoreflect.Message {
|
|
||||||
mi := &file_oracle_module_v1_module_proto_msgTypes[0]
|
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
||||||
if ms.LoadMessageInfo() == nil {
|
|
||||||
ms.StoreMessageInfo(mi)
|
|
||||||
}
|
|
||||||
return ms
|
|
||||||
}
|
|
||||||
return mi.MessageOf(x)
|
|
||||||
}
|
|
||||||
|
|
||||||
var _fastReflection_Module_messageType fastReflection_Module_messageType
|
|
||||||
var _ protoreflect.MessageType = fastReflection_Module_messageType{}
|
|
||||||
|
|
||||||
type fastReflection_Module_messageType struct{}
|
|
||||||
|
|
||||||
func (x fastReflection_Module_messageType) Zero() protoreflect.Message {
|
|
||||||
return (*fastReflection_Module)(nil)
|
|
||||||
}
|
|
||||||
func (x fastReflection_Module_messageType) New() protoreflect.Message {
|
|
||||||
return new(fastReflection_Module)
|
|
||||||
}
|
|
||||||
func (x fastReflection_Module_messageType) Descriptor() protoreflect.MessageDescriptor {
|
|
||||||
return md_Module
|
|
||||||
}
|
|
||||||
|
|
||||||
// Descriptor returns message descriptor, which contains only the protobuf
|
|
||||||
// type information for the message.
|
|
||||||
func (x *fastReflection_Module) Descriptor() protoreflect.MessageDescriptor {
|
|
||||||
return md_Module
|
|
||||||
}
|
|
||||||
|
|
||||||
// Type returns the message type, which encapsulates both Go and protobuf
|
|
||||||
// type information. If the Go type information is not needed,
|
|
||||||
// it is recommended that the message descriptor be used instead.
|
|
||||||
func (x *fastReflection_Module) Type() protoreflect.MessageType {
|
|
||||||
return _fastReflection_Module_messageType
|
|
||||||
}
|
|
||||||
|
|
||||||
// New returns a newly allocated and mutable empty message.
|
|
||||||
func (x *fastReflection_Module) New() protoreflect.Message {
|
|
||||||
return new(fastReflection_Module)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Interface unwraps the message reflection interface and
|
|
||||||
// returns the underlying ProtoMessage interface.
|
|
||||||
func (x *fastReflection_Module) Interface() protoreflect.ProtoMessage {
|
|
||||||
return (*Module)(x)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Range iterates over every populated field in an undefined order,
|
|
||||||
// calling f for each field descriptor and value encountered.
|
|
||||||
// Range returns immediately if f returns false.
|
|
||||||
// While iterating, mutating operations may only be performed
|
|
||||||
// on the current field descriptor.
|
|
||||||
func (x *fastReflection_Module) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {
|
|
||||||
}
|
|
||||||
|
|
||||||
// Has reports whether a field is populated.
|
|
||||||
//
|
|
||||||
// Some fields have the property of nullability where it is possible to
|
|
||||||
// distinguish between the default value of a field and whether the field
|
|
||||||
// was explicitly populated with the default value. Singular message fields,
|
|
||||||
// member fields of a oneof, and proto2 scalar fields are nullable. Such
|
|
||||||
// fields are populated only if explicitly set.
|
|
||||||
//
|
|
||||||
// In other cases (aside from the nullable cases above),
|
|
||||||
// a proto3 scalar field is populated if it contains a non-zero value, and
|
|
||||||
// a repeated field is populated if it is non-empty.
|
|
||||||
func (x *fastReflection_Module) Has(fd protoreflect.FieldDescriptor) bool {
|
|
||||||
switch fd.FullName() {
|
|
||||||
default:
|
|
||||||
if fd.IsExtension() {
|
|
||||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.module.v1.Module"))
|
|
||||||
}
|
|
||||||
panic(fmt.Errorf("message oracle.module.v1.Module does not contain field %s", fd.FullName()))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Clear clears the field such that a subsequent Has call reports false.
|
|
||||||
//
|
|
||||||
// Clearing an extension field clears both the extension type and value
|
|
||||||
// associated with the given field number.
|
|
||||||
//
|
|
||||||
// Clear is a mutating operation and unsafe for concurrent use.
|
|
||||||
func (x *fastReflection_Module) Clear(fd protoreflect.FieldDescriptor) {
|
|
||||||
switch fd.FullName() {
|
|
||||||
default:
|
|
||||||
if fd.IsExtension() {
|
|
||||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.module.v1.Module"))
|
|
||||||
}
|
|
||||||
panic(fmt.Errorf("message oracle.module.v1.Module does not contain field %s", fd.FullName()))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get retrieves the value for a field.
|
|
||||||
//
|
|
||||||
// For unpopulated scalars, it returns the default value, where
|
|
||||||
// the default value of a bytes scalar is guaranteed to be a copy.
|
|
||||||
// For unpopulated composite types, it returns an empty, read-only view
|
|
||||||
// of the value; to obtain a mutable reference, use Mutable.
|
|
||||||
func (x *fastReflection_Module) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value {
|
|
||||||
switch descriptor.FullName() {
|
|
||||||
default:
|
|
||||||
if descriptor.IsExtension() {
|
|
||||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.module.v1.Module"))
|
|
||||||
}
|
|
||||||
panic(fmt.Errorf("message oracle.module.v1.Module does not contain field %s", descriptor.FullName()))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set stores the value for a field.
|
|
||||||
//
|
|
||||||
// For a field belonging to a oneof, it implicitly clears any other field
|
|
||||||
// that may be currently set within the same oneof.
|
|
||||||
// For extension fields, it implicitly stores the provided ExtensionType.
|
|
||||||
// When setting a composite type, it is unspecified whether the stored value
|
|
||||||
// aliases the source's memory in any way. If the composite value is an
|
|
||||||
// empty, read-only value, then it panics.
|
|
||||||
//
|
|
||||||
// Set is a mutating operation and unsafe for concurrent use.
|
|
||||||
func (x *fastReflection_Module) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) {
|
|
||||||
switch fd.FullName() {
|
|
||||||
default:
|
|
||||||
if fd.IsExtension() {
|
|
||||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.module.v1.Module"))
|
|
||||||
}
|
|
||||||
panic(fmt.Errorf("message oracle.module.v1.Module does not contain field %s", fd.FullName()))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Mutable returns a mutable reference to a composite type.
|
|
||||||
//
|
|
||||||
// If the field is unpopulated, it may allocate a composite value.
|
|
||||||
// For a field belonging to a oneof, it implicitly clears any other field
|
|
||||||
// that may be currently set within the same oneof.
|
|
||||||
// For extension fields, it implicitly stores the provided ExtensionType
|
|
||||||
// if not already stored.
|
|
||||||
// It panics if the field does not contain a composite type.
|
|
||||||
//
|
|
||||||
// Mutable is a mutating operation and unsafe for concurrent use.
|
|
||||||
func (x *fastReflection_Module) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value {
|
|
||||||
switch fd.FullName() {
|
|
||||||
default:
|
|
||||||
if fd.IsExtension() {
|
|
||||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.module.v1.Module"))
|
|
||||||
}
|
|
||||||
panic(fmt.Errorf("message oracle.module.v1.Module does not contain field %s", fd.FullName()))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// NewField returns a new value that is assignable to the field
|
|
||||||
// for the given descriptor. For scalars, this returns the default value.
|
|
||||||
// For lists, maps, and messages, this returns a new, empty, mutable value.
|
|
||||||
func (x *fastReflection_Module) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value {
|
|
||||||
switch fd.FullName() {
|
|
||||||
default:
|
|
||||||
if fd.IsExtension() {
|
|
||||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.module.v1.Module"))
|
|
||||||
}
|
|
||||||
panic(fmt.Errorf("message oracle.module.v1.Module does not contain field %s", fd.FullName()))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// WhichOneof reports which field within the oneof is populated,
|
|
||||||
// returning nil if none are populated.
|
|
||||||
// It panics if the oneof descriptor does not belong to this message.
|
|
||||||
func (x *fastReflection_Module) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor {
|
|
||||||
switch d.FullName() {
|
|
||||||
default:
|
|
||||||
panic(fmt.Errorf("%s is not a oneof field in oracle.module.v1.Module", d.FullName()))
|
|
||||||
}
|
|
||||||
panic("unreachable")
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetUnknown retrieves the entire list of unknown fields.
|
|
||||||
// The caller may only mutate the contents of the RawFields
|
|
||||||
// if the mutated bytes are stored back into the message with SetUnknown.
|
|
||||||
func (x *fastReflection_Module) GetUnknown() protoreflect.RawFields {
|
|
||||||
return x.unknownFields
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetUnknown stores an entire list of unknown fields.
|
|
||||||
// The raw fields must be syntactically valid according to the wire format.
|
|
||||||
// An implementation may panic if this is not the case.
|
|
||||||
// Once stored, the caller must not mutate the content of the RawFields.
|
|
||||||
// An empty RawFields may be passed to clear the fields.
|
|
||||||
//
|
|
||||||
// SetUnknown is a mutating operation and unsafe for concurrent use.
|
|
||||||
func (x *fastReflection_Module) SetUnknown(fields protoreflect.RawFields) {
|
|
||||||
x.unknownFields = fields
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsValid reports whether the message is valid.
|
|
||||||
//
|
|
||||||
// An invalid message is an empty, read-only value.
|
|
||||||
//
|
|
||||||
// An invalid message often corresponds to a nil pointer of the concrete
|
|
||||||
// message type, but the details are implementation dependent.
|
|
||||||
// Validity is not part of the protobuf data model, and may not
|
|
||||||
// be preserved in marshaling or other operations.
|
|
||||||
func (x *fastReflection_Module) IsValid() bool {
|
|
||||||
return x != nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations.
|
|
||||||
// This method may return nil.
|
|
||||||
//
|
|
||||||
// The returned methods type is identical to
|
|
||||||
// "google.golang.org/protobuf/runtime/protoiface".Methods.
|
|
||||||
// Consult the protoiface package documentation for details.
|
|
||||||
func (x *fastReflection_Module) ProtoMethods() *protoiface.Methods {
|
|
||||||
size := func(input protoiface.SizeInput) protoiface.SizeOutput {
|
|
||||||
x := input.Message.Interface().(*Module)
|
|
||||||
if x == nil {
|
|
||||||
return protoiface.SizeOutput{
|
|
||||||
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
|
||||||
Size: 0,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
options := runtime.SizeInputToOptions(input)
|
|
||||||
_ = options
|
|
||||||
var n int
|
|
||||||
var l int
|
|
||||||
_ = l
|
|
||||||
if x.unknownFields != nil {
|
|
||||||
n += len(x.unknownFields)
|
|
||||||
}
|
|
||||||
return protoiface.SizeOutput{
|
|
||||||
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
|
||||||
Size: n,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) {
|
|
||||||
x := input.Message.Interface().(*Module)
|
|
||||||
if x == nil {
|
|
||||||
return protoiface.MarshalOutput{
|
|
||||||
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
|
||||||
Buf: input.Buf,
|
|
||||||
}, nil
|
|
||||||
}
|
|
||||||
options := runtime.MarshalInputToOptions(input)
|
|
||||||
_ = options
|
|
||||||
size := options.Size(x)
|
|
||||||
dAtA := make([]byte, size)
|
|
||||||
i := len(dAtA)
|
|
||||||
_ = i
|
|
||||||
var l int
|
|
||||||
_ = l
|
|
||||||
if x.unknownFields != nil {
|
|
||||||
i -= len(x.unknownFields)
|
|
||||||
copy(dAtA[i:], x.unknownFields)
|
|
||||||
}
|
|
||||||
if input.Buf != nil {
|
|
||||||
input.Buf = append(input.Buf, dAtA...)
|
|
||||||
} else {
|
|
||||||
input.Buf = dAtA
|
|
||||||
}
|
|
||||||
return protoiface.MarshalOutput{
|
|
||||||
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
|
||||||
Buf: input.Buf,
|
|
||||||
}, nil
|
|
||||||
}
|
|
||||||
unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) {
|
|
||||||
x := input.Message.Interface().(*Module)
|
|
||||||
if x == nil {
|
|
||||||
return protoiface.UnmarshalOutput{
|
|
||||||
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
|
||||||
Flags: input.Flags,
|
|
||||||
}, nil
|
|
||||||
}
|
|
||||||
options := runtime.UnmarshalInputToOptions(input)
|
|
||||||
_ = options
|
|
||||||
dAtA := input.Buf
|
|
||||||
l := len(dAtA)
|
|
||||||
iNdEx := 0
|
|
||||||
for iNdEx < l {
|
|
||||||
preIndex := iNdEx
|
|
||||||
var wire uint64
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
wire |= uint64(b&0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
fieldNum := int32(wire >> 3)
|
|
||||||
wireType := int(wire & 0x7)
|
|
||||||
if wireType == 4 {
|
|
||||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Module: wiretype end group for non-group")
|
|
||||||
}
|
|
||||||
if fieldNum <= 0 {
|
|
||||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Module: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
||||||
}
|
|
||||||
switch fieldNum {
|
|
||||||
default:
|
|
||||||
iNdEx = preIndex
|
|
||||||
skippy, err := runtime.Skip(dAtA[iNdEx:])
|
|
||||||
if err != nil {
|
|
||||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
|
|
||||||
}
|
|
||||||
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
|
||||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
|
|
||||||
}
|
|
||||||
if (iNdEx + skippy) > l {
|
|
||||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
if !options.DiscardUnknown {
|
|
||||||
x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...)
|
|
||||||
}
|
|
||||||
iNdEx += skippy
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if iNdEx > l {
|
|
||||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil
|
|
||||||
}
|
|
||||||
return &protoiface.Methods{
|
|
||||||
NoUnkeyedLiterals: struct{}{},
|
|
||||||
Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown,
|
|
||||||
Size: size,
|
|
||||||
Marshal: marshal,
|
|
||||||
Unmarshal: unmarshal,
|
|
||||||
Merge: nil,
|
|
||||||
CheckInitialized: nil,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
|
||||||
// versions:
|
|
||||||
// protoc-gen-go v1.27.0
|
|
||||||
// protoc (unknown)
|
|
||||||
// source: oracle/module/v1/module.proto
|
|
||||||
|
|
||||||
const (
|
|
||||||
// Verify that this generated code is sufficiently up-to-date.
|
|
||||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
|
||||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
|
||||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
|
||||||
)
|
|
||||||
|
|
||||||
// Module is the app config object of the module.
|
|
||||||
// Learn more: https://docs.cosmos.network/main/building-modules/depinject
|
|
||||||
type Module struct {
|
|
||||||
state protoimpl.MessageState
|
|
||||||
sizeCache protoimpl.SizeCache
|
|
||||||
unknownFields protoimpl.UnknownFields
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *Module) Reset() {
|
|
||||||
*x = Module{}
|
|
||||||
if protoimpl.UnsafeEnabled {
|
|
||||||
mi := &file_oracle_module_v1_module_proto_msgTypes[0]
|
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
||||||
ms.StoreMessageInfo(mi)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *Module) String() string {
|
|
||||||
return protoimpl.X.MessageStringOf(x)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (*Module) ProtoMessage() {}
|
|
||||||
|
|
||||||
// Deprecated: Use Module.ProtoReflect.Descriptor instead.
|
|
||||||
func (*Module) Descriptor() ([]byte, []int) {
|
|
||||||
return file_oracle_module_v1_module_proto_rawDescGZIP(), []int{0}
|
|
||||||
}
|
|
||||||
|
|
||||||
var File_oracle_module_v1_module_proto protoreflect.FileDescriptor
|
|
||||||
|
|
||||||
var file_oracle_module_v1_module_proto_rawDesc = []byte{
|
|
||||||
0x0a, 0x1d, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f,
|
|
||||||
0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
|
|
||||||
0x10, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76,
|
|
||||||
0x31, 0x1a, 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x76, 0x31,
|
|
||||||
0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72,
|
|
||||||
0x6f, 0x74, 0x6f, 0x22, 0x28, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x1e, 0xba,
|
|
||||||
0xc0, 0x96, 0xda, 0x01, 0x18, 0x0a, 0x16, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f,
|
|
||||||
0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x42, 0xbb, 0x01,
|
|
||||||
0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x64,
|
|
||||||
0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x72,
|
|
||||||
0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x34, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f,
|
|
||||||
0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x61, 0x70,
|
|
||||||
0x69, 0x2f, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f,
|
|
||||||
0x76, 0x31, 0x3b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4f, 0x4d,
|
|
||||||
0x58, 0xaa, 0x02, 0x10, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c,
|
|
||||||
0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x10, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x5c, 0x4d, 0x6f,
|
|
||||||
0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1c, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65,
|
|
||||||
0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65,
|
|
||||||
0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x12, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x3a,
|
|
||||||
0x3a, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f,
|
|
||||||
0x74, 0x6f, 0x33,
|
|
||||||
}
|
|
||||||
|
|
||||||
var (
|
|
||||||
file_oracle_module_v1_module_proto_rawDescOnce sync.Once
|
|
||||||
file_oracle_module_v1_module_proto_rawDescData = file_oracle_module_v1_module_proto_rawDesc
|
|
||||||
)
|
|
||||||
|
|
||||||
func file_oracle_module_v1_module_proto_rawDescGZIP() []byte {
|
|
||||||
file_oracle_module_v1_module_proto_rawDescOnce.Do(func() {
|
|
||||||
file_oracle_module_v1_module_proto_rawDescData = protoimpl.X.CompressGZIP(file_oracle_module_v1_module_proto_rawDescData)
|
|
||||||
})
|
|
||||||
return file_oracle_module_v1_module_proto_rawDescData
|
|
||||||
}
|
|
||||||
|
|
||||||
var file_oracle_module_v1_module_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
|
||||||
var file_oracle_module_v1_module_proto_goTypes = []interface{}{
|
|
||||||
(*Module)(nil), // 0: oracle.module.v1.Module
|
|
||||||
}
|
|
||||||
var file_oracle_module_v1_module_proto_depIdxs = []int32{
|
|
||||||
0, // [0:0] is the sub-list for method output_type
|
|
||||||
0, // [0:0] is the sub-list for method input_type
|
|
||||||
0, // [0:0] is the sub-list for extension type_name
|
|
||||||
0, // [0:0] is the sub-list for extension extendee
|
|
||||||
0, // [0:0] is the sub-list for field type_name
|
|
||||||
}
|
|
||||||
|
|
||||||
func init() { file_oracle_module_v1_module_proto_init() }
|
|
||||||
func file_oracle_module_v1_module_proto_init() {
|
|
||||||
if File_oracle_module_v1_module_proto != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if !protoimpl.UnsafeEnabled {
|
|
||||||
file_oracle_module_v1_module_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
|
||||||
switch v := v.(*Module); i {
|
|
||||||
case 0:
|
|
||||||
return &v.state
|
|
||||||
case 1:
|
|
||||||
return &v.sizeCache
|
|
||||||
case 2:
|
|
||||||
return &v.unknownFields
|
|
||||||
default:
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
type x struct{}
|
|
||||||
out := protoimpl.TypeBuilder{
|
|
||||||
File: protoimpl.DescBuilder{
|
|
||||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
|
||||||
RawDescriptor: file_oracle_module_v1_module_proto_rawDesc,
|
|
||||||
NumEnums: 0,
|
|
||||||
NumMessages: 1,
|
|
||||||
NumExtensions: 0,
|
|
||||||
NumServices: 0,
|
|
||||||
},
|
|
||||||
GoTypes: file_oracle_module_v1_module_proto_goTypes,
|
|
||||||
DependencyIndexes: file_oracle_module_v1_module_proto_depIdxs,
|
|
||||||
MessageInfos: file_oracle_module_v1_module_proto_msgTypes,
|
|
||||||
}.Build()
|
|
||||||
File_oracle_module_v1_module_proto = out.File
|
|
||||||
file_oracle_module_v1_module_proto_rawDesc = nil
|
|
||||||
file_oracle_module_v1_module_proto_goTypes = nil
|
|
||||||
file_oracle_module_v1_module_proto_depIdxs = nil
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,996 +0,0 @@
|
|||||||
// Code generated by protoc-gen-go-pulsar. DO NOT EDIT.
|
|
||||||
package oraclev1
|
|
||||||
|
|
||||||
import (
|
|
||||||
fmt "fmt"
|
|
||||||
runtime "github.com/cosmos/cosmos-proto/runtime"
|
|
||||||
_ "google.golang.org/genproto/googleapis/api/annotations"
|
|
||||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
|
||||||
protoiface "google.golang.org/protobuf/runtime/protoiface"
|
|
||||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
|
||||||
io "io"
|
|
||||||
reflect "reflect"
|
|
||||||
sync "sync"
|
|
||||||
)
|
|
||||||
|
|
||||||
var (
|
|
||||||
md_QueryParamsRequest protoreflect.MessageDescriptor
|
|
||||||
)
|
|
||||||
|
|
||||||
func init() {
|
|
||||||
file_oracle_v1_query_proto_init()
|
|
||||||
md_QueryParamsRequest = File_oracle_v1_query_proto.Messages().ByName("QueryParamsRequest")
|
|
||||||
}
|
|
||||||
|
|
||||||
var _ protoreflect.Message = (*fastReflection_QueryParamsRequest)(nil)
|
|
||||||
|
|
||||||
type fastReflection_QueryParamsRequest QueryParamsRequest
|
|
||||||
|
|
||||||
func (x *QueryParamsRequest) ProtoReflect() protoreflect.Message {
|
|
||||||
return (*fastReflection_QueryParamsRequest)(x)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *QueryParamsRequest) slowProtoReflect() protoreflect.Message {
|
|
||||||
mi := &file_oracle_v1_query_proto_msgTypes[0]
|
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
||||||
if ms.LoadMessageInfo() == nil {
|
|
||||||
ms.StoreMessageInfo(mi)
|
|
||||||
}
|
|
||||||
return ms
|
|
||||||
}
|
|
||||||
return mi.MessageOf(x)
|
|
||||||
}
|
|
||||||
|
|
||||||
var _fastReflection_QueryParamsRequest_messageType fastReflection_QueryParamsRequest_messageType
|
|
||||||
var _ protoreflect.MessageType = fastReflection_QueryParamsRequest_messageType{}
|
|
||||||
|
|
||||||
type fastReflection_QueryParamsRequest_messageType struct{}
|
|
||||||
|
|
||||||
func (x fastReflection_QueryParamsRequest_messageType) Zero() protoreflect.Message {
|
|
||||||
return (*fastReflection_QueryParamsRequest)(nil)
|
|
||||||
}
|
|
||||||
func (x fastReflection_QueryParamsRequest_messageType) New() protoreflect.Message {
|
|
||||||
return new(fastReflection_QueryParamsRequest)
|
|
||||||
}
|
|
||||||
func (x fastReflection_QueryParamsRequest_messageType) Descriptor() protoreflect.MessageDescriptor {
|
|
||||||
return md_QueryParamsRequest
|
|
||||||
}
|
|
||||||
|
|
||||||
// Descriptor returns message descriptor, which contains only the protobuf
|
|
||||||
// type information for the message.
|
|
||||||
func (x *fastReflection_QueryParamsRequest) Descriptor() protoreflect.MessageDescriptor {
|
|
||||||
return md_QueryParamsRequest
|
|
||||||
}
|
|
||||||
|
|
||||||
// Type returns the message type, which encapsulates both Go and protobuf
|
|
||||||
// type information. If the Go type information is not needed,
|
|
||||||
// it is recommended that the message descriptor be used instead.
|
|
||||||
func (x *fastReflection_QueryParamsRequest) Type() protoreflect.MessageType {
|
|
||||||
return _fastReflection_QueryParamsRequest_messageType
|
|
||||||
}
|
|
||||||
|
|
||||||
// New returns a newly allocated and mutable empty message.
|
|
||||||
func (x *fastReflection_QueryParamsRequest) New() protoreflect.Message {
|
|
||||||
return new(fastReflection_QueryParamsRequest)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Interface unwraps the message reflection interface and
|
|
||||||
// returns the underlying ProtoMessage interface.
|
|
||||||
func (x *fastReflection_QueryParamsRequest) Interface() protoreflect.ProtoMessage {
|
|
||||||
return (*QueryParamsRequest)(x)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Range iterates over every populated field in an undefined order,
|
|
||||||
// calling f for each field descriptor and value encountered.
|
|
||||||
// Range returns immediately if f returns false.
|
|
||||||
// While iterating, mutating operations may only be performed
|
|
||||||
// on the current field descriptor.
|
|
||||||
func (x *fastReflection_QueryParamsRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {
|
|
||||||
}
|
|
||||||
|
|
||||||
// Has reports whether a field is populated.
|
|
||||||
//
|
|
||||||
// Some fields have the property of nullability where it is possible to
|
|
||||||
// distinguish between the default value of a field and whether the field
|
|
||||||
// was explicitly populated with the default value. Singular message fields,
|
|
||||||
// member fields of a oneof, and proto2 scalar fields are nullable. Such
|
|
||||||
// fields are populated only if explicitly set.
|
|
||||||
//
|
|
||||||
// In other cases (aside from the nullable cases above),
|
|
||||||
// a proto3 scalar field is populated if it contains a non-zero value, and
|
|
||||||
// a repeated field is populated if it is non-empty.
|
|
||||||
func (x *fastReflection_QueryParamsRequest) Has(fd protoreflect.FieldDescriptor) bool {
|
|
||||||
switch fd.FullName() {
|
|
||||||
default:
|
|
||||||
if fd.IsExtension() {
|
|
||||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryParamsRequest"))
|
|
||||||
}
|
|
||||||
panic(fmt.Errorf("message oracle.v1.QueryParamsRequest does not contain field %s", fd.FullName()))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Clear clears the field such that a subsequent Has call reports false.
|
|
||||||
//
|
|
||||||
// Clearing an extension field clears both the extension type and value
|
|
||||||
// associated with the given field number.
|
|
||||||
//
|
|
||||||
// Clear is a mutating operation and unsafe for concurrent use.
|
|
||||||
func (x *fastReflection_QueryParamsRequest) Clear(fd protoreflect.FieldDescriptor) {
|
|
||||||
switch fd.FullName() {
|
|
||||||
default:
|
|
||||||
if fd.IsExtension() {
|
|
||||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryParamsRequest"))
|
|
||||||
}
|
|
||||||
panic(fmt.Errorf("message oracle.v1.QueryParamsRequest does not contain field %s", fd.FullName()))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get retrieves the value for a field.
|
|
||||||
//
|
|
||||||
// For unpopulated scalars, it returns the default value, where
|
|
||||||
// the default value of a bytes scalar is guaranteed to be a copy.
|
|
||||||
// For unpopulated composite types, it returns an empty, read-only view
|
|
||||||
// of the value; to obtain a mutable reference, use Mutable.
|
|
||||||
func (x *fastReflection_QueryParamsRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value {
|
|
||||||
switch descriptor.FullName() {
|
|
||||||
default:
|
|
||||||
if descriptor.IsExtension() {
|
|
||||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryParamsRequest"))
|
|
||||||
}
|
|
||||||
panic(fmt.Errorf("message oracle.v1.QueryParamsRequest does not contain field %s", descriptor.FullName()))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set stores the value for a field.
|
|
||||||
//
|
|
||||||
// For a field belonging to a oneof, it implicitly clears any other field
|
|
||||||
// that may be currently set within the same oneof.
|
|
||||||
// For extension fields, it implicitly stores the provided ExtensionType.
|
|
||||||
// When setting a composite type, it is unspecified whether the stored value
|
|
||||||
// aliases the source's memory in any way. If the composite value is an
|
|
||||||
// empty, read-only value, then it panics.
|
|
||||||
//
|
|
||||||
// Set is a mutating operation and unsafe for concurrent use.
|
|
||||||
func (x *fastReflection_QueryParamsRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) {
|
|
||||||
switch fd.FullName() {
|
|
||||||
default:
|
|
||||||
if fd.IsExtension() {
|
|
||||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryParamsRequest"))
|
|
||||||
}
|
|
||||||
panic(fmt.Errorf("message oracle.v1.QueryParamsRequest does not contain field %s", fd.FullName()))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Mutable returns a mutable reference to a composite type.
|
|
||||||
//
|
|
||||||
// If the field is unpopulated, it may allocate a composite value.
|
|
||||||
// For a field belonging to a oneof, it implicitly clears any other field
|
|
||||||
// that may be currently set within the same oneof.
|
|
||||||
// For extension fields, it implicitly stores the provided ExtensionType
|
|
||||||
// if not already stored.
|
|
||||||
// It panics if the field does not contain a composite type.
|
|
||||||
//
|
|
||||||
// Mutable is a mutating operation and unsafe for concurrent use.
|
|
||||||
func (x *fastReflection_QueryParamsRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value {
|
|
||||||
switch fd.FullName() {
|
|
||||||
default:
|
|
||||||
if fd.IsExtension() {
|
|
||||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryParamsRequest"))
|
|
||||||
}
|
|
||||||
panic(fmt.Errorf("message oracle.v1.QueryParamsRequest does not contain field %s", fd.FullName()))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// NewField returns a new value that is assignable to the field
|
|
||||||
// for the given descriptor. For scalars, this returns the default value.
|
|
||||||
// For lists, maps, and messages, this returns a new, empty, mutable value.
|
|
||||||
func (x *fastReflection_QueryParamsRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value {
|
|
||||||
switch fd.FullName() {
|
|
||||||
default:
|
|
||||||
if fd.IsExtension() {
|
|
||||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryParamsRequest"))
|
|
||||||
}
|
|
||||||
panic(fmt.Errorf("message oracle.v1.QueryParamsRequest does not contain field %s", fd.FullName()))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// WhichOneof reports which field within the oneof is populated,
|
|
||||||
// returning nil if none are populated.
|
|
||||||
// It panics if the oneof descriptor does not belong to this message.
|
|
||||||
func (x *fastReflection_QueryParamsRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor {
|
|
||||||
switch d.FullName() {
|
|
||||||
default:
|
|
||||||
panic(fmt.Errorf("%s is not a oneof field in oracle.v1.QueryParamsRequest", d.FullName()))
|
|
||||||
}
|
|
||||||
panic("unreachable")
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetUnknown retrieves the entire list of unknown fields.
|
|
||||||
// The caller may only mutate the contents of the RawFields
|
|
||||||
// if the mutated bytes are stored back into the message with SetUnknown.
|
|
||||||
func (x *fastReflection_QueryParamsRequest) GetUnknown() protoreflect.RawFields {
|
|
||||||
return x.unknownFields
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetUnknown stores an entire list of unknown fields.
|
|
||||||
// The raw fields must be syntactically valid according to the wire format.
|
|
||||||
// An implementation may panic if this is not the case.
|
|
||||||
// Once stored, the caller must not mutate the content of the RawFields.
|
|
||||||
// An empty RawFields may be passed to clear the fields.
|
|
||||||
//
|
|
||||||
// SetUnknown is a mutating operation and unsafe for concurrent use.
|
|
||||||
func (x *fastReflection_QueryParamsRequest) SetUnknown(fields protoreflect.RawFields) {
|
|
||||||
x.unknownFields = fields
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsValid reports whether the message is valid.
|
|
||||||
//
|
|
||||||
// An invalid message is an empty, read-only value.
|
|
||||||
//
|
|
||||||
// An invalid message often corresponds to a nil pointer of the concrete
|
|
||||||
// message type, but the details are implementation dependent.
|
|
||||||
// Validity is not part of the protobuf data model, and may not
|
|
||||||
// be preserved in marshaling or other operations.
|
|
||||||
func (x *fastReflection_QueryParamsRequest) IsValid() bool {
|
|
||||||
return x != nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations.
|
|
||||||
// This method may return nil.
|
|
||||||
//
|
|
||||||
// The returned methods type is identical to
|
|
||||||
// "google.golang.org/protobuf/runtime/protoiface".Methods.
|
|
||||||
// Consult the protoiface package documentation for details.
|
|
||||||
func (x *fastReflection_QueryParamsRequest) ProtoMethods() *protoiface.Methods {
|
|
||||||
size := func(input protoiface.SizeInput) protoiface.SizeOutput {
|
|
||||||
x := input.Message.Interface().(*QueryParamsRequest)
|
|
||||||
if x == nil {
|
|
||||||
return protoiface.SizeOutput{
|
|
||||||
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
|
||||||
Size: 0,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
options := runtime.SizeInputToOptions(input)
|
|
||||||
_ = options
|
|
||||||
var n int
|
|
||||||
var l int
|
|
||||||
_ = l
|
|
||||||
if x.unknownFields != nil {
|
|
||||||
n += len(x.unknownFields)
|
|
||||||
}
|
|
||||||
return protoiface.SizeOutput{
|
|
||||||
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
|
||||||
Size: n,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) {
|
|
||||||
x := input.Message.Interface().(*QueryParamsRequest)
|
|
||||||
if x == nil {
|
|
||||||
return protoiface.MarshalOutput{
|
|
||||||
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
|
||||||
Buf: input.Buf,
|
|
||||||
}, nil
|
|
||||||
}
|
|
||||||
options := runtime.MarshalInputToOptions(input)
|
|
||||||
_ = options
|
|
||||||
size := options.Size(x)
|
|
||||||
dAtA := make([]byte, size)
|
|
||||||
i := len(dAtA)
|
|
||||||
_ = i
|
|
||||||
var l int
|
|
||||||
_ = l
|
|
||||||
if x.unknownFields != nil {
|
|
||||||
i -= len(x.unknownFields)
|
|
||||||
copy(dAtA[i:], x.unknownFields)
|
|
||||||
}
|
|
||||||
if input.Buf != nil {
|
|
||||||
input.Buf = append(input.Buf, dAtA...)
|
|
||||||
} else {
|
|
||||||
input.Buf = dAtA
|
|
||||||
}
|
|
||||||
return protoiface.MarshalOutput{
|
|
||||||
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
|
||||||
Buf: input.Buf,
|
|
||||||
}, nil
|
|
||||||
}
|
|
||||||
unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) {
|
|
||||||
x := input.Message.Interface().(*QueryParamsRequest)
|
|
||||||
if x == nil {
|
|
||||||
return protoiface.UnmarshalOutput{
|
|
||||||
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
|
||||||
Flags: input.Flags,
|
|
||||||
}, nil
|
|
||||||
}
|
|
||||||
options := runtime.UnmarshalInputToOptions(input)
|
|
||||||
_ = options
|
|
||||||
dAtA := input.Buf
|
|
||||||
l := len(dAtA)
|
|
||||||
iNdEx := 0
|
|
||||||
for iNdEx < l {
|
|
||||||
preIndex := iNdEx
|
|
||||||
var wire uint64
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
wire |= uint64(b&0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
fieldNum := int32(wire >> 3)
|
|
||||||
wireType := int(wire & 0x7)
|
|
||||||
if wireType == 4 {
|
|
||||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsRequest: wiretype end group for non-group")
|
|
||||||
}
|
|
||||||
if fieldNum <= 0 {
|
|
||||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
||||||
}
|
|
||||||
switch fieldNum {
|
|
||||||
default:
|
|
||||||
iNdEx = preIndex
|
|
||||||
skippy, err := runtime.Skip(dAtA[iNdEx:])
|
|
||||||
if err != nil {
|
|
||||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
|
|
||||||
}
|
|
||||||
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
|
||||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
|
|
||||||
}
|
|
||||||
if (iNdEx + skippy) > l {
|
|
||||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
if !options.DiscardUnknown {
|
|
||||||
x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...)
|
|
||||||
}
|
|
||||||
iNdEx += skippy
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if iNdEx > l {
|
|
||||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil
|
|
||||||
}
|
|
||||||
return &protoiface.Methods{
|
|
||||||
NoUnkeyedLiterals: struct{}{},
|
|
||||||
Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown,
|
|
||||||
Size: size,
|
|
||||||
Marshal: marshal,
|
|
||||||
Unmarshal: unmarshal,
|
|
||||||
Merge: nil,
|
|
||||||
CheckInitialized: nil,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var (
|
|
||||||
md_QueryParamsResponse protoreflect.MessageDescriptor
|
|
||||||
fd_QueryParamsResponse_params protoreflect.FieldDescriptor
|
|
||||||
)
|
|
||||||
|
|
||||||
func init() {
|
|
||||||
file_oracle_v1_query_proto_init()
|
|
||||||
md_QueryParamsResponse = File_oracle_v1_query_proto.Messages().ByName("QueryParamsResponse")
|
|
||||||
fd_QueryParamsResponse_params = md_QueryParamsResponse.Fields().ByName("params")
|
|
||||||
}
|
|
||||||
|
|
||||||
var _ protoreflect.Message = (*fastReflection_QueryParamsResponse)(nil)
|
|
||||||
|
|
||||||
type fastReflection_QueryParamsResponse QueryParamsResponse
|
|
||||||
|
|
||||||
func (x *QueryParamsResponse) ProtoReflect() protoreflect.Message {
|
|
||||||
return (*fastReflection_QueryParamsResponse)(x)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *QueryParamsResponse) slowProtoReflect() protoreflect.Message {
|
|
||||||
mi := &file_oracle_v1_query_proto_msgTypes[1]
|
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
||||||
if ms.LoadMessageInfo() == nil {
|
|
||||||
ms.StoreMessageInfo(mi)
|
|
||||||
}
|
|
||||||
return ms
|
|
||||||
}
|
|
||||||
return mi.MessageOf(x)
|
|
||||||
}
|
|
||||||
|
|
||||||
var _fastReflection_QueryParamsResponse_messageType fastReflection_QueryParamsResponse_messageType
|
|
||||||
var _ protoreflect.MessageType = fastReflection_QueryParamsResponse_messageType{}
|
|
||||||
|
|
||||||
type fastReflection_QueryParamsResponse_messageType struct{}
|
|
||||||
|
|
||||||
func (x fastReflection_QueryParamsResponse_messageType) Zero() protoreflect.Message {
|
|
||||||
return (*fastReflection_QueryParamsResponse)(nil)
|
|
||||||
}
|
|
||||||
func (x fastReflection_QueryParamsResponse_messageType) New() protoreflect.Message {
|
|
||||||
return new(fastReflection_QueryParamsResponse)
|
|
||||||
}
|
|
||||||
func (x fastReflection_QueryParamsResponse_messageType) Descriptor() protoreflect.MessageDescriptor {
|
|
||||||
return md_QueryParamsResponse
|
|
||||||
}
|
|
||||||
|
|
||||||
// Descriptor returns message descriptor, which contains only the protobuf
|
|
||||||
// type information for the message.
|
|
||||||
func (x *fastReflection_QueryParamsResponse) Descriptor() protoreflect.MessageDescriptor {
|
|
||||||
return md_QueryParamsResponse
|
|
||||||
}
|
|
||||||
|
|
||||||
// Type returns the message type, which encapsulates both Go and protobuf
|
|
||||||
// type information. If the Go type information is not needed,
|
|
||||||
// it is recommended that the message descriptor be used instead.
|
|
||||||
func (x *fastReflection_QueryParamsResponse) Type() protoreflect.MessageType {
|
|
||||||
return _fastReflection_QueryParamsResponse_messageType
|
|
||||||
}
|
|
||||||
|
|
||||||
// New returns a newly allocated and mutable empty message.
|
|
||||||
func (x *fastReflection_QueryParamsResponse) New() protoreflect.Message {
|
|
||||||
return new(fastReflection_QueryParamsResponse)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Interface unwraps the message reflection interface and
|
|
||||||
// returns the underlying ProtoMessage interface.
|
|
||||||
func (x *fastReflection_QueryParamsResponse) Interface() protoreflect.ProtoMessage {
|
|
||||||
return (*QueryParamsResponse)(x)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Range iterates over every populated field in an undefined order,
|
|
||||||
// calling f for each field descriptor and value encountered.
|
|
||||||
// Range returns immediately if f returns false.
|
|
||||||
// While iterating, mutating operations may only be performed
|
|
||||||
// on the current field descriptor.
|
|
||||||
func (x *fastReflection_QueryParamsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {
|
|
||||||
if x.Params != nil {
|
|
||||||
value := protoreflect.ValueOfMessage(x.Params.ProtoReflect())
|
|
||||||
if !f(fd_QueryParamsResponse_params, value) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Has reports whether a field is populated.
|
|
||||||
//
|
|
||||||
// Some fields have the property of nullability where it is possible to
|
|
||||||
// distinguish between the default value of a field and whether the field
|
|
||||||
// was explicitly populated with the default value. Singular message fields,
|
|
||||||
// member fields of a oneof, and proto2 scalar fields are nullable. Such
|
|
||||||
// fields are populated only if explicitly set.
|
|
||||||
//
|
|
||||||
// In other cases (aside from the nullable cases above),
|
|
||||||
// a proto3 scalar field is populated if it contains a non-zero value, and
|
|
||||||
// a repeated field is populated if it is non-empty.
|
|
||||||
func (x *fastReflection_QueryParamsResponse) Has(fd protoreflect.FieldDescriptor) bool {
|
|
||||||
switch fd.FullName() {
|
|
||||||
case "oracle.v1.QueryParamsResponse.params":
|
|
||||||
return x.Params != nil
|
|
||||||
default:
|
|
||||||
if fd.IsExtension() {
|
|
||||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryParamsResponse"))
|
|
||||||
}
|
|
||||||
panic(fmt.Errorf("message oracle.v1.QueryParamsResponse does not contain field %s", fd.FullName()))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Clear clears the field such that a subsequent Has call reports false.
|
|
||||||
//
|
|
||||||
// Clearing an extension field clears both the extension type and value
|
|
||||||
// associated with the given field number.
|
|
||||||
//
|
|
||||||
// Clear is a mutating operation and unsafe for concurrent use.
|
|
||||||
func (x *fastReflection_QueryParamsResponse) Clear(fd protoreflect.FieldDescriptor) {
|
|
||||||
switch fd.FullName() {
|
|
||||||
case "oracle.v1.QueryParamsResponse.params":
|
|
||||||
x.Params = nil
|
|
||||||
default:
|
|
||||||
if fd.IsExtension() {
|
|
||||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryParamsResponse"))
|
|
||||||
}
|
|
||||||
panic(fmt.Errorf("message oracle.v1.QueryParamsResponse does not contain field %s", fd.FullName()))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get retrieves the value for a field.
|
|
||||||
//
|
|
||||||
// For unpopulated scalars, it returns the default value, where
|
|
||||||
// the default value of a bytes scalar is guaranteed to be a copy.
|
|
||||||
// For unpopulated composite types, it returns an empty, read-only view
|
|
||||||
// of the value; to obtain a mutable reference, use Mutable.
|
|
||||||
func (x *fastReflection_QueryParamsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value {
|
|
||||||
switch descriptor.FullName() {
|
|
||||||
case "oracle.v1.QueryParamsResponse.params":
|
|
||||||
value := x.Params
|
|
||||||
return protoreflect.ValueOfMessage(value.ProtoReflect())
|
|
||||||
default:
|
|
||||||
if descriptor.IsExtension() {
|
|
||||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryParamsResponse"))
|
|
||||||
}
|
|
||||||
panic(fmt.Errorf("message oracle.v1.QueryParamsResponse does not contain field %s", descriptor.FullName()))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set stores the value for a field.
|
|
||||||
//
|
|
||||||
// For a field belonging to a oneof, it implicitly clears any other field
|
|
||||||
// that may be currently set within the same oneof.
|
|
||||||
// For extension fields, it implicitly stores the provided ExtensionType.
|
|
||||||
// When setting a composite type, it is unspecified whether the stored value
|
|
||||||
// aliases the source's memory in any way. If the composite value is an
|
|
||||||
// empty, read-only value, then it panics.
|
|
||||||
//
|
|
||||||
// Set is a mutating operation and unsafe for concurrent use.
|
|
||||||
func (x *fastReflection_QueryParamsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) {
|
|
||||||
switch fd.FullName() {
|
|
||||||
case "oracle.v1.QueryParamsResponse.params":
|
|
||||||
x.Params = value.Message().Interface().(*Params)
|
|
||||||
default:
|
|
||||||
if fd.IsExtension() {
|
|
||||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryParamsResponse"))
|
|
||||||
}
|
|
||||||
panic(fmt.Errorf("message oracle.v1.QueryParamsResponse does not contain field %s", fd.FullName()))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Mutable returns a mutable reference to a composite type.
|
|
||||||
//
|
|
||||||
// If the field is unpopulated, it may allocate a composite value.
|
|
||||||
// For a field belonging to a oneof, it implicitly clears any other field
|
|
||||||
// that may be currently set within the same oneof.
|
|
||||||
// For extension fields, it implicitly stores the provided ExtensionType
|
|
||||||
// if not already stored.
|
|
||||||
// It panics if the field does not contain a composite type.
|
|
||||||
//
|
|
||||||
// Mutable is a mutating operation and unsafe for concurrent use.
|
|
||||||
func (x *fastReflection_QueryParamsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value {
|
|
||||||
switch fd.FullName() {
|
|
||||||
case "oracle.v1.QueryParamsResponse.params":
|
|
||||||
if x.Params == nil {
|
|
||||||
x.Params = new(Params)
|
|
||||||
}
|
|
||||||
return protoreflect.ValueOfMessage(x.Params.ProtoReflect())
|
|
||||||
default:
|
|
||||||
if fd.IsExtension() {
|
|
||||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryParamsResponse"))
|
|
||||||
}
|
|
||||||
panic(fmt.Errorf("message oracle.v1.QueryParamsResponse does not contain field %s", fd.FullName()))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// NewField returns a new value that is assignable to the field
|
|
||||||
// for the given descriptor. For scalars, this returns the default value.
|
|
||||||
// For lists, maps, and messages, this returns a new, empty, mutable value.
|
|
||||||
func (x *fastReflection_QueryParamsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value {
|
|
||||||
switch fd.FullName() {
|
|
||||||
case "oracle.v1.QueryParamsResponse.params":
|
|
||||||
m := new(Params)
|
|
||||||
return protoreflect.ValueOfMessage(m.ProtoReflect())
|
|
||||||
default:
|
|
||||||
if fd.IsExtension() {
|
|
||||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryParamsResponse"))
|
|
||||||
}
|
|
||||||
panic(fmt.Errorf("message oracle.v1.QueryParamsResponse does not contain field %s", fd.FullName()))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// WhichOneof reports which field within the oneof is populated,
|
|
||||||
// returning nil if none are populated.
|
|
||||||
// It panics if the oneof descriptor does not belong to this message.
|
|
||||||
func (x *fastReflection_QueryParamsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor {
|
|
||||||
switch d.FullName() {
|
|
||||||
default:
|
|
||||||
panic(fmt.Errorf("%s is not a oneof field in oracle.v1.QueryParamsResponse", d.FullName()))
|
|
||||||
}
|
|
||||||
panic("unreachable")
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetUnknown retrieves the entire list of unknown fields.
|
|
||||||
// The caller may only mutate the contents of the RawFields
|
|
||||||
// if the mutated bytes are stored back into the message with SetUnknown.
|
|
||||||
func (x *fastReflection_QueryParamsResponse) GetUnknown() protoreflect.RawFields {
|
|
||||||
return x.unknownFields
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetUnknown stores an entire list of unknown fields.
|
|
||||||
// The raw fields must be syntactically valid according to the wire format.
|
|
||||||
// An implementation may panic if this is not the case.
|
|
||||||
// Once stored, the caller must not mutate the content of the RawFields.
|
|
||||||
// An empty RawFields may be passed to clear the fields.
|
|
||||||
//
|
|
||||||
// SetUnknown is a mutating operation and unsafe for concurrent use.
|
|
||||||
func (x *fastReflection_QueryParamsResponse) SetUnknown(fields protoreflect.RawFields) {
|
|
||||||
x.unknownFields = fields
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsValid reports whether the message is valid.
|
|
||||||
//
|
|
||||||
// An invalid message is an empty, read-only value.
|
|
||||||
//
|
|
||||||
// An invalid message often corresponds to a nil pointer of the concrete
|
|
||||||
// message type, but the details are implementation dependent.
|
|
||||||
// Validity is not part of the protobuf data model, and may not
|
|
||||||
// be preserved in marshaling or other operations.
|
|
||||||
func (x *fastReflection_QueryParamsResponse) IsValid() bool {
|
|
||||||
return x != nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations.
|
|
||||||
// This method may return nil.
|
|
||||||
//
|
|
||||||
// The returned methods type is identical to
|
|
||||||
// "google.golang.org/protobuf/runtime/protoiface".Methods.
|
|
||||||
// Consult the protoiface package documentation for details.
|
|
||||||
func (x *fastReflection_QueryParamsResponse) ProtoMethods() *protoiface.Methods {
|
|
||||||
size := func(input protoiface.SizeInput) protoiface.SizeOutput {
|
|
||||||
x := input.Message.Interface().(*QueryParamsResponse)
|
|
||||||
if x == nil {
|
|
||||||
return protoiface.SizeOutput{
|
|
||||||
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
|
||||||
Size: 0,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
options := runtime.SizeInputToOptions(input)
|
|
||||||
_ = options
|
|
||||||
var n int
|
|
||||||
var l int
|
|
||||||
_ = l
|
|
||||||
if x.Params != nil {
|
|
||||||
l = options.Size(x.Params)
|
|
||||||
n += 1 + l + runtime.Sov(uint64(l))
|
|
||||||
}
|
|
||||||
if x.unknownFields != nil {
|
|
||||||
n += len(x.unknownFields)
|
|
||||||
}
|
|
||||||
return protoiface.SizeOutput{
|
|
||||||
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
|
||||||
Size: n,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) {
|
|
||||||
x := input.Message.Interface().(*QueryParamsResponse)
|
|
||||||
if x == nil {
|
|
||||||
return protoiface.MarshalOutput{
|
|
||||||
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
|
||||||
Buf: input.Buf,
|
|
||||||
}, nil
|
|
||||||
}
|
|
||||||
options := runtime.MarshalInputToOptions(input)
|
|
||||||
_ = options
|
|
||||||
size := options.Size(x)
|
|
||||||
dAtA := make([]byte, size)
|
|
||||||
i := len(dAtA)
|
|
||||||
_ = i
|
|
||||||
var l int
|
|
||||||
_ = l
|
|
||||||
if x.unknownFields != nil {
|
|
||||||
i -= len(x.unknownFields)
|
|
||||||
copy(dAtA[i:], x.unknownFields)
|
|
||||||
}
|
|
||||||
if x.Params != nil {
|
|
||||||
encoded, err := options.Marshal(x.Params)
|
|
||||||
if err != nil {
|
|
||||||
return protoiface.MarshalOutput{
|
|
||||||
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
|
||||||
Buf: input.Buf,
|
|
||||||
}, err
|
|
||||||
}
|
|
||||||
i -= len(encoded)
|
|
||||||
copy(dAtA[i:], encoded)
|
|
||||||
i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded)))
|
|
||||||
i--
|
|
||||||
dAtA[i] = 0xa
|
|
||||||
}
|
|
||||||
if input.Buf != nil {
|
|
||||||
input.Buf = append(input.Buf, dAtA...)
|
|
||||||
} else {
|
|
||||||
input.Buf = dAtA
|
|
||||||
}
|
|
||||||
return protoiface.MarshalOutput{
|
|
||||||
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
|
||||||
Buf: input.Buf,
|
|
||||||
}, nil
|
|
||||||
}
|
|
||||||
unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) {
|
|
||||||
x := input.Message.Interface().(*QueryParamsResponse)
|
|
||||||
if x == nil {
|
|
||||||
return protoiface.UnmarshalOutput{
|
|
||||||
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
|
||||||
Flags: input.Flags,
|
|
||||||
}, nil
|
|
||||||
}
|
|
||||||
options := runtime.UnmarshalInputToOptions(input)
|
|
||||||
_ = options
|
|
||||||
dAtA := input.Buf
|
|
||||||
l := len(dAtA)
|
|
||||||
iNdEx := 0
|
|
||||||
for iNdEx < l {
|
|
||||||
preIndex := iNdEx
|
|
||||||
var wire uint64
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
wire |= uint64(b&0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
fieldNum := int32(wire >> 3)
|
|
||||||
wireType := int(wire & 0x7)
|
|
||||||
if wireType == 4 {
|
|
||||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group")
|
|
||||||
}
|
|
||||||
if fieldNum <= 0 {
|
|
||||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
||||||
}
|
|
||||||
switch fieldNum {
|
|
||||||
case 1:
|
|
||||||
if wireType != 2 {
|
|
||||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Params", wireType)
|
|
||||||
}
|
|
||||||
var msglen int
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
msglen |= int(b&0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if msglen < 0 {
|
|
||||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
|
|
||||||
}
|
|
||||||
postIndex := iNdEx + msglen
|
|
||||||
if postIndex < 0 {
|
|
||||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
|
|
||||||
}
|
|
||||||
if postIndex > l {
|
|
||||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
if x.Params == nil {
|
|
||||||
x.Params = &Params{}
|
|
||||||
}
|
|
||||||
if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); err != nil {
|
|
||||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
|
|
||||||
}
|
|
||||||
iNdEx = postIndex
|
|
||||||
default:
|
|
||||||
iNdEx = preIndex
|
|
||||||
skippy, err := runtime.Skip(dAtA[iNdEx:])
|
|
||||||
if err != nil {
|
|
||||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
|
|
||||||
}
|
|
||||||
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
|
||||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
|
|
||||||
}
|
|
||||||
if (iNdEx + skippy) > l {
|
|
||||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
if !options.DiscardUnknown {
|
|
||||||
x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...)
|
|
||||||
}
|
|
||||||
iNdEx += skippy
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if iNdEx > l {
|
|
||||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil
|
|
||||||
}
|
|
||||||
return &protoiface.Methods{
|
|
||||||
NoUnkeyedLiterals: struct{}{},
|
|
||||||
Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown,
|
|
||||||
Size: size,
|
|
||||||
Marshal: marshal,
|
|
||||||
Unmarshal: unmarshal,
|
|
||||||
Merge: nil,
|
|
||||||
CheckInitialized: nil,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
|
||||||
// versions:
|
|
||||||
// protoc-gen-go v1.27.0
|
|
||||||
// protoc (unknown)
|
|
||||||
// source: oracle/v1/query.proto
|
|
||||||
|
|
||||||
const (
|
|
||||||
// Verify that this generated code is sufficiently up-to-date.
|
|
||||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
|
||||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
|
||||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
|
||||||
)
|
|
||||||
|
|
||||||
// QueryParamsRequest is the request type for the Query/Params RPC method.
|
|
||||||
type QueryParamsRequest struct {
|
|
||||||
state protoimpl.MessageState
|
|
||||||
sizeCache protoimpl.SizeCache
|
|
||||||
unknownFields protoimpl.UnknownFields
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *QueryParamsRequest) Reset() {
|
|
||||||
*x = QueryParamsRequest{}
|
|
||||||
if protoimpl.UnsafeEnabled {
|
|
||||||
mi := &file_oracle_v1_query_proto_msgTypes[0]
|
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
||||||
ms.StoreMessageInfo(mi)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *QueryParamsRequest) String() string {
|
|
||||||
return protoimpl.X.MessageStringOf(x)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (*QueryParamsRequest) ProtoMessage() {}
|
|
||||||
|
|
||||||
// Deprecated: Use QueryParamsRequest.ProtoReflect.Descriptor instead.
|
|
||||||
func (*QueryParamsRequest) Descriptor() ([]byte, []int) {
|
|
||||||
return file_oracle_v1_query_proto_rawDescGZIP(), []int{0}
|
|
||||||
}
|
|
||||||
|
|
||||||
// QueryParamsResponse is the response type for the Query/Params RPC method.
|
|
||||||
type QueryParamsResponse struct {
|
|
||||||
state protoimpl.MessageState
|
|
||||||
sizeCache protoimpl.SizeCache
|
|
||||||
unknownFields protoimpl.UnknownFields
|
|
||||||
|
|
||||||
// params defines the parameters of the module.
|
|
||||||
Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *QueryParamsResponse) Reset() {
|
|
||||||
*x = QueryParamsResponse{}
|
|
||||||
if protoimpl.UnsafeEnabled {
|
|
||||||
mi := &file_oracle_v1_query_proto_msgTypes[1]
|
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
||||||
ms.StoreMessageInfo(mi)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *QueryParamsResponse) String() string {
|
|
||||||
return protoimpl.X.MessageStringOf(x)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (*QueryParamsResponse) ProtoMessage() {}
|
|
||||||
|
|
||||||
// Deprecated: Use QueryParamsResponse.ProtoReflect.Descriptor instead.
|
|
||||||
func (*QueryParamsResponse) Descriptor() ([]byte, []int) {
|
|
||||||
return file_oracle_v1_query_proto_rawDescGZIP(), []int{1}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *QueryParamsResponse) GetParams() *Params {
|
|
||||||
if x != nil {
|
|
||||||
return x.Params
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
var File_oracle_v1_query_proto protoreflect.FileDescriptor
|
|
||||||
|
|
||||||
var file_oracle_v1_query_proto_rawDesc = []byte{
|
|
||||||
0x0a, 0x15, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x71, 0x75, 0x65, 0x72,
|
|
||||||
0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e,
|
|
||||||
0x76, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61,
|
|
||||||
0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
|
||||||
0x1a, 0x17, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x6e, 0x65,
|
|
||||||
0x73, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x14, 0x0a, 0x12, 0x51, 0x75, 0x65,
|
|
||||||
0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22,
|
|
||||||
0x40, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65,
|
|
||||||
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x29, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73,
|
|
||||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e,
|
|
||||||
0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d,
|
|
||||||
0x73, 0x32, 0x6b, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x62, 0x0a, 0x06, 0x50, 0x61,
|
|
||||||
0x72, 0x61, 0x6d, 0x73, 0x12, 0x1d, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31,
|
|
||||||
0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75,
|
|
||||||
0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e,
|
|
||||||
0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f,
|
|
||||||
0x6e, 0x73, 0x65, 0x22, 0x19, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x12, 0x11, 0x2f, 0x6f, 0x72,
|
|
||||||
0x61, 0x63, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x8f,
|
|
||||||
0x01, 0x0a, 0x0d, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31,
|
|
||||||
0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2d,
|
|
||||||
0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e,
|
|
||||||
0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6f, 0x72, 0x61, 0x63, 0x6c,
|
|
||||||
0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03,
|
|
||||||
0x4f, 0x58, 0x58, 0xaa, 0x02, 0x09, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca,
|
|
||||||
0x02, 0x09, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x15, 0x4f, 0x72,
|
|
||||||
0x61, 0x63, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64,
|
|
||||||
0x61, 0x74, 0x61, 0xea, 0x02, 0x0a, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31,
|
|
||||||
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
|
||||||
}
|
|
||||||
|
|
||||||
var (
|
|
||||||
file_oracle_v1_query_proto_rawDescOnce sync.Once
|
|
||||||
file_oracle_v1_query_proto_rawDescData = file_oracle_v1_query_proto_rawDesc
|
|
||||||
)
|
|
||||||
|
|
||||||
func file_oracle_v1_query_proto_rawDescGZIP() []byte {
|
|
||||||
file_oracle_v1_query_proto_rawDescOnce.Do(func() {
|
|
||||||
file_oracle_v1_query_proto_rawDescData = protoimpl.X.CompressGZIP(file_oracle_v1_query_proto_rawDescData)
|
|
||||||
})
|
|
||||||
return file_oracle_v1_query_proto_rawDescData
|
|
||||||
}
|
|
||||||
|
|
||||||
var file_oracle_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
|
||||||
var file_oracle_v1_query_proto_goTypes = []interface{}{
|
|
||||||
(*QueryParamsRequest)(nil), // 0: oracle.v1.QueryParamsRequest
|
|
||||||
(*QueryParamsResponse)(nil), // 1: oracle.v1.QueryParamsResponse
|
|
||||||
(*Params)(nil), // 2: oracle.v1.Params
|
|
||||||
}
|
|
||||||
var file_oracle_v1_query_proto_depIdxs = []int32{
|
|
||||||
2, // 0: oracle.v1.QueryParamsResponse.params:type_name -> oracle.v1.Params
|
|
||||||
0, // 1: oracle.v1.Query.Params:input_type -> oracle.v1.QueryParamsRequest
|
|
||||||
1, // 2: oracle.v1.Query.Params:output_type -> oracle.v1.QueryParamsResponse
|
|
||||||
2, // [2:3] is the sub-list for method output_type
|
|
||||||
1, // [1:2] is the sub-list for method input_type
|
|
||||||
1, // [1:1] is the sub-list for extension type_name
|
|
||||||
1, // [1:1] is the sub-list for extension extendee
|
|
||||||
0, // [0:1] is the sub-list for field type_name
|
|
||||||
}
|
|
||||||
|
|
||||||
func init() { file_oracle_v1_query_proto_init() }
|
|
||||||
func file_oracle_v1_query_proto_init() {
|
|
||||||
if File_oracle_v1_query_proto != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
file_oracle_v1_genesis_proto_init()
|
|
||||||
if !protoimpl.UnsafeEnabled {
|
|
||||||
file_oracle_v1_query_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
|
||||||
switch v := v.(*QueryParamsRequest); i {
|
|
||||||
case 0:
|
|
||||||
return &v.state
|
|
||||||
case 1:
|
|
||||||
return &v.sizeCache
|
|
||||||
case 2:
|
|
||||||
return &v.unknownFields
|
|
||||||
default:
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
file_oracle_v1_query_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
|
||||||
switch v := v.(*QueryParamsResponse); i {
|
|
||||||
case 0:
|
|
||||||
return &v.state
|
|
||||||
case 1:
|
|
||||||
return &v.sizeCache
|
|
||||||
case 2:
|
|
||||||
return &v.unknownFields
|
|
||||||
default:
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
type x struct{}
|
|
||||||
out := protoimpl.TypeBuilder{
|
|
||||||
File: protoimpl.DescBuilder{
|
|
||||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
|
||||||
RawDescriptor: file_oracle_v1_query_proto_rawDesc,
|
|
||||||
NumEnums: 0,
|
|
||||||
NumMessages: 2,
|
|
||||||
NumExtensions: 0,
|
|
||||||
NumServices: 1,
|
|
||||||
},
|
|
||||||
GoTypes: file_oracle_v1_query_proto_goTypes,
|
|
||||||
DependencyIndexes: file_oracle_v1_query_proto_depIdxs,
|
|
||||||
MessageInfos: file_oracle_v1_query_proto_msgTypes,
|
|
||||||
}.Build()
|
|
||||||
File_oracle_v1_query_proto = out.File
|
|
||||||
file_oracle_v1_query_proto_rawDesc = nil
|
|
||||||
file_oracle_v1_query_proto_goTypes = nil
|
|
||||||
file_oracle_v1_query_proto_depIdxs = nil
|
|
||||||
}
|
|
||||||
@@ -1,111 +0,0 @@
|
|||||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
||||||
// versions:
|
|
||||||
// - protoc-gen-go-grpc v1.3.0
|
|
||||||
// - protoc (unknown)
|
|
||||||
// source: oracle/v1/query.proto
|
|
||||||
|
|
||||||
package oraclev1
|
|
||||||
|
|
||||||
import (
|
|
||||||
context "context"
|
|
||||||
grpc "google.golang.org/grpc"
|
|
||||||
codes "google.golang.org/grpc/codes"
|
|
||||||
status "google.golang.org/grpc/status"
|
|
||||||
)
|
|
||||||
|
|
||||||
// This is a compile-time assertion to ensure that this generated file
|
|
||||||
// is compatible with the grpc package it is being compiled against.
|
|
||||||
// Requires gRPC-Go v1.32.0 or later.
|
|
||||||
const _ = grpc.SupportPackageIsVersion7
|
|
||||||
|
|
||||||
const (
|
|
||||||
Query_Params_FullMethodName = "/oracle.v1.Query/Params"
|
|
||||||
)
|
|
||||||
|
|
||||||
// QueryClient is the client API for Query service.
|
|
||||||
//
|
|
||||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
|
||||||
type QueryClient interface {
|
|
||||||
// Params queries all parameters of the module.
|
|
||||||
Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error)
|
|
||||||
}
|
|
||||||
|
|
||||||
type queryClient struct {
|
|
||||||
cc grpc.ClientConnInterface
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewQueryClient(cc grpc.ClientConnInterface) QueryClient {
|
|
||||||
return &queryClient{cc}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) {
|
|
||||||
out := new(QueryParamsResponse)
|
|
||||||
err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, opts...)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return out, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// QueryServer is the server API for Query service.
|
|
||||||
// All implementations must embed UnimplementedQueryServer
|
|
||||||
// for forward compatibility
|
|
||||||
type QueryServer interface {
|
|
||||||
// Params queries all parameters of the module.
|
|
||||||
Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error)
|
|
||||||
mustEmbedUnimplementedQueryServer()
|
|
||||||
}
|
|
||||||
|
|
||||||
// UnimplementedQueryServer must be embedded to have forward compatible implementations.
|
|
||||||
type UnimplementedQueryServer struct {
|
|
||||||
}
|
|
||||||
|
|
||||||
func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method Params not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {}
|
|
||||||
|
|
||||||
// UnsafeQueryServer may be embedded to opt out of forward compatibility for this service.
|
|
||||||
// Use of this interface is not recommended, as added methods to QueryServer will
|
|
||||||
// result in compilation errors.
|
|
||||||
type UnsafeQueryServer interface {
|
|
||||||
mustEmbedUnimplementedQueryServer()
|
|
||||||
}
|
|
||||||
|
|
||||||
func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) {
|
|
||||||
s.RegisterService(&Query_ServiceDesc, srv)
|
|
||||||
}
|
|
||||||
|
|
||||||
func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(QueryParamsRequest)
|
|
||||||
if err := dec(in); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if interceptor == nil {
|
|
||||||
return srv.(QueryServer).Params(ctx, in)
|
|
||||||
}
|
|
||||||
info := &grpc.UnaryServerInfo{
|
|
||||||
Server: srv,
|
|
||||||
FullMethod: Query_Params_FullMethodName,
|
|
||||||
}
|
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
||||||
return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest))
|
|
||||||
}
|
|
||||||
return interceptor(ctx, in, info, handler)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Query_ServiceDesc is the grpc.ServiceDesc for Query service.
|
|
||||||
// It's only intended for direct use with grpc.RegisterService,
|
|
||||||
// and not to be introspected or modified (even as a copy)
|
|
||||||
var Query_ServiceDesc = grpc.ServiceDesc{
|
|
||||||
ServiceName: "oracle.v1.Query",
|
|
||||||
HandlerType: (*QueryServer)(nil),
|
|
||||||
Methods: []grpc.MethodDesc{
|
|
||||||
{
|
|
||||||
MethodName: "Params",
|
|
||||||
Handler: _Query_Params_Handler,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
Streams: []grpc.StreamDesc{},
|
|
||||||
Metadata: "oracle/v1/query.proto",
|
|
||||||
}
|
|
||||||
@@ -1,342 +0,0 @@
|
|||||||
// Code generated by protoc-gen-go-cosmos-orm. DO NOT EDIT.
|
|
||||||
|
|
||||||
package oraclev1
|
|
||||||
|
|
||||||
import (
|
|
||||||
context "context"
|
|
||||||
ormlist "cosmossdk.io/orm/model/ormlist"
|
|
||||||
ormtable "cosmossdk.io/orm/model/ormtable"
|
|
||||||
ormerrors "cosmossdk.io/orm/types/ormerrors"
|
|
||||||
)
|
|
||||||
|
|
||||||
type BalanceTable interface {
|
|
||||||
Insert(ctx context.Context, balance *Balance) error
|
|
||||||
Update(ctx context.Context, balance *Balance) error
|
|
||||||
Save(ctx context.Context, balance *Balance) error
|
|
||||||
Delete(ctx context.Context, balance *Balance) error
|
|
||||||
Has(ctx context.Context, account string) (found bool, err error)
|
|
||||||
// Get returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found.
|
|
||||||
Get(ctx context.Context, account string) (*Balance, error)
|
|
||||||
List(ctx context.Context, prefixKey BalanceIndexKey, opts ...ormlist.Option) (BalanceIterator, error)
|
|
||||||
ListRange(ctx context.Context, from, to BalanceIndexKey, opts ...ormlist.Option) (BalanceIterator, error)
|
|
||||||
DeleteBy(ctx context.Context, prefixKey BalanceIndexKey) error
|
|
||||||
DeleteRange(ctx context.Context, from, to BalanceIndexKey) error
|
|
||||||
|
|
||||||
doNotImplement()
|
|
||||||
}
|
|
||||||
|
|
||||||
type BalanceIterator struct {
|
|
||||||
ormtable.Iterator
|
|
||||||
}
|
|
||||||
|
|
||||||
func (i BalanceIterator) Value() (*Balance, error) {
|
|
||||||
var balance Balance
|
|
||||||
err := i.UnmarshalMessage(&balance)
|
|
||||||
return &balance, err
|
|
||||||
}
|
|
||||||
|
|
||||||
type BalanceIndexKey interface {
|
|
||||||
id() uint32
|
|
||||||
values() []interface{}
|
|
||||||
balanceIndexKey()
|
|
||||||
}
|
|
||||||
|
|
||||||
// primary key starting index..
|
|
||||||
type BalancePrimaryKey = BalanceAccountIndexKey
|
|
||||||
|
|
||||||
type BalanceAccountIndexKey struct {
|
|
||||||
vs []interface{}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x BalanceAccountIndexKey) id() uint32 { return 0 }
|
|
||||||
func (x BalanceAccountIndexKey) values() []interface{} { return x.vs }
|
|
||||||
func (x BalanceAccountIndexKey) balanceIndexKey() {}
|
|
||||||
|
|
||||||
func (this BalanceAccountIndexKey) WithAccount(account string) BalanceAccountIndexKey {
|
|
||||||
this.vs = []interface{}{account}
|
|
||||||
return this
|
|
||||||
}
|
|
||||||
|
|
||||||
type BalanceAmountIndexKey struct {
|
|
||||||
vs []interface{}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x BalanceAmountIndexKey) id() uint32 { return 1 }
|
|
||||||
func (x BalanceAmountIndexKey) values() []interface{} { return x.vs }
|
|
||||||
func (x BalanceAmountIndexKey) balanceIndexKey() {}
|
|
||||||
|
|
||||||
func (this BalanceAmountIndexKey) WithAmount(amount uint64) BalanceAmountIndexKey {
|
|
||||||
this.vs = []interface{}{amount}
|
|
||||||
return this
|
|
||||||
}
|
|
||||||
|
|
||||||
type balanceTable struct {
|
|
||||||
table ormtable.Table
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this balanceTable) Insert(ctx context.Context, balance *Balance) error {
|
|
||||||
return this.table.Insert(ctx, balance)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this balanceTable) Update(ctx context.Context, balance *Balance) error {
|
|
||||||
return this.table.Update(ctx, balance)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this balanceTable) Save(ctx context.Context, balance *Balance) error {
|
|
||||||
return this.table.Save(ctx, balance)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this balanceTable) Delete(ctx context.Context, balance *Balance) error {
|
|
||||||
return this.table.Delete(ctx, balance)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this balanceTable) Has(ctx context.Context, account string) (found bool, err error) {
|
|
||||||
return this.table.PrimaryKey().Has(ctx, account)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this balanceTable) Get(ctx context.Context, account string) (*Balance, error) {
|
|
||||||
var balance Balance
|
|
||||||
found, err := this.table.PrimaryKey().Get(ctx, &balance, account)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if !found {
|
|
||||||
return nil, ormerrors.NotFound
|
|
||||||
}
|
|
||||||
return &balance, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this balanceTable) List(ctx context.Context, prefixKey BalanceIndexKey, opts ...ormlist.Option) (BalanceIterator, error) {
|
|
||||||
it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...)
|
|
||||||
return BalanceIterator{it}, err
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this balanceTable) ListRange(ctx context.Context, from, to BalanceIndexKey, opts ...ormlist.Option) (BalanceIterator, error) {
|
|
||||||
it, err := this.table.GetIndexByID(from.id()).ListRange(ctx, from.values(), to.values(), opts...)
|
|
||||||
return BalanceIterator{it}, err
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this balanceTable) DeleteBy(ctx context.Context, prefixKey BalanceIndexKey) error {
|
|
||||||
return this.table.GetIndexByID(prefixKey.id()).DeleteBy(ctx, prefixKey.values()...)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this balanceTable) DeleteRange(ctx context.Context, from, to BalanceIndexKey) error {
|
|
||||||
return this.table.GetIndexByID(from.id()).DeleteRange(ctx, from.values(), to.values())
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this balanceTable) doNotImplement() {}
|
|
||||||
|
|
||||||
var _ BalanceTable = balanceTable{}
|
|
||||||
|
|
||||||
func NewBalanceTable(db ormtable.Schema) (BalanceTable, error) {
|
|
||||||
table := db.GetTable(&Balance{})
|
|
||||||
if table == nil {
|
|
||||||
return nil, ormerrors.TableNotFound.Wrap(string((&Balance{}).ProtoReflect().Descriptor().FullName()))
|
|
||||||
}
|
|
||||||
return balanceTable{table}, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
type AccountTable interface {
|
|
||||||
Insert(ctx context.Context, account *Account) error
|
|
||||||
Update(ctx context.Context, account *Account) error
|
|
||||||
Save(ctx context.Context, account *Account) error
|
|
||||||
Delete(ctx context.Context, account *Account) error
|
|
||||||
Has(ctx context.Context, id uint64) (found bool, err error)
|
|
||||||
// Get returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found.
|
|
||||||
Get(ctx context.Context, id uint64) (*Account, error)
|
|
||||||
HasByAddressChainNetwork(ctx context.Context, address string, chain string, network string) (found bool, err error)
|
|
||||||
// GetByAddressChainNetwork returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found.
|
|
||||||
GetByAddressChainNetwork(ctx context.Context, address string, chain string, network string) (*Account, error)
|
|
||||||
List(ctx context.Context, prefixKey AccountIndexKey, opts ...ormlist.Option) (AccountIterator, error)
|
|
||||||
ListRange(ctx context.Context, from, to AccountIndexKey, opts ...ormlist.Option) (AccountIterator, error)
|
|
||||||
DeleteBy(ctx context.Context, prefixKey AccountIndexKey) error
|
|
||||||
DeleteRange(ctx context.Context, from, to AccountIndexKey) error
|
|
||||||
|
|
||||||
doNotImplement()
|
|
||||||
}
|
|
||||||
|
|
||||||
type AccountIterator struct {
|
|
||||||
ormtable.Iterator
|
|
||||||
}
|
|
||||||
|
|
||||||
func (i AccountIterator) Value() (*Account, error) {
|
|
||||||
var account Account
|
|
||||||
err := i.UnmarshalMessage(&account)
|
|
||||||
return &account, err
|
|
||||||
}
|
|
||||||
|
|
||||||
type AccountIndexKey interface {
|
|
||||||
id() uint32
|
|
||||||
values() []interface{}
|
|
||||||
accountIndexKey()
|
|
||||||
}
|
|
||||||
|
|
||||||
// primary key starting index..
|
|
||||||
type AccountPrimaryKey = AccountIdIndexKey
|
|
||||||
|
|
||||||
type AccountIdIndexKey struct {
|
|
||||||
vs []interface{}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x AccountIdIndexKey) id() uint32 { return 0 }
|
|
||||||
func (x AccountIdIndexKey) values() []interface{} { return x.vs }
|
|
||||||
func (x AccountIdIndexKey) accountIndexKey() {}
|
|
||||||
|
|
||||||
func (this AccountIdIndexKey) WithId(id uint64) AccountIdIndexKey {
|
|
||||||
this.vs = []interface{}{id}
|
|
||||||
return this
|
|
||||||
}
|
|
||||||
|
|
||||||
type AccountAddressChainNetworkIndexKey struct {
|
|
||||||
vs []interface{}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x AccountAddressChainNetworkIndexKey) id() uint32 { return 1 }
|
|
||||||
func (x AccountAddressChainNetworkIndexKey) values() []interface{} { return x.vs }
|
|
||||||
func (x AccountAddressChainNetworkIndexKey) accountIndexKey() {}
|
|
||||||
|
|
||||||
func (this AccountAddressChainNetworkIndexKey) WithAddress(address string) AccountAddressChainNetworkIndexKey {
|
|
||||||
this.vs = []interface{}{address}
|
|
||||||
return this
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this AccountAddressChainNetworkIndexKey) WithAddressChain(address string, chain string) AccountAddressChainNetworkIndexKey {
|
|
||||||
this.vs = []interface{}{address, chain}
|
|
||||||
return this
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this AccountAddressChainNetworkIndexKey) WithAddressChainNetwork(address string, chain string, network string) AccountAddressChainNetworkIndexKey {
|
|
||||||
this.vs = []interface{}{address, chain, network}
|
|
||||||
return this
|
|
||||||
}
|
|
||||||
|
|
||||||
type accountTable struct {
|
|
||||||
table ormtable.Table
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this accountTable) Insert(ctx context.Context, account *Account) error {
|
|
||||||
return this.table.Insert(ctx, account)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this accountTable) Update(ctx context.Context, account *Account) error {
|
|
||||||
return this.table.Update(ctx, account)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this accountTable) Save(ctx context.Context, account *Account) error {
|
|
||||||
return this.table.Save(ctx, account)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this accountTable) Delete(ctx context.Context, account *Account) error {
|
|
||||||
return this.table.Delete(ctx, account)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this accountTable) Has(ctx context.Context, id uint64) (found bool, err error) {
|
|
||||||
return this.table.PrimaryKey().Has(ctx, id)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this accountTable) Get(ctx context.Context, id uint64) (*Account, error) {
|
|
||||||
var account Account
|
|
||||||
found, err := this.table.PrimaryKey().Get(ctx, &account, id)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if !found {
|
|
||||||
return nil, ormerrors.NotFound
|
|
||||||
}
|
|
||||||
return &account, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this accountTable) HasByAddressChainNetwork(ctx context.Context, address string, chain string, network string) (found bool, err error) {
|
|
||||||
return this.table.GetIndexByID(1).(ormtable.UniqueIndex).Has(ctx,
|
|
||||||
address,
|
|
||||||
chain,
|
|
||||||
network,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this accountTable) GetByAddressChainNetwork(ctx context.Context, address string, chain string, network string) (*Account, error) {
|
|
||||||
var account Account
|
|
||||||
found, err := this.table.GetIndexByID(1).(ormtable.UniqueIndex).Get(ctx, &account,
|
|
||||||
address,
|
|
||||||
chain,
|
|
||||||
network,
|
|
||||||
)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if !found {
|
|
||||||
return nil, ormerrors.NotFound
|
|
||||||
}
|
|
||||||
return &account, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this accountTable) List(ctx context.Context, prefixKey AccountIndexKey, opts ...ormlist.Option) (AccountIterator, error) {
|
|
||||||
it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...)
|
|
||||||
return AccountIterator{it}, err
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this accountTable) ListRange(ctx context.Context, from, to AccountIndexKey, opts ...ormlist.Option) (AccountIterator, error) {
|
|
||||||
it, err := this.table.GetIndexByID(from.id()).ListRange(ctx, from.values(), to.values(), opts...)
|
|
||||||
return AccountIterator{it}, err
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this accountTable) DeleteBy(ctx context.Context, prefixKey AccountIndexKey) error {
|
|
||||||
return this.table.GetIndexByID(prefixKey.id()).DeleteBy(ctx, prefixKey.values()...)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this accountTable) DeleteRange(ctx context.Context, from, to AccountIndexKey) error {
|
|
||||||
return this.table.GetIndexByID(from.id()).DeleteRange(ctx, from.values(), to.values())
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this accountTable) doNotImplement() {}
|
|
||||||
|
|
||||||
var _ AccountTable = accountTable{}
|
|
||||||
|
|
||||||
func NewAccountTable(db ormtable.Schema) (AccountTable, error) {
|
|
||||||
table := db.GetTable(&Account{})
|
|
||||||
if table == nil {
|
|
||||||
return nil, ormerrors.TableNotFound.Wrap(string((&Account{}).ProtoReflect().Descriptor().FullName()))
|
|
||||||
}
|
|
||||||
return accountTable{table}, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
type StateStore interface {
|
|
||||||
BalanceTable() BalanceTable
|
|
||||||
AccountTable() AccountTable
|
|
||||||
|
|
||||||
doNotImplement()
|
|
||||||
}
|
|
||||||
|
|
||||||
type stateStore struct {
|
|
||||||
balance BalanceTable
|
|
||||||
account AccountTable
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x stateStore) BalanceTable() BalanceTable {
|
|
||||||
return x.balance
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x stateStore) AccountTable() AccountTable {
|
|
||||||
return x.account
|
|
||||||
}
|
|
||||||
|
|
||||||
func (stateStore) doNotImplement() {}
|
|
||||||
|
|
||||||
var _ StateStore = stateStore{}
|
|
||||||
|
|
||||||
func NewStateStore(db ormtable.Schema) (StateStore, error) {
|
|
||||||
balanceTable, err := NewBalanceTable(db)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
accountTable, err := NewAccountTable(db)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return stateStore{
|
|
||||||
balanceTable,
|
|
||||||
accountTable,
|
|
||||||
}, nil
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,115 +0,0 @@
|
|||||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
||||||
// versions:
|
|
||||||
// - protoc-gen-go-grpc v1.3.0
|
|
||||||
// - protoc (unknown)
|
|
||||||
// source: oracle/v1/tx.proto
|
|
||||||
|
|
||||||
package oraclev1
|
|
||||||
|
|
||||||
import (
|
|
||||||
context "context"
|
|
||||||
grpc "google.golang.org/grpc"
|
|
||||||
codes "google.golang.org/grpc/codes"
|
|
||||||
status "google.golang.org/grpc/status"
|
|
||||||
)
|
|
||||||
|
|
||||||
// This is a compile-time assertion to ensure that this generated file
|
|
||||||
// is compatible with the grpc package it is being compiled against.
|
|
||||||
// Requires gRPC-Go v1.32.0 or later.
|
|
||||||
const _ = grpc.SupportPackageIsVersion7
|
|
||||||
|
|
||||||
const (
|
|
||||||
Msg_UpdateParams_FullMethodName = "/oracle.v1.Msg/UpdateParams"
|
|
||||||
)
|
|
||||||
|
|
||||||
// MsgClient is the client API for Msg service.
|
|
||||||
//
|
|
||||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
|
||||||
type MsgClient interface {
|
|
||||||
// UpdateParams defines a governance operation for updating the parameters.
|
|
||||||
//
|
|
||||||
// Since: cosmos-sdk 0.47
|
|
||||||
UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error)
|
|
||||||
}
|
|
||||||
|
|
||||||
type msgClient struct {
|
|
||||||
cc grpc.ClientConnInterface
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewMsgClient(cc grpc.ClientConnInterface) MsgClient {
|
|
||||||
return &msgClient{cc}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) {
|
|
||||||
out := new(MsgUpdateParamsResponse)
|
|
||||||
err := c.cc.Invoke(ctx, Msg_UpdateParams_FullMethodName, in, out, opts...)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return out, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// MsgServer is the server API for Msg service.
|
|
||||||
// All implementations must embed UnimplementedMsgServer
|
|
||||||
// for forward compatibility
|
|
||||||
type MsgServer interface {
|
|
||||||
// UpdateParams defines a governance operation for updating the parameters.
|
|
||||||
//
|
|
||||||
// Since: cosmos-sdk 0.47
|
|
||||||
UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error)
|
|
||||||
mustEmbedUnimplementedMsgServer()
|
|
||||||
}
|
|
||||||
|
|
||||||
// UnimplementedMsgServer must be embedded to have forward compatible implementations.
|
|
||||||
type UnimplementedMsgServer struct {
|
|
||||||
}
|
|
||||||
|
|
||||||
func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {}
|
|
||||||
|
|
||||||
// UnsafeMsgServer may be embedded to opt out of forward compatibility for this service.
|
|
||||||
// Use of this interface is not recommended, as added methods to MsgServer will
|
|
||||||
// result in compilation errors.
|
|
||||||
type UnsafeMsgServer interface {
|
|
||||||
mustEmbedUnimplementedMsgServer()
|
|
||||||
}
|
|
||||||
|
|
||||||
func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) {
|
|
||||||
s.RegisterService(&Msg_ServiceDesc, srv)
|
|
||||||
}
|
|
||||||
|
|
||||||
func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(MsgUpdateParams)
|
|
||||||
if err := dec(in); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if interceptor == nil {
|
|
||||||
return srv.(MsgServer).UpdateParams(ctx, in)
|
|
||||||
}
|
|
||||||
info := &grpc.UnaryServerInfo{
|
|
||||||
Server: srv,
|
|
||||||
FullMethod: Msg_UpdateParams_FullMethodName,
|
|
||||||
}
|
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
||||||
return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams))
|
|
||||||
}
|
|
||||||
return interceptor(ctx, in, info, handler)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Msg_ServiceDesc is the grpc.ServiceDesc for Msg service.
|
|
||||||
// It's only intended for direct use with grpc.RegisterService,
|
|
||||||
// and not to be introspected or modified (even as a copy)
|
|
||||||
var Msg_ServiceDesc = grpc.ServiceDesc{
|
|
||||||
ServiceName: "oracle.v1.Msg",
|
|
||||||
HandlerType: (*MsgServer)(nil),
|
|
||||||
Methods: []grpc.MethodDesc{
|
|
||||||
{
|
|
||||||
MethodName: "UpdateParams",
|
|
||||||
Handler: _Msg_UpdateParams_Handler,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
Streams: []grpc.StreamDesc{},
|
|
||||||
Metadata: "oracle/v1/tx.proto",
|
|
||||||
}
|
|
||||||
+100
-27
@@ -999,6 +999,7 @@ var (
|
|||||||
fd_Schema_asset protoreflect.FieldDescriptor
|
fd_Schema_asset protoreflect.FieldDescriptor
|
||||||
fd_Schema_chain protoreflect.FieldDescriptor
|
fd_Schema_chain protoreflect.FieldDescriptor
|
||||||
fd_Schema_credential protoreflect.FieldDescriptor
|
fd_Schema_credential protoreflect.FieldDescriptor
|
||||||
|
fd_Schema_did protoreflect.FieldDescriptor
|
||||||
fd_Schema_jwk protoreflect.FieldDescriptor
|
fd_Schema_jwk protoreflect.FieldDescriptor
|
||||||
fd_Schema_grant protoreflect.FieldDescriptor
|
fd_Schema_grant protoreflect.FieldDescriptor
|
||||||
fd_Schema_keyshare protoreflect.FieldDescriptor
|
fd_Schema_keyshare protoreflect.FieldDescriptor
|
||||||
@@ -1013,6 +1014,7 @@ func init() {
|
|||||||
fd_Schema_asset = md_Schema.Fields().ByName("asset")
|
fd_Schema_asset = md_Schema.Fields().ByName("asset")
|
||||||
fd_Schema_chain = md_Schema.Fields().ByName("chain")
|
fd_Schema_chain = md_Schema.Fields().ByName("chain")
|
||||||
fd_Schema_credential = md_Schema.Fields().ByName("credential")
|
fd_Schema_credential = md_Schema.Fields().ByName("credential")
|
||||||
|
fd_Schema_did = md_Schema.Fields().ByName("did")
|
||||||
fd_Schema_jwk = md_Schema.Fields().ByName("jwk")
|
fd_Schema_jwk = md_Schema.Fields().ByName("jwk")
|
||||||
fd_Schema_grant = md_Schema.Fields().ByName("grant")
|
fd_Schema_grant = md_Schema.Fields().ByName("grant")
|
||||||
fd_Schema_keyshare = md_Schema.Fields().ByName("keyshare")
|
fd_Schema_keyshare = md_Schema.Fields().ByName("keyshare")
|
||||||
@@ -1114,6 +1116,12 @@ func (x *fastReflection_Schema) Range(f func(protoreflect.FieldDescriptor, proto
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if x.Did != "" {
|
||||||
|
value := protoreflect.ValueOfString(x.Did)
|
||||||
|
if !f(fd_Schema_did, value) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
if x.Jwk != "" {
|
if x.Jwk != "" {
|
||||||
value := protoreflect.ValueOfString(x.Jwk)
|
value := protoreflect.ValueOfString(x.Jwk)
|
||||||
if !f(fd_Schema_jwk, value) {
|
if !f(fd_Schema_jwk, value) {
|
||||||
@@ -1163,6 +1171,8 @@ func (x *fastReflection_Schema) Has(fd protoreflect.FieldDescriptor) bool {
|
|||||||
return x.Chain != ""
|
return x.Chain != ""
|
||||||
case "vault.v1.Schema.credential":
|
case "vault.v1.Schema.credential":
|
||||||
return x.Credential != ""
|
return x.Credential != ""
|
||||||
|
case "vault.v1.Schema.did":
|
||||||
|
return x.Did != ""
|
||||||
case "vault.v1.Schema.jwk":
|
case "vault.v1.Schema.jwk":
|
||||||
return x.Jwk != ""
|
return x.Jwk != ""
|
||||||
case "vault.v1.Schema.grant":
|
case "vault.v1.Schema.grant":
|
||||||
@@ -1197,6 +1207,8 @@ func (x *fastReflection_Schema) Clear(fd protoreflect.FieldDescriptor) {
|
|||||||
x.Chain = ""
|
x.Chain = ""
|
||||||
case "vault.v1.Schema.credential":
|
case "vault.v1.Schema.credential":
|
||||||
x.Credential = ""
|
x.Credential = ""
|
||||||
|
case "vault.v1.Schema.did":
|
||||||
|
x.Did = ""
|
||||||
case "vault.v1.Schema.jwk":
|
case "vault.v1.Schema.jwk":
|
||||||
x.Jwk = ""
|
x.Jwk = ""
|
||||||
case "vault.v1.Schema.grant":
|
case "vault.v1.Schema.grant":
|
||||||
@@ -1236,6 +1248,9 @@ func (x *fastReflection_Schema) Get(descriptor protoreflect.FieldDescriptor) pro
|
|||||||
case "vault.v1.Schema.credential":
|
case "vault.v1.Schema.credential":
|
||||||
value := x.Credential
|
value := x.Credential
|
||||||
return protoreflect.ValueOfString(value)
|
return protoreflect.ValueOfString(value)
|
||||||
|
case "vault.v1.Schema.did":
|
||||||
|
value := x.Did
|
||||||
|
return protoreflect.ValueOfString(value)
|
||||||
case "vault.v1.Schema.jwk":
|
case "vault.v1.Schema.jwk":
|
||||||
value := x.Jwk
|
value := x.Jwk
|
||||||
return protoreflect.ValueOfString(value)
|
return protoreflect.ValueOfString(value)
|
||||||
@@ -1278,6 +1293,8 @@ func (x *fastReflection_Schema) Set(fd protoreflect.FieldDescriptor, value proto
|
|||||||
x.Chain = value.Interface().(string)
|
x.Chain = value.Interface().(string)
|
||||||
case "vault.v1.Schema.credential":
|
case "vault.v1.Schema.credential":
|
||||||
x.Credential = value.Interface().(string)
|
x.Credential = value.Interface().(string)
|
||||||
|
case "vault.v1.Schema.did":
|
||||||
|
x.Did = value.Interface().(string)
|
||||||
case "vault.v1.Schema.jwk":
|
case "vault.v1.Schema.jwk":
|
||||||
x.Jwk = value.Interface().(string)
|
x.Jwk = value.Interface().(string)
|
||||||
case "vault.v1.Schema.grant":
|
case "vault.v1.Schema.grant":
|
||||||
@@ -1316,6 +1333,8 @@ func (x *fastReflection_Schema) Mutable(fd protoreflect.FieldDescriptor) protore
|
|||||||
panic(fmt.Errorf("field chain of message vault.v1.Schema is not mutable"))
|
panic(fmt.Errorf("field chain of message vault.v1.Schema is not mutable"))
|
||||||
case "vault.v1.Schema.credential":
|
case "vault.v1.Schema.credential":
|
||||||
panic(fmt.Errorf("field credential of message vault.v1.Schema is not mutable"))
|
panic(fmt.Errorf("field credential of message vault.v1.Schema is not mutable"))
|
||||||
|
case "vault.v1.Schema.did":
|
||||||
|
panic(fmt.Errorf("field did of message vault.v1.Schema is not mutable"))
|
||||||
case "vault.v1.Schema.jwk":
|
case "vault.v1.Schema.jwk":
|
||||||
panic(fmt.Errorf("field jwk of message vault.v1.Schema is not mutable"))
|
panic(fmt.Errorf("field jwk of message vault.v1.Schema is not mutable"))
|
||||||
case "vault.v1.Schema.grant":
|
case "vault.v1.Schema.grant":
|
||||||
@@ -1347,6 +1366,8 @@ func (x *fastReflection_Schema) NewField(fd protoreflect.FieldDescriptor) protor
|
|||||||
return protoreflect.ValueOfString("")
|
return protoreflect.ValueOfString("")
|
||||||
case "vault.v1.Schema.credential":
|
case "vault.v1.Schema.credential":
|
||||||
return protoreflect.ValueOfString("")
|
return protoreflect.ValueOfString("")
|
||||||
|
case "vault.v1.Schema.did":
|
||||||
|
return protoreflect.ValueOfString("")
|
||||||
case "vault.v1.Schema.jwk":
|
case "vault.v1.Schema.jwk":
|
||||||
return protoreflect.ValueOfString("")
|
return protoreflect.ValueOfString("")
|
||||||
case "vault.v1.Schema.grant":
|
case "vault.v1.Schema.grant":
|
||||||
@@ -1443,6 +1464,10 @@ func (x *fastReflection_Schema) ProtoMethods() *protoiface.Methods {
|
|||||||
if l > 0 {
|
if l > 0 {
|
||||||
n += 1 + l + runtime.Sov(uint64(l))
|
n += 1 + l + runtime.Sov(uint64(l))
|
||||||
}
|
}
|
||||||
|
l = len(x.Did)
|
||||||
|
if l > 0 {
|
||||||
|
n += 1 + l + runtime.Sov(uint64(l))
|
||||||
|
}
|
||||||
l = len(x.Jwk)
|
l = len(x.Jwk)
|
||||||
if l > 0 {
|
if l > 0 {
|
||||||
n += 1 + l + runtime.Sov(uint64(l))
|
n += 1 + l + runtime.Sov(uint64(l))
|
||||||
@@ -1493,27 +1518,34 @@ func (x *fastReflection_Schema) ProtoMethods() *protoiface.Methods {
|
|||||||
copy(dAtA[i:], x.Profile)
|
copy(dAtA[i:], x.Profile)
|
||||||
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Profile)))
|
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Profile)))
|
||||||
i--
|
i--
|
||||||
dAtA[i] = 0x4a
|
dAtA[i] = 0x52
|
||||||
}
|
}
|
||||||
if len(x.Keyshare) > 0 {
|
if len(x.Keyshare) > 0 {
|
||||||
i -= len(x.Keyshare)
|
i -= len(x.Keyshare)
|
||||||
copy(dAtA[i:], x.Keyshare)
|
copy(dAtA[i:], x.Keyshare)
|
||||||
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Keyshare)))
|
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Keyshare)))
|
||||||
i--
|
i--
|
||||||
dAtA[i] = 0x42
|
dAtA[i] = 0x4a
|
||||||
}
|
}
|
||||||
if len(x.Grant) > 0 {
|
if len(x.Grant) > 0 {
|
||||||
i -= len(x.Grant)
|
i -= len(x.Grant)
|
||||||
copy(dAtA[i:], x.Grant)
|
copy(dAtA[i:], x.Grant)
|
||||||
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Grant)))
|
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Grant)))
|
||||||
i--
|
i--
|
||||||
dAtA[i] = 0x3a
|
dAtA[i] = 0x42
|
||||||
}
|
}
|
||||||
if len(x.Jwk) > 0 {
|
if len(x.Jwk) > 0 {
|
||||||
i -= len(x.Jwk)
|
i -= len(x.Jwk)
|
||||||
copy(dAtA[i:], x.Jwk)
|
copy(dAtA[i:], x.Jwk)
|
||||||
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Jwk)))
|
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Jwk)))
|
||||||
i--
|
i--
|
||||||
|
dAtA[i] = 0x3a
|
||||||
|
}
|
||||||
|
if len(x.Did) > 0 {
|
||||||
|
i -= len(x.Did)
|
||||||
|
copy(dAtA[i:], x.Did)
|
||||||
|
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Did)))
|
||||||
|
i--
|
||||||
dAtA[i] = 0x32
|
dAtA[i] = 0x32
|
||||||
}
|
}
|
||||||
if len(x.Credential) > 0 {
|
if len(x.Credential) > 0 {
|
||||||
@@ -1746,6 +1778,38 @@ func (x *fastReflection_Schema) ProtoMethods() *protoiface.Methods {
|
|||||||
x.Credential = string(dAtA[iNdEx:postIndex])
|
x.Credential = string(dAtA[iNdEx:postIndex])
|
||||||
iNdEx = postIndex
|
iNdEx = postIndex
|
||||||
case 6:
|
case 6:
|
||||||
|
if wireType != 2 {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Did", wireType)
|
||||||
|
}
|
||||||
|
var stringLen uint64
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
stringLen |= uint64(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
intStringLen := int(stringLen)
|
||||||
|
if intStringLen < 0 {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
|
||||||
|
}
|
||||||
|
postIndex := iNdEx + intStringLen
|
||||||
|
if postIndex < 0 {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
|
||||||
|
}
|
||||||
|
if postIndex > l {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
x.Did = string(dAtA[iNdEx:postIndex])
|
||||||
|
iNdEx = postIndex
|
||||||
|
case 7:
|
||||||
if wireType != 2 {
|
if wireType != 2 {
|
||||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Jwk", wireType)
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Jwk", wireType)
|
||||||
}
|
}
|
||||||
@@ -1777,7 +1841,7 @@ func (x *fastReflection_Schema) ProtoMethods() *protoiface.Methods {
|
|||||||
}
|
}
|
||||||
x.Jwk = string(dAtA[iNdEx:postIndex])
|
x.Jwk = string(dAtA[iNdEx:postIndex])
|
||||||
iNdEx = postIndex
|
iNdEx = postIndex
|
||||||
case 7:
|
case 8:
|
||||||
if wireType != 2 {
|
if wireType != 2 {
|
||||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Grant", wireType)
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Grant", wireType)
|
||||||
}
|
}
|
||||||
@@ -1809,7 +1873,7 @@ func (x *fastReflection_Schema) ProtoMethods() *protoiface.Methods {
|
|||||||
}
|
}
|
||||||
x.Grant = string(dAtA[iNdEx:postIndex])
|
x.Grant = string(dAtA[iNdEx:postIndex])
|
||||||
iNdEx = postIndex
|
iNdEx = postIndex
|
||||||
case 8:
|
case 9:
|
||||||
if wireType != 2 {
|
if wireType != 2 {
|
||||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Keyshare", wireType)
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Keyshare", wireType)
|
||||||
}
|
}
|
||||||
@@ -1841,7 +1905,7 @@ func (x *fastReflection_Schema) ProtoMethods() *protoiface.Methods {
|
|||||||
}
|
}
|
||||||
x.Keyshare = string(dAtA[iNdEx:postIndex])
|
x.Keyshare = string(dAtA[iNdEx:postIndex])
|
||||||
iNdEx = postIndex
|
iNdEx = postIndex
|
||||||
case 9:
|
case 10:
|
||||||
if wireType != 2 {
|
if wireType != 2 {
|
||||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Profile", wireType)
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Profile", wireType)
|
||||||
}
|
}
|
||||||
@@ -2020,10 +2084,11 @@ type Schema struct {
|
|||||||
Asset string `protobuf:"bytes,3,opt,name=asset,proto3" json:"asset,omitempty"`
|
Asset string `protobuf:"bytes,3,opt,name=asset,proto3" json:"asset,omitempty"`
|
||||||
Chain string `protobuf:"bytes,4,opt,name=chain,proto3" json:"chain,omitempty"`
|
Chain string `protobuf:"bytes,4,opt,name=chain,proto3" json:"chain,omitempty"`
|
||||||
Credential string `protobuf:"bytes,5,opt,name=credential,proto3" json:"credential,omitempty"`
|
Credential string `protobuf:"bytes,5,opt,name=credential,proto3" json:"credential,omitempty"`
|
||||||
Jwk string `protobuf:"bytes,6,opt,name=jwk,proto3" json:"jwk,omitempty"`
|
Did string `protobuf:"bytes,6,opt,name=did,proto3" json:"did,omitempty"`
|
||||||
Grant string `protobuf:"bytes,7,opt,name=grant,proto3" json:"grant,omitempty"`
|
Jwk string `protobuf:"bytes,7,opt,name=jwk,proto3" json:"jwk,omitempty"`
|
||||||
Keyshare string `protobuf:"bytes,8,opt,name=keyshare,proto3" json:"keyshare,omitempty"`
|
Grant string `protobuf:"bytes,8,opt,name=grant,proto3" json:"grant,omitempty"`
|
||||||
Profile string `protobuf:"bytes,9,opt,name=profile,proto3" json:"profile,omitempty"`
|
Keyshare string `protobuf:"bytes,9,opt,name=keyshare,proto3" json:"keyshare,omitempty"`
|
||||||
|
Profile string `protobuf:"bytes,10,opt,name=profile,proto3" json:"profile,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *Schema) Reset() {
|
func (x *Schema) Reset() {
|
||||||
@@ -2081,6 +2146,13 @@ func (x *Schema) GetCredential() string {
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (x *Schema) GetDid() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Did
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
func (x *Schema) GetJwk() string {
|
func (x *Schema) GetJwk() string {
|
||||||
if x != nil {
|
if x != nil {
|
||||||
return x.Jwk
|
return x.Jwk
|
||||||
@@ -2131,7 +2203,7 @@ var file_vault_v1_genesis_proto_rawDesc = []byte{
|
|||||||
0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2e, 0x76, 0x31,
|
0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2e, 0x76, 0x31,
|
||||||
0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x3a,
|
0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x3a,
|
||||||
0x19, 0x98, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x0c, 0x76, 0x61,
|
0x19, 0x98, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x0c, 0x76, 0x61,
|
||||||
0x75, 0x6c, 0x74, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0xe6, 0x01, 0x0a, 0x06, 0x53,
|
0x75, 0x6c, 0x74, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0xf8, 0x01, 0x0a, 0x06, 0x53,
|
||||||
0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e,
|
0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e,
|
||||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12,
|
0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12,
|
||||||
0x18, 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
|
0x18, 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
|
||||||
@@ -2140,22 +2212,23 @@ var file_vault_v1_genesis_proto_rawDesc = []byte{
|
|||||||
0x14, 0x0a, 0x05, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05,
|
0x14, 0x0a, 0x05, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05,
|
||||||
0x63, 0x68, 0x61, 0x69, 0x6e, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74,
|
0x63, 0x68, 0x61, 0x69, 0x6e, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74,
|
||||||
0x69, 0x61, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x64, 0x65,
|
0x69, 0x61, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x64, 0x65,
|
||||||
0x6e, 0x74, 0x69, 0x61, 0x6c, 0x12, 0x10, 0x0a, 0x03, 0x6a, 0x77, 0x6b, 0x18, 0x06, 0x20, 0x01,
|
0x6e, 0x74, 0x69, 0x61, 0x6c, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01,
|
||||||
0x28, 0x09, 0x52, 0x03, 0x6a, 0x77, 0x6b, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x61, 0x6e, 0x74,
|
0x28, 0x09, 0x52, 0x03, 0x64, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x6a, 0x77, 0x6b, 0x18, 0x07,
|
||||||
0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x12, 0x1a, 0x0a,
|
0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6a, 0x77, 0x6b, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x61,
|
||||||
0x08, 0x6b, 0x65, 0x79, 0x73, 0x68, 0x61, 0x72, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52,
|
0x6e, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x12,
|
||||||
0x08, 0x6b, 0x65, 0x79, 0x73, 0x68, 0x61, 0x72, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x72, 0x6f,
|
0x1a, 0x0a, 0x08, 0x6b, 0x65, 0x79, 0x73, 0x68, 0x61, 0x72, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28,
|
||||||
0x66, 0x69, 0x6c, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x72, 0x6f, 0x66,
|
0x09, 0x52, 0x08, 0x6b, 0x65, 0x79, 0x73, 0x68, 0x61, 0x72, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x70,
|
||||||
0x69, 0x6c, 0x65, 0x42, 0x8a, 0x01, 0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x61, 0x75, 0x6c,
|
0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x72,
|
||||||
0x74, 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f,
|
0x6f, 0x66, 0x69, 0x6c, 0x65, 0x42, 0x8a, 0x01, 0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x61,
|
||||||
0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d,
|
0x75, 0x6c, 0x74, 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x50,
|
||||||
0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x61, 0x70, 0x69,
|
0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63,
|
||||||
0x2f, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2f, 0x76, 0x31, 0x3b, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x76,
|
0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x61,
|
||||||
0x31, 0xa2, 0x02, 0x03, 0x56, 0x58, 0x58, 0xaa, 0x02, 0x08, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x2e,
|
0x70, 0x69, 0x2f, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2f, 0x76, 0x31, 0x3b, 0x76, 0x61, 0x75, 0x6c,
|
||||||
0x56, 0x31, 0xca, 0x02, 0x08, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x14,
|
0x74, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x56, 0x58, 0x58, 0xaa, 0x02, 0x08, 0x56, 0x61, 0x75, 0x6c,
|
||||||
0x56, 0x61, 0x75, 0x6c, 0x74, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61,
|
0x74, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x08, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x5c, 0x56, 0x31, 0xe2,
|
||||||
0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x09, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x3a, 0x3a, 0x56, 0x31,
|
0x02, 0x14, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65,
|
||||||
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x09, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x3a, 0x3a,
|
||||||
|
0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|||||||
+245
-1295
File diff suppressed because it is too large
Load Diff
@@ -19,9 +19,9 @@ import (
|
|||||||
const _ = grpc.SupportPackageIsVersion7
|
const _ = grpc.SupportPackageIsVersion7
|
||||||
|
|
||||||
const (
|
const (
|
||||||
Query_Params_FullMethodName = "/vault.v1.Query/Params"
|
Query_Params_FullMethodName = "/vault.v1.Query/Params"
|
||||||
Query_BuildTx_FullMethodName = "/vault.v1.Query/BuildTx"
|
Query_Schema_FullMethodName = "/vault.v1.Query/Schema"
|
||||||
Query_Sync_FullMethodName = "/vault.v1.Query/Sync"
|
Query_Sync_FullMethodName = "/vault.v1.Query/Sync"
|
||||||
)
|
)
|
||||||
|
|
||||||
// QueryClient is the client API for Query service.
|
// QueryClient is the client API for Query service.
|
||||||
@@ -30,8 +30,9 @@ const (
|
|||||||
type QueryClient interface {
|
type QueryClient interface {
|
||||||
// Params queries all parameters of the module.
|
// Params queries all parameters of the module.
|
||||||
Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error)
|
Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error)
|
||||||
// BuildTx builds an unsigned transaction message for the given PKL.
|
// Schema queries the DID document by its id. And returns the required PKL
|
||||||
BuildTx(ctx context.Context, in *BuildTxRequest, opts ...grpc.CallOption) (*BuildTxResponse, error)
|
// information
|
||||||
|
Schema(ctx context.Context, in *QuerySchemaRequest, opts ...grpc.CallOption) (*QuerySchemaResponse, error)
|
||||||
// Sync queries the DID document by its id. And returns the required PKL
|
// Sync queries the DID document by its id. And returns the required PKL
|
||||||
// information
|
// information
|
||||||
Sync(ctx context.Context, in *SyncRequest, opts ...grpc.CallOption) (*SyncResponse, error)
|
Sync(ctx context.Context, in *SyncRequest, opts ...grpc.CallOption) (*SyncResponse, error)
|
||||||
@@ -54,9 +55,9 @@ func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts .
|
|||||||
return out, nil
|
return out, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *queryClient) BuildTx(ctx context.Context, in *BuildTxRequest, opts ...grpc.CallOption) (*BuildTxResponse, error) {
|
func (c *queryClient) Schema(ctx context.Context, in *QuerySchemaRequest, opts ...grpc.CallOption) (*QuerySchemaResponse, error) {
|
||||||
out := new(BuildTxResponse)
|
out := new(QuerySchemaResponse)
|
||||||
err := c.cc.Invoke(ctx, Query_BuildTx_FullMethodName, in, out, opts...)
|
err := c.cc.Invoke(ctx, Query_Schema_FullMethodName, in, out, opts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -78,8 +79,9 @@ func (c *queryClient) Sync(ctx context.Context, in *SyncRequest, opts ...grpc.Ca
|
|||||||
type QueryServer interface {
|
type QueryServer interface {
|
||||||
// Params queries all parameters of the module.
|
// Params queries all parameters of the module.
|
||||||
Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error)
|
Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error)
|
||||||
// BuildTx builds an unsigned transaction message for the given PKL.
|
// Schema queries the DID document by its id. And returns the required PKL
|
||||||
BuildTx(context.Context, *BuildTxRequest) (*BuildTxResponse, error)
|
// information
|
||||||
|
Schema(context.Context, *QuerySchemaRequest) (*QuerySchemaResponse, error)
|
||||||
// Sync queries the DID document by its id. And returns the required PKL
|
// Sync queries the DID document by its id. And returns the required PKL
|
||||||
// information
|
// information
|
||||||
Sync(context.Context, *SyncRequest) (*SyncResponse, error)
|
Sync(context.Context, *SyncRequest) (*SyncResponse, error)
|
||||||
@@ -93,8 +95,8 @@ type UnimplementedQueryServer struct {
|
|||||||
func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) {
|
func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method Params not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method Params not implemented")
|
||||||
}
|
}
|
||||||
func (UnimplementedQueryServer) BuildTx(context.Context, *BuildTxRequest) (*BuildTxResponse, error) {
|
func (UnimplementedQueryServer) Schema(context.Context, *QuerySchemaRequest) (*QuerySchemaResponse, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method BuildTx not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method Schema not implemented")
|
||||||
}
|
}
|
||||||
func (UnimplementedQueryServer) Sync(context.Context, *SyncRequest) (*SyncResponse, error) {
|
func (UnimplementedQueryServer) Sync(context.Context, *SyncRequest) (*SyncResponse, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method Sync not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method Sync not implemented")
|
||||||
@@ -130,20 +132,20 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf
|
|||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
func _Query_BuildTx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
func _Query_Schema_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
in := new(BuildTxRequest)
|
in := new(QuerySchemaRequest)
|
||||||
if err := dec(in); err != nil {
|
if err := dec(in); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if interceptor == nil {
|
if interceptor == nil {
|
||||||
return srv.(QueryServer).BuildTx(ctx, in)
|
return srv.(QueryServer).Schema(ctx, in)
|
||||||
}
|
}
|
||||||
info := &grpc.UnaryServerInfo{
|
info := &grpc.UnaryServerInfo{
|
||||||
Server: srv,
|
Server: srv,
|
||||||
FullMethod: Query_BuildTx_FullMethodName,
|
FullMethod: Query_Schema_FullMethodName,
|
||||||
}
|
}
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
return srv.(QueryServer).BuildTx(ctx, req.(*BuildTxRequest))
|
return srv.(QueryServer).Schema(ctx, req.(*QuerySchemaRequest))
|
||||||
}
|
}
|
||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
@@ -178,8 +180,8 @@ var Query_ServiceDesc = grpc.ServiceDesc{
|
|||||||
Handler: _Query_Params_Handler,
|
Handler: _Query_Params_Handler,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
MethodName: "BuildTx",
|
MethodName: "Schema",
|
||||||
Handler: _Query_BuildTx_Handler,
|
Handler: _Query_Schema_Handler,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
MethodName: "Sync",
|
MethodName: "Sync",
|
||||||
|
|||||||
+23
-35
@@ -151,9 +151,6 @@ import (
|
|||||||
macaroon "github.com/onsonr/sonr/x/macaroon"
|
macaroon "github.com/onsonr/sonr/x/macaroon"
|
||||||
macaroonkeeper "github.com/onsonr/sonr/x/macaroon/keeper"
|
macaroonkeeper "github.com/onsonr/sonr/x/macaroon/keeper"
|
||||||
macaroontypes "github.com/onsonr/sonr/x/macaroon/types"
|
macaroontypes "github.com/onsonr/sonr/x/macaroon/types"
|
||||||
oracle "github.com/onsonr/sonr/x/oracle"
|
|
||||||
oraclekeeper "github.com/onsonr/sonr/x/oracle/keeper"
|
|
||||||
oracletypes "github.com/onsonr/sonr/x/oracle/types"
|
|
||||||
service "github.com/onsonr/sonr/x/service"
|
service "github.com/onsonr/sonr/x/service"
|
||||||
servicekeeper "github.com/onsonr/sonr/x/service/keeper"
|
servicekeeper "github.com/onsonr/sonr/x/service/keeper"
|
||||||
servicetypes "github.com/onsonr/sonr/x/service/types"
|
servicetypes "github.com/onsonr/sonr/x/service/types"
|
||||||
@@ -241,7 +238,6 @@ type SonrApp struct {
|
|||||||
VaultKeeper vaultkeeper.Keeper
|
VaultKeeper vaultkeeper.Keeper
|
||||||
MacaroonKeeper macaroonkeeper.Keeper
|
MacaroonKeeper macaroonkeeper.Keeper
|
||||||
ServiceKeeper servicekeeper.Keeper
|
ServiceKeeper servicekeeper.Keeper
|
||||||
OracleKeeper oraclekeeper.Keeper
|
|
||||||
sm *module.SimulationManager
|
sm *module.SimulationManager
|
||||||
BasicModuleManager module.BasicManager
|
BasicModuleManager module.BasicManager
|
||||||
ModuleManager *module.Manager
|
ModuleManager *module.Manager
|
||||||
@@ -377,7 +373,6 @@ func NewChainApp(
|
|||||||
vaulttypes.StoreKey,
|
vaulttypes.StoreKey,
|
||||||
macaroontypes.StoreKey,
|
macaroontypes.StoreKey,
|
||||||
servicetypes.StoreKey,
|
servicetypes.StoreKey,
|
||||||
oracletypes.StoreKey,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
tkeys := storetypes.NewTransientStoreKeys(paramstypes.TStoreKey)
|
tkeys := storetypes.NewTransientStoreKeys(paramstypes.TStoreKey)
|
||||||
@@ -626,28 +621,15 @@ func NewChainApp(
|
|||||||
// If evidence needs to be handled for the app, set routes in router here and seal
|
// If evidence needs to be handled for the app, set routes in router here and seal
|
||||||
app.EvidenceKeeper = *evidenceKeeper
|
app.EvidenceKeeper = *evidenceKeeper
|
||||||
|
|
||||||
// Create the oracle Keeper
|
// Create the did Keeper
|
||||||
app.OracleKeeper = oraclekeeper.NewKeeper(
|
app.DidKeeper = didkeeper.NewKeeper(
|
||||||
appCodec,
|
appCodec,
|
||||||
sdkruntime.NewKVStoreService(keys[oracletypes.StoreKey]),
|
sdkruntime.NewKVStoreService(keys[didtypes.StoreKey]),
|
||||||
logger,
|
|
||||||
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
|
|
||||||
)
|
|
||||||
|
|
||||||
// Create the service Keeper
|
|
||||||
app.ServiceKeeper = servicekeeper.NewKeeper(
|
|
||||||
appCodec,
|
|
||||||
sdkruntime.NewKVStoreService(keys[servicetypes.StoreKey]),
|
|
||||||
logger,
|
|
||||||
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
|
|
||||||
)
|
|
||||||
|
|
||||||
// Create the macaroon Keeper
|
|
||||||
app.MacaroonKeeper = macaroonkeeper.NewKeeper(
|
|
||||||
appCodec,
|
|
||||||
sdkruntime.NewKVStoreService(keys[macaroontypes.StoreKey]),
|
|
||||||
logger,
|
logger,
|
||||||
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
|
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
|
||||||
|
app.AccountKeeper,
|
||||||
|
app.NFTKeeper,
|
||||||
|
app.StakingKeeper,
|
||||||
)
|
)
|
||||||
|
|
||||||
// Create the vault Keeper
|
// Create the vault Keeper
|
||||||
@@ -656,18 +638,29 @@ func NewChainApp(
|
|||||||
sdkruntime.NewKVStoreService(keys[vaulttypes.StoreKey]),
|
sdkruntime.NewKVStoreService(keys[vaulttypes.StoreKey]),
|
||||||
logger,
|
logger,
|
||||||
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
|
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
|
||||||
|
app.AccountKeeper,
|
||||||
|
app.DidKeeper,
|
||||||
|
)
|
||||||
|
// Create the macaroon Keeper
|
||||||
|
app.MacaroonKeeper = macaroonkeeper.NewKeeper(
|
||||||
|
appCodec,
|
||||||
|
sdkruntime.NewKVStoreService(keys[macaroontypes.StoreKey]),
|
||||||
|
logger,
|
||||||
|
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
|
||||||
|
app.AccountKeeper,
|
||||||
app.DidKeeper,
|
app.DidKeeper,
|
||||||
)
|
)
|
||||||
|
|
||||||
// Create the did Keeper
|
// Create the service Keeper
|
||||||
app.DidKeeper = didkeeper.NewKeeper(
|
app.ServiceKeeper = servicekeeper.NewKeeper(
|
||||||
appCodec,
|
appCodec,
|
||||||
sdkruntime.NewKVStoreService(keys[didtypes.StoreKey]),
|
sdkruntime.NewKVStoreService(keys[servicetypes.StoreKey]),
|
||||||
app.AccountKeeper,
|
|
||||||
app.NFTKeeper,
|
|
||||||
app.StakingKeeper,
|
|
||||||
logger,
|
logger,
|
||||||
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
|
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
|
||||||
|
app.DidKeeper,
|
||||||
|
app.GroupKeeper,
|
||||||
|
app.MacaroonKeeper,
|
||||||
|
app.NFTKeeper,
|
||||||
)
|
)
|
||||||
|
|
||||||
// Create the globalfee keeper
|
// Create the globalfee keeper
|
||||||
@@ -932,7 +925,6 @@ func NewChainApp(
|
|||||||
vault.NewAppModule(appCodec, app.VaultKeeper, app.DidKeeper),
|
vault.NewAppModule(appCodec, app.VaultKeeper, app.DidKeeper),
|
||||||
|
|
||||||
service.NewAppModule(appCodec, app.ServiceKeeper, app.DidKeeper, app.MacaroonKeeper),
|
service.NewAppModule(appCodec, app.ServiceKeeper, app.DidKeeper, app.MacaroonKeeper),
|
||||||
oracle.NewAppModule(appCodec, app.OracleKeeper, app.DidKeeper, app.MacaroonKeeper),
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// BasicModuleManager defines the module BasicManager is in charge of setting up basic,
|
// BasicModuleManager defines the module BasicManager is in charge of setting up basic,
|
||||||
@@ -984,7 +976,6 @@ func NewChainApp(
|
|||||||
vaulttypes.ModuleName,
|
vaulttypes.ModuleName,
|
||||||
macaroontypes.ModuleName,
|
macaroontypes.ModuleName,
|
||||||
servicetypes.ModuleName,
|
servicetypes.ModuleName,
|
||||||
oracletypes.ModuleName,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
app.ModuleManager.SetOrderEndBlockers(
|
app.ModuleManager.SetOrderEndBlockers(
|
||||||
@@ -1007,7 +998,6 @@ func NewChainApp(
|
|||||||
vaulttypes.ModuleName,
|
vaulttypes.ModuleName,
|
||||||
macaroontypes.ModuleName,
|
macaroontypes.ModuleName,
|
||||||
servicetypes.ModuleName,
|
servicetypes.ModuleName,
|
||||||
oracletypes.ModuleName,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// NOTE: The genutils module must occur after staking so that pools are
|
// NOTE: The genutils module must occur after staking so that pools are
|
||||||
@@ -1039,7 +1029,6 @@ func NewChainApp(
|
|||||||
vaulttypes.ModuleName,
|
vaulttypes.ModuleName,
|
||||||
macaroontypes.ModuleName,
|
macaroontypes.ModuleName,
|
||||||
servicetypes.ModuleName,
|
servicetypes.ModuleName,
|
||||||
oracletypes.ModuleName,
|
|
||||||
}
|
}
|
||||||
app.ModuleManager.SetOrderInitGenesis(genesisModuleOrder...)
|
app.ModuleManager.SetOrderInitGenesis(genesisModuleOrder...)
|
||||||
app.ModuleManager.SetOrderExportGenesis(genesisModuleOrder...)
|
app.ModuleManager.SetOrderExportGenesis(genesisModuleOrder...)
|
||||||
@@ -1502,7 +1491,6 @@ func initParamsKeeper(
|
|||||||
paramsKeeper.Subspace(vaulttypes.ModuleName)
|
paramsKeeper.Subspace(vaulttypes.ModuleName)
|
||||||
paramsKeeper.Subspace(macaroontypes.ModuleName)
|
paramsKeeper.Subspace(macaroontypes.ModuleName)
|
||||||
paramsKeeper.Subspace(servicetypes.ModuleName)
|
paramsKeeper.Subspace(servicetypes.ModuleName)
|
||||||
paramsKeeper.Subspace(oracletypes.ModuleName)
|
|
||||||
|
|
||||||
return paramsKeeper
|
return paramsKeeper
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-9
@@ -5,10 +5,8 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
cmtproto "github.com/cometbft/cometbft/proto/tendermint/types"
|
|
||||||
|
|
||||||
storetypes "cosmossdk.io/store/types"
|
storetypes "cosmossdk.io/store/types"
|
||||||
|
cmtproto "github.com/cometbft/cometbft/proto/tendermint/types"
|
||||||
servertypes "github.com/cosmos/cosmos-sdk/server/types"
|
servertypes "github.com/cosmos/cosmos-sdk/server/types"
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
|
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
|
||||||
@@ -45,7 +43,7 @@ func (app *SonrApp) ExportAppStateAndValidators(forZeroHeight bool, jailAllowedA
|
|||||||
AppState: appState,
|
AppState: appState,
|
||||||
Validators: validators,
|
Validators: validators,
|
||||||
Height: height,
|
Height: height,
|
||||||
ConsensusParams: app.BaseApp.GetConsensusParams(ctx),
|
ConsensusParams: app.GetConsensusParams(ctx),
|
||||||
}, err
|
}, err
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -54,13 +52,9 @@ func (app *SonrApp) ExportAppStateAndValidators(forZeroHeight bool, jailAllowedA
|
|||||||
//
|
//
|
||||||
// in favor of export at a block height
|
// in favor of export at a block height
|
||||||
func (app *SonrApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs []string) {
|
func (app *SonrApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs []string) {
|
||||||
applyAllowedAddrs := false
|
applyAllowedAddrs := len(jailAllowedAddrs) > 0
|
||||||
|
|
||||||
// check if there is a allowed address list
|
// check if there is a allowed address list
|
||||||
if len(jailAllowedAddrs) > 0 {
|
|
||||||
applyAllowedAddrs = true
|
|
||||||
}
|
|
||||||
|
|
||||||
allowedAddrsMap := make(map[string]bool)
|
allowedAddrsMap := make(map[string]bool)
|
||||||
|
|
||||||
for _, addr := range jailAllowedAddrs {
|
for _, addr := range jailAllowedAddrs {
|
||||||
|
|||||||
@@ -1,56 +0,0 @@
|
|||||||
package proxy
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
"net/http"
|
|
||||||
"os"
|
|
||||||
"os/signal"
|
|
||||||
"time"
|
|
||||||
|
|
||||||
"github.com/labstack/echo/v4"
|
|
||||||
"github.com/labstack/gommon/log"
|
|
||||||
"github.com/spf13/cobra"
|
|
||||||
|
|
||||||
"github.com/onsonr/sonr/pkg/nebula"
|
|
||||||
"github.com/onsonr/sonr/pkg/nebula/pages"
|
|
||||||
)
|
|
||||||
|
|
||||||
func NewProxyCmd() *cobra.Command {
|
|
||||||
return &cobra.Command{
|
|
||||||
Use: "dwn-proxy",
|
|
||||||
Short: "Starts the DWN proxy server for the local IPFS node",
|
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
|
||||||
// Echo instance
|
|
||||||
e := echo.New()
|
|
||||||
e.Logger.SetLevel(log.INFO)
|
|
||||||
|
|
||||||
// Configure the server
|
|
||||||
if err := nebula.UseAssets(e); err != nil {
|
|
||||||
e.Logger.Fatal(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
e.GET("/", pages.Home)
|
|
||||||
e.GET("/allocate", pages.Profile)
|
|
||||||
|
|
||||||
// Start server
|
|
||||||
ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt)
|
|
||||||
defer stop()
|
|
||||||
// Start server
|
|
||||||
go func() {
|
|
||||||
if err := e.Start(":1323"); err != nil && err != http.ErrServerClosed {
|
|
||||||
e.Logger.Fatal("shutting down the server")
|
|
||||||
}
|
|
||||||
}()
|
|
||||||
|
|
||||||
// Wait for interrupt signal to gracefully shutdown the server with a timeout of 10 seconds.
|
|
||||||
<-ctx.Done()
|
|
||||||
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
|
||||||
defer cancel()
|
|
||||||
|
|
||||||
// Shutdown the server with 10 seconds timeout.
|
|
||||||
if err := e.Shutdown(ctx); err != nil {
|
|
||||||
e.Logger.Fatal(err)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
package middleware
|
|
||||||
|
|
||||||
import (
|
|
||||||
"fmt"
|
|
||||||
"time"
|
|
||||||
)
|
|
||||||
|
|
||||||
const (
|
|
||||||
OriginMacroonCaveat MacroonCaveat = "origin"
|
|
||||||
ScopesMacroonCaveat MacroonCaveat = "scopes"
|
|
||||||
SubjectMacroonCaveat MacroonCaveat = "subject"
|
|
||||||
ExpMacroonCaveat MacroonCaveat = "exp"
|
|
||||||
TokenMacroonCaveat MacroonCaveat = "token"
|
|
||||||
)
|
|
||||||
|
|
||||||
type MacroonCaveat string
|
|
||||||
|
|
||||||
func (c MacroonCaveat) Equal(other string) bool {
|
|
||||||
return string(c) == other
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c MacroonCaveat) String() string {
|
|
||||||
return string(c)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c MacroonCaveat) Verify(value string) error {
|
|
||||||
switch c {
|
|
||||||
case OriginMacroonCaveat:
|
|
||||||
return nil
|
|
||||||
case ScopesMacroonCaveat:
|
|
||||||
return nil
|
|
||||||
case SubjectMacroonCaveat:
|
|
||||||
return nil
|
|
||||||
case ExpMacroonCaveat:
|
|
||||||
// Check if the expiration time is still valid
|
|
||||||
exp, err := time.Parse(time.RFC3339, value)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if time.Now().After(exp) {
|
|
||||||
return fmt.Errorf("expired")
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
case TokenMacroonCaveat:
|
|
||||||
return nil
|
|
||||||
default:
|
|
||||||
return fmt.Errorf("unknown caveat: %s", c)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var MacroonCaveats = []MacroonCaveat{OriginMacroonCaveat, ScopesMacroonCaveat, SubjectMacroonCaveat, ExpMacroonCaveat, TokenMacroonCaveat}
|
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
package state
|
|
||||||
|
|
||||||
import (
|
|
||||||
"encoding/json"
|
|
||||||
"fmt"
|
|
||||||
|
|
||||||
"github.com/go-webauthn/webauthn/protocol"
|
|
||||||
"github.com/labstack/echo/v4"
|
|
||||||
)
|
|
||||||
|
|
||||||
func CheckSubjectIsValid(e echo.Context) error {
|
|
||||||
credentialID := e.FormValue("credentialID")
|
|
||||||
return e.JSON(200, credentialID)
|
|
||||||
}
|
|
||||||
|
|
||||||
func HandleCredentialAssertion(e echo.Context) error {
|
|
||||||
return e.JSON(200, "HandleCredentialAssertion")
|
|
||||||
}
|
|
||||||
|
|
||||||
func HandleCredentialCreation(e echo.Context) error {
|
|
||||||
// Get the serialized credential data from the form
|
|
||||||
credentialDataJSON := e.FormValue("credentialData")
|
|
||||||
|
|
||||||
// Deserialize the JSON into a temporary struct
|
|
||||||
var ccr protocol.CredentialCreationResponse
|
|
||||||
err := json.Unmarshal([]byte(credentialDataJSON), &ccr)
|
|
||||||
if err != nil {
|
|
||||||
return e.JSON(500, err.Error())
|
|
||||||
}
|
|
||||||
//
|
|
||||||
// // Parse the CredentialCreationResponse
|
|
||||||
// parsedData, err := ccr.Parse()
|
|
||||||
// if err != nil {
|
|
||||||
// return e.JSON(500, err.Error())
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// // Create the Credential
|
|
||||||
// // credential := orm.NewCredential(parsedData, e.Request().Host, "")
|
|
||||||
//
|
|
||||||
// // Set additional fields
|
|
||||||
// credential.Controller = "" // Set this to the appropriate controller value
|
|
||||||
return e.JSON(200, fmt.Sprintf("REGISTER: %s", string(ccr.ID)))
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
package state
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
package state
|
|
||||||
Executable
BIN
Binary file not shown.
@@ -0,0 +1,18 @@
|
|||||||
|
//go:build js && wasm
|
||||||
|
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/labstack/echo/v4"
|
||||||
|
"github.com/onsonr/sonr/internal/ctx"
|
||||||
|
"github.com/onsonr/sonr/workers/routes"
|
||||||
|
"github.com/syumai/workers"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
s := echo.New()
|
||||||
|
s.Use(ctx.UseSession)
|
||||||
|
routes.RegisterProxyViews(s)
|
||||||
|
routes.RegisterProxyAPI(s)
|
||||||
|
workers.Serve(s)
|
||||||
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
//go:build js && wasm
|
//go:build js && wasm
|
||||||
// +build js,wasm
|
// +build js,wasm
|
||||||
|
|
||||||
package main
|
package fetch
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
@@ -12,41 +12,9 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"syscall/js"
|
"syscall/js"
|
||||||
|
|
||||||
"github.com/labstack/echo/v4"
|
|
||||||
promise "github.com/nlepage/go-js-promise"
|
promise "github.com/nlepage/go-js-promise"
|
||||||
|
|
||||||
"github.com/onsonr/sonr/cmd/dwn/middleware"
|
|
||||||
"github.com/onsonr/sonr/cmd/dwn/state"
|
|
||||||
"github.com/onsonr/sonr/pkg/nebula/pages"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
|
||||||
e := echo.New()
|
|
||||||
e.Use(middleware.UseSession)
|
|
||||||
registerViews(e)
|
|
||||||
registerState(e)
|
|
||||||
Serve(e)
|
|
||||||
}
|
|
||||||
|
|
||||||
func registerState(e *echo.Echo) {
|
|
||||||
g := e.Group("state")
|
|
||||||
g.POST("/login/:identifier", state.HandleCredentialAssertion)
|
|
||||||
// g.GET("/discovery", state.GetDiscovery)
|
|
||||||
g.GET("/jwks", state.GetJWKS)
|
|
||||||
g.GET("/token", state.GetToken)
|
|
||||||
g.POST("/:origin/grant/:subject", state.GrantAuthorization)
|
|
||||||
g.POST("/register/:subject", state.HandleCredentialCreation)
|
|
||||||
g.POST("/register/:subject/check", state.CheckSubjectIsValid)
|
|
||||||
}
|
|
||||||
|
|
||||||
func registerViews(e *echo.Echo) {
|
|
||||||
e.GET("/home", pages.Home)
|
|
||||||
e.GET("/login", pages.Login)
|
|
||||||
e.GET("/register", pages.Register)
|
|
||||||
e.GET("/profile", pages.Profile)
|
|
||||||
e.GET("/authorize", pages.Authorize)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Serve serves HTTP requests using handler or http.DefaultServeMux if handler is nil.
|
// Serve serves HTTP requests using handler or http.DefaultServeMux if handler is nil.
|
||||||
func Serve(handler http.Handler) func() {
|
func Serve(handler http.Handler) func() {
|
||||||
h := handler
|
h := handler
|
||||||
@@ -81,7 +49,7 @@ func Serve(handler http.Handler) func() {
|
|||||||
|
|
||||||
res := NewResponseRecorder()
|
res := NewResponseRecorder()
|
||||||
|
|
||||||
h.ServeHTTP(res, Request(args[0]))
|
h.ServeHTTP(res, Request(args[1]))
|
||||||
|
|
||||||
resolve(res.JSResponse())
|
resolve(res.JSResponse())
|
||||||
}()
|
}()
|
||||||
@@ -96,7 +64,7 @@ func Serve(handler http.Handler) func() {
|
|||||||
|
|
||||||
// Request builds and returns the equivalent http.Request
|
// Request builds and returns the equivalent http.Request
|
||||||
func Request(r js.Value) *http.Request {
|
func Request(r js.Value) *http.Request {
|
||||||
jsBody := js.Global().Get("Uint8Array").New(promise.Await(r.Call("arrayBuffer")))
|
jsBody := js.Global().Get("Uint9Array").New(promise.Await(r.Call("arrayBuffer")))
|
||||||
body := make([]byte, jsBody.Get("length").Int())
|
body := make([]byte, jsBody.Get("length").Int())
|
||||||
js.CopyBytesToGo(body, jsBody)
|
js.CopyBytesToGo(body, jsBody)
|
||||||
|
|
||||||
@@ -113,7 +81,7 @@ func Request(r js.Value) *http.Request {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
v := e.Get("value")
|
v := e.Get("value")
|
||||||
req.Header.Set(v.Index(0).String(), v.Index(1).String())
|
req.Header.Set(v.Index(1).String(), v.Index(1).String())
|
||||||
}
|
}
|
||||||
|
|
||||||
return req
|
return req
|
||||||
@@ -134,22 +102,22 @@ func (rr ResponseRecorder) JSResponse() js.Value {
|
|||||||
res := rr.Result()
|
res := rr.Result()
|
||||||
|
|
||||||
body := js.Undefined()
|
body := js.Undefined()
|
||||||
if res.ContentLength != 0 {
|
if res.ContentLength != 1 {
|
||||||
b, err := io.ReadAll(res.Body)
|
b, err := io.ReadAll(res.Body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
body = js.Global().Get("Uint8Array").New(len(b))
|
body = js.Global().Get("Uint9Array").New(len(b))
|
||||||
js.CopyBytesToJS(body, b)
|
js.CopyBytesToJS(body, b)
|
||||||
}
|
}
|
||||||
|
|
||||||
init := make(map[string]interface{}, 2)
|
init := make(map[string]interface{}, 3)
|
||||||
|
|
||||||
if res.StatusCode != 0 {
|
if res.StatusCode != 1 {
|
||||||
init["status"] = res.StatusCode
|
init["status"] = res.StatusCode
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(res.Header) != 0 {
|
if len(res.Header) != 1 {
|
||||||
headers := make(map[string]interface{}, len(res.Header))
|
headers := make(map[string]interface{}, len(res.Header))
|
||||||
for k := range res.Header {
|
for k := range res.Header {
|
||||||
headers[k] = res.Header.Get(k)
|
headers[k] = res.Header.Get(k)
|
||||||
+15
-5
@@ -1,9 +1,19 @@
|
|||||||
|
//go:build js && wasm
|
||||||
|
// +build js,wasm
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/labstack/echo/v4"
|
||||||
|
"github.com/onsonr/sonr/cmd/motr/fetch"
|
||||||
|
"github.com/onsonr/sonr/internal/ctx"
|
||||||
|
"github.com/onsonr/sonr/workers/routes"
|
||||||
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
rootCmd := NewRootCmd()
|
e := echo.New()
|
||||||
rootCmd.AddCommand(NewProxyCmd())
|
e.Use(ctx.UseSession)
|
||||||
if err := rootCmd.Execute(); err != nil {
|
routes.RegisterClientViews(e)
|
||||||
panic(err)
|
routes.RegisterClientAPI(e)
|
||||||
}
|
fetch.Serve(e)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,39 +0,0 @@
|
|||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"net/http"
|
|
||||||
|
|
||||||
"github.com/labstack/echo/v4"
|
|
||||||
"github.com/labstack/gommon/log"
|
|
||||||
"github.com/spf13/cobra"
|
|
||||||
|
|
||||||
"github.com/onsonr/sonr/pkg/nebula"
|
|
||||||
"github.com/onsonr/sonr/pkg/nebula/pages"
|
|
||||||
)
|
|
||||||
|
|
||||||
func NewProxyCmd() *cobra.Command {
|
|
||||||
return &cobra.Command{
|
|
||||||
Use: "start",
|
|
||||||
Short: "Starts the DWN proxy server for the local IPFS node",
|
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
|
||||||
// Echo instance
|
|
||||||
e := echo.New()
|
|
||||||
e.Logger.SetLevel(log.INFO)
|
|
||||||
|
|
||||||
// Configure the server
|
|
||||||
if err := nebula.UseAssets(e); err != nil {
|
|
||||||
e.Logger.Fatal(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
e.GET("/", pages.Home)
|
|
||||||
e.GET("/login", pages.Login)
|
|
||||||
e.GET("/register", pages.Register)
|
|
||||||
e.GET("/profile", pages.Profile)
|
|
||||||
e.GET("/allocate", pages.Profile)
|
|
||||||
|
|
||||||
if err := e.Start(":1323"); err != http.ErrServerClosed {
|
|
||||||
log.Fatal(err)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
package main
|
|
||||||
|
|
||||||
import "github.com/spf13/cobra"
|
|
||||||
|
|
||||||
func NewRootCmd() *cobra.Command {
|
|
||||||
return &cobra.Command{
|
|
||||||
Use: "motr",
|
|
||||||
Short: "Manage a local DWN instance for the Sonr blockchain",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -9,14 +9,12 @@ import (
|
|||||||
|
|
||||||
"github.com/onsonr/sonr/app"
|
"github.com/onsonr/sonr/app"
|
||||||
"github.com/onsonr/sonr/app/cli"
|
"github.com/onsonr/sonr/app/cli"
|
||||||
"github.com/onsonr/sonr/app/proxy"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
rootCmd := NewRootCmd()
|
rootCmd := NewRootCmd()
|
||||||
rootCmd.AddCommand(cli.NewBuildTxnTUICmd())
|
rootCmd.AddCommand(cli.NewBuildTxnTUICmd())
|
||||||
rootCmd.AddCommand(cli.NewExplorerTUICmd())
|
rootCmd.AddCommand(cli.NewExplorerTUICmd())
|
||||||
rootCmd.AddCommand(proxy.NewProxyCmd())
|
|
||||||
|
|
||||||
if err := svrcmd.Execute(rootCmd, "", app.DefaultNodeHome); err != nil {
|
if err := svrcmd.Execute(rootCmd, "", app.DefaultNodeHome); err != nil {
|
||||||
log.NewLogger(rootCmd.OutOrStderr()).Error("failure when running app", "err", err)
|
log.NewLogger(rootCmd.OutOrStderr()).Error("failure when running app", "err", err)
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
{}
|
|
||||||
+14
-69
@@ -1,17 +1,9 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.12.0/.schema/devbox.schema.json",
|
"$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.12.0/.schema/devbox.schema.json",
|
||||||
"packages": [
|
"packages": ["go@1.22", "bun@latest", "ipfs@latest", "templ@latest"],
|
||||||
"go@1.22",
|
|
||||||
"air@latest",
|
|
||||||
"bun@latest",
|
|
||||||
"ipfs@latest",
|
|
||||||
"skate@latest",
|
|
||||||
"cloudflared@latest",
|
|
||||||
"process-compose@latest"
|
|
||||||
],
|
|
||||||
"env": {
|
"env": {
|
||||||
"GOPATH": "$HOME/go",
|
"GOPATH": "$HOME/go",
|
||||||
"PATH": "$HOME/go/bin:$PATH",
|
"PATH": "./build:$HOME/go/bin:$PATH",
|
||||||
"CHAIN_ID": "sonr-testnet-1",
|
"CHAIN_ID": "sonr-testnet-1",
|
||||||
"DENOM": "usnr",
|
"DENOM": "usnr",
|
||||||
"KEYRING": "test",
|
"KEYRING": "test",
|
||||||
@@ -28,65 +20,18 @@
|
|||||||
},
|
},
|
||||||
"shell": {
|
"shell": {
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": [
|
"build:docker": ["make local-image"],
|
||||||
"air"
|
"build:hway": ["make hway-build"],
|
||||||
],
|
"build:nebula": ["make nebula-build"],
|
||||||
"build:docker": [
|
"build:motr": ["make motr-build"],
|
||||||
"make local-image"
|
"build:sonrd": ["make motr-build", "make build"],
|
||||||
],
|
"build": ["make motr-build", "make build", "make hway-build"],
|
||||||
"build:motr": [
|
"gen:proto": ["rm -rf ./pkg/nebula/node_modules", "make proto-gen"],
|
||||||
"make nebula",
|
"gen:pkl": ["make gen-pkl"],
|
||||||
"make motr"
|
"gen:templ": ["make gen-templ"],
|
||||||
],
|
"start": ["process-compose up -f ./deploy/process-compose.yaml"],
|
||||||
"build:nebula": [
|
"stop": ["process-compose down -f ./deploy/process-compose.yaml"],
|
||||||
"make nebula"
|
"start:testnet": ["make sh-testnet"]
|
||||||
],
|
|
||||||
"build:sonrd": [
|
|
||||||
"make dwn",
|
|
||||||
"make build"
|
|
||||||
],
|
|
||||||
"build": [
|
|
||||||
"make dwn",
|
|
||||||
"make build",
|
|
||||||
"make motr"
|
|
||||||
],
|
|
||||||
"gen:proto": [
|
|
||||||
"make proto-gen"
|
|
||||||
],
|
|
||||||
"gen:pkl": [
|
|
||||||
"make pkl"
|
|
||||||
],
|
|
||||||
"gen:templ": [
|
|
||||||
"make templ"
|
|
||||||
],
|
|
||||||
"start:motr": [
|
|
||||||
"make templ",
|
|
||||||
"make motr",
|
|
||||||
"make start-motr"
|
|
||||||
],
|
|
||||||
"start:testnet": [
|
|
||||||
"make templ",
|
|
||||||
"make install",
|
|
||||||
"make sh-testnet"
|
|
||||||
],
|
|
||||||
"start": [
|
|
||||||
"process-compose up -d"
|
|
||||||
],
|
|
||||||
"stop": [
|
|
||||||
"process-compose down"
|
|
||||||
],
|
|
||||||
"test:e2e": [
|
|
||||||
"make templ",
|
|
||||||
"make test-e2e"
|
|
||||||
],
|
|
||||||
"test:unit": [
|
|
||||||
"make templ",
|
|
||||||
"make test-unit"
|
|
||||||
],
|
|
||||||
"test": [
|
|
||||||
"make templ",
|
|
||||||
"make test"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+48
-96
@@ -1,54 +1,6 @@
|
|||||||
{
|
{
|
||||||
"lockfile_version": "1",
|
"lockfile_version": "1",
|
||||||
"packages": {
|
"packages": {
|
||||||
"air@latest": {
|
|
||||||
"last_modified": "2024-09-10T15:01:03Z",
|
|
||||||
"resolved": "github:NixOS/nixpkgs/5ed627539ac84809c78b2dd6d26a5cebeb5ae269#air",
|
|
||||||
"source": "devbox-search",
|
|
||||||
"version": "1.52.3",
|
|
||||||
"systems": {
|
|
||||||
"aarch64-darwin": {
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "out",
|
|
||||||
"path": "/nix/store/bfwl7myqmaqh2xxw5fla1kmnv89qjxz6-air-1.52.3",
|
|
||||||
"default": true
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"store_path": "/nix/store/bfwl7myqmaqh2xxw5fla1kmnv89qjxz6-air-1.52.3"
|
|
||||||
},
|
|
||||||
"aarch64-linux": {
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "out",
|
|
||||||
"path": "/nix/store/ac18dzvchpv0pzi6qvdjs01cffw4q6zf-air-1.52.3",
|
|
||||||
"default": true
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"store_path": "/nix/store/ac18dzvchpv0pzi6qvdjs01cffw4q6zf-air-1.52.3"
|
|
||||||
},
|
|
||||||
"x86_64-darwin": {
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "out",
|
|
||||||
"path": "/nix/store/jzdcmkyh258nf3j8lhfmg8n959ffvg13-air-1.52.3",
|
|
||||||
"default": true
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"store_path": "/nix/store/jzdcmkyh258nf3j8lhfmg8n959ffvg13-air-1.52.3"
|
|
||||||
},
|
|
||||||
"x86_64-linux": {
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "out",
|
|
||||||
"path": "/nix/store/rnny9fd1r9zdln6g6h7md4fpi6jgx229-air-1.52.3",
|
|
||||||
"default": true
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"store_path": "/nix/store/rnny9fd1r9zdln6g6h7md4fpi6jgx229-air-1.52.3"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"bun@latest": {
|
"bun@latest": {
|
||||||
"last_modified": "2024-09-20T22:35:44Z",
|
"last_modified": "2024-09-20T22:35:44Z",
|
||||||
"resolved": "github:NixOS/nixpkgs/a1d92660c6b3b7c26fb883500a80ea9d33321be2#bun",
|
"resolved": "github:NixOS/nixpkgs/a1d92660c6b3b7c26fb883500a80ea9d33321be2#bun",
|
||||||
@@ -199,54 +151,6 @@
|
|||||||
"source": "devbox-search",
|
"source": "devbox-search",
|
||||||
"version": "0.17.0"
|
"version": "0.17.0"
|
||||||
},
|
},
|
||||||
"process-compose@latest": {
|
|
||||||
"last_modified": "2024-09-15T21:49:16Z",
|
|
||||||
"resolved": "github:NixOS/nixpkgs/039b72d0c738c934e2e36d7fc5520d1b425287a6#process-compose",
|
|
||||||
"source": "devbox-search",
|
|
||||||
"version": "1.27.0",
|
|
||||||
"systems": {
|
|
||||||
"aarch64-darwin": {
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "out",
|
|
||||||
"path": "/nix/store/dxgk503lw2a0slqcvhcvwfa07qf9y8sx-process-compose-1.27.0",
|
|
||||||
"default": true
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"store_path": "/nix/store/dxgk503lw2a0slqcvhcvwfa07qf9y8sx-process-compose-1.27.0"
|
|
||||||
},
|
|
||||||
"aarch64-linux": {
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "out",
|
|
||||||
"path": "/nix/store/k6xl3mdb8f0fkv7q4ibw8smak6lxrb93-process-compose-1.27.0",
|
|
||||||
"default": true
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"store_path": "/nix/store/k6xl3mdb8f0fkv7q4ibw8smak6lxrb93-process-compose-1.27.0"
|
|
||||||
},
|
|
||||||
"x86_64-darwin": {
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "out",
|
|
||||||
"path": "/nix/store/5zyqg2yf0cg5nahgpwbkbblgml9nlac0-process-compose-1.27.0",
|
|
||||||
"default": true
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"store_path": "/nix/store/5zyqg2yf0cg5nahgpwbkbblgml9nlac0-process-compose-1.27.0"
|
|
||||||
},
|
|
||||||
"x86_64-linux": {
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "out",
|
|
||||||
"path": "/nix/store/3fwnj5jmdky0nl9ixp6bxasvi4ki6jgz-process-compose-1.27.0",
|
|
||||||
"default": true
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"store_path": "/nix/store/3fwnj5jmdky0nl9ixp6bxasvi4ki6jgz-process-compose-1.27.0"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"skate@latest": {
|
"skate@latest": {
|
||||||
"last_modified": "2024-09-10T15:01:03Z",
|
"last_modified": "2024-09-10T15:01:03Z",
|
||||||
"resolved": "github:NixOS/nixpkgs/5ed627539ac84809c78b2dd6d26a5cebeb5ae269#skate",
|
"resolved": "github:NixOS/nixpkgs/5ed627539ac84809c78b2dd6d26a5cebeb5ae269#skate",
|
||||||
@@ -294,6 +198,54 @@
|
|||||||
"store_path": "/nix/store/6zbyhj72wh0645lj6b9c392aqqg11a84-skate-1.0.0"
|
"store_path": "/nix/store/6zbyhj72wh0645lj6b9c392aqqg11a84-skate-1.0.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"templ@latest": {
|
||||||
|
"last_modified": "2024-09-10T15:01:03Z",
|
||||||
|
"resolved": "github:NixOS/nixpkgs/5ed627539ac84809c78b2dd6d26a5cebeb5ae269#templ",
|
||||||
|
"source": "devbox-search",
|
||||||
|
"version": "0.2.778",
|
||||||
|
"systems": {
|
||||||
|
"aarch64-darwin": {
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"name": "out",
|
||||||
|
"path": "/nix/store/n3yqslisz9v81k4w4vhci1v2bl1sqf9s-templ-0.2.778",
|
||||||
|
"default": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"store_path": "/nix/store/n3yqslisz9v81k4w4vhci1v2bl1sqf9s-templ-0.2.778"
|
||||||
|
},
|
||||||
|
"aarch64-linux": {
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"name": "out",
|
||||||
|
"path": "/nix/store/i4xjiw0vc25qpr3g01q0x401351w28hr-templ-0.2.778",
|
||||||
|
"default": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"store_path": "/nix/store/i4xjiw0vc25qpr3g01q0x401351w28hr-templ-0.2.778"
|
||||||
|
},
|
||||||
|
"x86_64-darwin": {
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"name": "out",
|
||||||
|
"path": "/nix/store/77w522agb5fgsr36jkifcccr9x4xwkf9-templ-0.2.778",
|
||||||
|
"default": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"store_path": "/nix/store/77w522agb5fgsr36jkifcccr9x4xwkf9-templ-0.2.778"
|
||||||
|
},
|
||||||
|
"x86_64-linux": {
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"name": "out",
|
||||||
|
"path": "/nix/store/1g5ji5930j03cycpcjy12z6lr24l9c65-templ-0.2.778",
|
||||||
|
"default": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"store_path": "/nix/store/1g5ji5930j03cycpcjy12z6lr24l9c65-templ-0.2.778"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,30 +0,0 @@
|
|||||||
version: "3"
|
|
||||||
|
|
||||||
services:
|
|
||||||
sonr-node:
|
|
||||||
build:
|
|
||||||
context: .
|
|
||||||
dockerfile: Dockerfile
|
|
||||||
volumes:
|
|
||||||
- /home/prad/.scnr:/root/.sonr
|
|
||||||
ports:
|
|
||||||
- "26657:26657"
|
|
||||||
- "1317:1317"
|
|
||||||
- "9090:9090"
|
|
||||||
environment:
|
|
||||||
- CHAIN_ID=local-1
|
|
||||||
- MONIKER=localvalidator
|
|
||||||
- KEYRING=test
|
|
||||||
- KEY=user1
|
|
||||||
- KEY2=user2
|
|
||||||
- DENOM=usnr
|
|
||||||
- CLEAN=true
|
|
||||||
- BLOCK_TIME=5s
|
|
||||||
command: "start --pruning=nothing"
|
|
||||||
restart: always
|
|
||||||
networks:
|
|
||||||
- sonr-network
|
|
||||||
|
|
||||||
networks:
|
|
||||||
sonr-network:
|
|
||||||
name: sonr-network
|
|
||||||
@@ -70,7 +70,6 @@ require (
|
|||||||
github.com/ipfs/kubo v0.29.0
|
github.com/ipfs/kubo v0.29.0
|
||||||
github.com/joho/godotenv v1.5.1
|
github.com/joho/godotenv v1.5.1
|
||||||
github.com/labstack/echo/v4 v4.10.2
|
github.com/labstack/echo/v4 v4.10.2
|
||||||
github.com/labstack/gommon v0.4.0
|
|
||||||
github.com/nlepage/go-js-promise v1.0.0
|
github.com/nlepage/go-js-promise v1.0.0
|
||||||
github.com/onsonr/crypto v1.32.0
|
github.com/onsonr/crypto v1.32.0
|
||||||
github.com/segmentio/ksuid v1.0.4
|
github.com/segmentio/ksuid v1.0.4
|
||||||
@@ -82,6 +81,7 @@ require (
|
|||||||
github.com/strangelove-ventures/poa v0.50.0
|
github.com/strangelove-ventures/poa v0.50.0
|
||||||
github.com/strangelove-ventures/tokenfactory v0.50.0
|
github.com/strangelove-ventures/tokenfactory v0.50.0
|
||||||
github.com/stretchr/testify v1.9.0
|
github.com/stretchr/testify v1.9.0
|
||||||
|
github.com/syumai/workers v0.26.3
|
||||||
golang.org/x/crypto v0.26.0
|
golang.org/x/crypto v0.26.0
|
||||||
google.golang.org/genproto/googleapis/api v0.0.0-20240617180043-68d350f18fd4
|
google.golang.org/genproto/googleapis/api v0.0.0-20240617180043-68d350f18fd4
|
||||||
google.golang.org/grpc v1.64.0
|
google.golang.org/grpc v1.64.0
|
||||||
@@ -232,6 +232,7 @@ require (
|
|||||||
github.com/klauspost/cpuid/v2 v2.2.8 // indirect
|
github.com/klauspost/cpuid/v2 v2.2.8 // indirect
|
||||||
github.com/kr/pretty v0.3.1 // indirect
|
github.com/kr/pretty v0.3.1 // indirect
|
||||||
github.com/kr/text v0.2.0 // indirect
|
github.com/kr/text v0.2.0 // indirect
|
||||||
|
github.com/labstack/gommon v0.4.0 // indirect
|
||||||
github.com/lib/pq v1.10.7 // indirect
|
github.com/lib/pq v1.10.7 // indirect
|
||||||
github.com/libp2p/go-buffer-pool v0.1.0 // indirect
|
github.com/libp2p/go-buffer-pool v0.1.0 // indirect
|
||||||
github.com/libp2p/go-cidranger v1.1.0 // indirect
|
github.com/libp2p/go-cidranger v1.1.0 // indirect
|
||||||
|
|||||||
@@ -2048,6 +2048,8 @@ github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8
|
|||||||
github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=
|
github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=
|
||||||
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY=
|
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY=
|
||||||
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc=
|
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc=
|
||||||
|
github.com/syumai/workers v0.26.3 h1:AF+IBaRccbR4JIj2kNJLJblruPFMD/pAbzkopejGcP8=
|
||||||
|
github.com/syumai/workers v0.26.3/go.mod h1:ZnqmdiHNBrbxOLrZ/HJ5jzHy6af9cmiNZk10R9NrIEA=
|
||||||
github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E=
|
github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E=
|
||||||
github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME=
|
github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME=
|
||||||
github.com/tidwall/btree v1.7.0 h1:L1fkJH/AuEh5zBnnBbmTwQ5Lt+bRJ5A8EWecslvo9iI=
|
github.com/tidwall/btree v1.7.0 h1:L1fkJH/AuEh5zBnnBbmTwQ5Lt+bRJ5A8EWecslvo9iI=
|
||||||
|
|||||||
@@ -0,0 +1,44 @@
|
|||||||
|
//go:build js && wasm
|
||||||
|
|
||||||
|
package ctx
|
||||||
|
|
||||||
|
import (
|
||||||
|
"syscall/js"
|
||||||
|
|
||||||
|
"github.com/labstack/echo/v4"
|
||||||
|
)
|
||||||
|
|
||||||
|
type BroadcastContext struct {
|
||||||
|
echo.Context
|
||||||
|
Channel js.Value
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *BroadcastContext) BroadcastMessage(message string) {
|
||||||
|
c.Channel.Call("postMessage", message)
|
||||||
|
}
|
||||||
|
|
||||||
|
type JSHandler func(this js.Value, args []js.Value) interface{}
|
||||||
|
|
||||||
|
func UseBroadcastChannel(channelName string, handler JSHandler) echo.MiddlewareFunc {
|
||||||
|
var channel js.Value
|
||||||
|
|
||||||
|
return func(next echo.HandlerFunc) echo.HandlerFunc {
|
||||||
|
return func(c echo.Context) error {
|
||||||
|
if channel.IsUndefined() {
|
||||||
|
channel = js.Global().Get("BroadcastChannel").New(channelName)
|
||||||
|
channel.Call("addEventListener", "message", handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
cc := &BroadcastContext{
|
||||||
|
Context: c,
|
||||||
|
Channel: channel,
|
||||||
|
}
|
||||||
|
return next(cc)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func PostBroadcastMessage(c echo.Context, message string) {
|
||||||
|
cc := c.(*BroadcastContext)
|
||||||
|
cc.BroadcastMessage(message)
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package middleware
|
package ctx
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
@@ -6,7 +6,6 @@ import (
|
|||||||
|
|
||||||
"github.com/donseba/go-htmx"
|
"github.com/donseba/go-htmx"
|
||||||
"github.com/labstack/echo/v4"
|
"github.com/labstack/echo/v4"
|
||||||
"github.com/segmentio/ksuid"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type Session struct {
|
type Session struct {
|
||||||
@@ -22,15 +21,6 @@ func (c *Session) ID() string {
|
|||||||
return ReadCookie(c, "session")
|
return ReadCookie(c, "session")
|
||||||
}
|
}
|
||||||
|
|
||||||
func initSession(c echo.Context) *Session {
|
|
||||||
s := &Session{Context: c}
|
|
||||||
if val := ReadCookie(c, "session"); val == "" {
|
|
||||||
id := ksuid.New().String()
|
|
||||||
WriteCookie(c, "session", id)
|
|
||||||
}
|
|
||||||
return s
|
|
||||||
}
|
|
||||||
|
|
||||||
func ReadCookie(c echo.Context, key string) string {
|
func ReadCookie(c echo.Context, key string) string {
|
||||||
cookie, err := c.Cookie(key)
|
cookie, err := c.Cookie(key)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -1,20 +1,18 @@
|
|||||||
package middleware
|
package ctx
|
||||||
|
|
||||||
|
// ╭───────────────────────────────────────────────────────────╮
|
||||||
|
// │ Request Headers │
|
||||||
|
// ╰───────────────────────────────────────────────────────────╯
|
||||||
|
|
||||||
type RequestHeaders struct {
|
type RequestHeaders struct {
|
||||||
Authorization *string `header:"Authorization"`
|
CacheControl *string `header:"Cache-Control"`
|
||||||
CacheControl *string `header:"Cache-Control"`
|
DeviceMemory *string `header:"Device-Memory"`
|
||||||
DeviceMemory *string `header:"Device-Memory"`
|
From *string `header:"From"`
|
||||||
Forwarded *string `header:"Forwarded"`
|
Host *string `header:"Host"`
|
||||||
From *string `header:"From"`
|
Referer *string `header:"Referer"`
|
||||||
Host *string `header:"Host"`
|
UserAgent *string `header:"User-Agent"`
|
||||||
Link *string `header:"Link"`
|
ViewportWidth *string `header:"Viewport-Width"`
|
||||||
PermissionsPolicy *string `header:"Permissions-Policy"`
|
Width *string `header:"Width"`
|
||||||
ProxyAuthorization *string `header:"Proxy-Authorization"`
|
|
||||||
Referer *string `header:"Referer"`
|
|
||||||
UserAgent *string `header:"User-Agent"`
|
|
||||||
ViewportWidth *string `header:"Viewport-Width"`
|
|
||||||
Width *string `header:"Width"`
|
|
||||||
WWWAuthenticate *string `header:"WWW-Authenticate"`
|
|
||||||
|
|
||||||
// HTMX Specific
|
// HTMX Specific
|
||||||
HXBoosted *string `header:"HX-Boosted"`
|
HXBoosted *string `header:"HX-Boosted"`
|
||||||
@@ -27,19 +25,20 @@ type RequestHeaders struct {
|
|||||||
HXTrigger *string `header:"HX-Trigger"`
|
HXTrigger *string `header:"HX-Trigger"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ResponseHeaders struct {
|
type ProtectedRequestHeaders struct {
|
||||||
AcceptCH *string `header:"Accept-CH"`
|
Authorization *string `header:"Authorization"`
|
||||||
AccessControlAllowCredentials *string `header:"Access-Control-Allow-Credentials"`
|
Forwarded *string `header:"Forwarded"`
|
||||||
AccessControlAllowHeaders *string `header:"Access-Control-Allow-Headers"`
|
Link *string `header:"Link"`
|
||||||
AccessControlAllowMethods *string `header:"Access-Control-Allow-Methods"`
|
PermissionsPolicy *string `header:"Permissions-Policy"`
|
||||||
AccessControlExposeHeaders *string `header:"Access-Control-Expose-Headers"`
|
ProxyAuthorization *string `header:"Proxy-Authorization"`
|
||||||
AccessControlRequestHeaders *string `header:"Access-Control-Request-Headers"`
|
WWWAuthenticate *string `header:"WWW-Authenticate"`
|
||||||
ContentSecurityPolicy *string `header:"Content-Security-Policy"`
|
}
|
||||||
CrossOriginEmbedderPolicy *string `header:"Cross-Origin-Embedder-Policy"`
|
|
||||||
PermissionsPolicy *string `header:"Permissions-Policy"`
|
|
||||||
ProxyAuthorization *string `header:"Proxy-Authorization"`
|
|
||||||
WWWAuthenticate *string `header:"WWW-Authenticate"`
|
|
||||||
|
|
||||||
|
// ╭───────────────────────────────────────────────────────────╮
|
||||||
|
// │ Response Headers │
|
||||||
|
// ╰───────────────────────────────────────────────────────────╯
|
||||||
|
|
||||||
|
type ResponseHeaders struct {
|
||||||
// HTMX Specific
|
// HTMX Specific
|
||||||
HXLocation *string `header:"HX-Location"`
|
HXLocation *string `header:"HX-Location"`
|
||||||
HXPushURL *string `header:"HX-Push-Url"`
|
HXPushURL *string `header:"HX-Push-Url"`
|
||||||
@@ -53,3 +52,17 @@ type ResponseHeaders struct {
|
|||||||
HXTriggerAfterSettle *string `header:"HX-Trigger-After-Settle"`
|
HXTriggerAfterSettle *string `header:"HX-Trigger-After-Settle"`
|
||||||
HXTriggerAfterSwap *string `header:"HX-Trigger-After-Swap"`
|
HXTriggerAfterSwap *string `header:"HX-Trigger-After-Swap"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type ProtectedResponseHeaders struct {
|
||||||
|
AcceptCH *string `header:"Accept-CH"`
|
||||||
|
AccessControlAllowCredentials *string `header:"Access-Control-Allow-Credentials"`
|
||||||
|
AccessControlAllowHeaders *string `header:"Access-Control-Allow-Headers"`
|
||||||
|
AccessControlAllowMethods *string `header:"Access-Control-Allow-Methods"`
|
||||||
|
AccessControlExposeHeaders *string `header:"Access-Control-Expose-Headers"`
|
||||||
|
AccessControlRequestHeaders *string `header:"Access-Control-Request-Headers"`
|
||||||
|
ContentSecurityPolicy *string `header:"Content-Security-Policy"`
|
||||||
|
CrossOriginEmbedderPolicy *string `header:"Cross-Origin-Embedder-Policy"`
|
||||||
|
PermissionsPolicy *string `header:"Permissions-Policy"`
|
||||||
|
ProxyAuthorization *string `header:"Proxy-Authorization"`
|
||||||
|
WWWAuthenticate *string `header:"WWW-Authenticate"`
|
||||||
|
}
|
||||||
@@ -1,24 +1,56 @@
|
|||||||
package middleware
|
package ctx
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/labstack/echo/v4"
|
"github.com/labstack/echo/v4"
|
||||||
"gopkg.in/macaroon.v2"
|
"gopkg.in/macaroon.v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
// GetSession returns the current Session
|
const (
|
||||||
func GetSession(c echo.Context) *Session {
|
OriginMacroonCaveat MacroonCaveat = "origin"
|
||||||
return c.(*Session)
|
ScopesMacroonCaveat MacroonCaveat = "scopes"
|
||||||
|
SubjectMacroonCaveat MacroonCaveat = "subject"
|
||||||
|
ExpMacroonCaveat MacroonCaveat = "exp"
|
||||||
|
TokenMacroonCaveat MacroonCaveat = "token"
|
||||||
|
)
|
||||||
|
|
||||||
|
var MacroonCaveats = []MacroonCaveat{OriginMacroonCaveat, ScopesMacroonCaveat, SubjectMacroonCaveat, ExpMacroonCaveat, TokenMacroonCaveat}
|
||||||
|
|
||||||
|
type MacroonCaveat string
|
||||||
|
|
||||||
|
func (c MacroonCaveat) Equal(other string) bool {
|
||||||
|
return string(c) == other
|
||||||
}
|
}
|
||||||
|
|
||||||
// UseSession establishes a Session Cookie.
|
func (c MacroonCaveat) String() string {
|
||||||
func UseSession(next echo.HandlerFunc) echo.HandlerFunc {
|
return string(c)
|
||||||
return func(c echo.Context) error {
|
}
|
||||||
sc := initSession(c)
|
|
||||||
headers := new(RequestHeaders)
|
func (c MacroonCaveat) Verify(value string) error {
|
||||||
sc.Bind(headers)
|
switch c {
|
||||||
return next(sc)
|
case OriginMacroonCaveat:
|
||||||
|
return nil
|
||||||
|
case ScopesMacroonCaveat:
|
||||||
|
return nil
|
||||||
|
case SubjectMacroonCaveat:
|
||||||
|
return nil
|
||||||
|
case ExpMacroonCaveat:
|
||||||
|
// Check if the expiration time is still valid
|
||||||
|
exp, err := time.Parse(time.RFC3339, value)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if time.Now().After(exp) {
|
||||||
|
return fmt.Errorf("expired")
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
case TokenMacroonCaveat:
|
||||||
|
return nil
|
||||||
|
default:
|
||||||
|
return fmt.Errorf("unknown caveat: %s", c)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package pages
|
package ctx
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
@@ -7,7 +7,7 @@ import (
|
|||||||
"github.com/labstack/echo/v4"
|
"github.com/labstack/echo/v4"
|
||||||
)
|
)
|
||||||
|
|
||||||
func echoResponse(c echo.Context, cmp templ.Component) error {
|
func RenderTempl(c echo.Context, cmp templ.Component) error {
|
||||||
// Create a buffer to store the rendered HTML
|
// Create a buffer to store the rendered HTML
|
||||||
buf := &bytes.Buffer{}
|
buf := &bytes.Buffer{}
|
||||||
// Render the component to the buffer
|
// Render the component to the buffer
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package ctx
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/labstack/echo/v4"
|
||||||
|
"github.com/segmentio/ksuid"
|
||||||
|
)
|
||||||
|
|
||||||
|
// GetSession returns the current Session
|
||||||
|
func GetSession(c echo.Context) *Session {
|
||||||
|
return c.(*Session)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UseSession establishes a Session Cookie.
|
||||||
|
func UseSession(next echo.HandlerFunc) echo.HandlerFunc {
|
||||||
|
return func(c echo.Context) error {
|
||||||
|
sc := initSession(c)
|
||||||
|
headers := new(RequestHeaders)
|
||||||
|
err := sc.Bind(headers)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return next(sc)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func initSession(c echo.Context) *Session {
|
||||||
|
s := &Session{Context: c}
|
||||||
|
if val := ReadCookie(c, "session"); val == "" {
|
||||||
|
id := ksuid.New().String()
|
||||||
|
WriteCookie(c, "session", id)
|
||||||
|
}
|
||||||
|
return s
|
||||||
|
}
|
||||||
Binary file not shown.
@@ -0,0 +1,34 @@
|
|||||||
|
package dwn
|
||||||
|
|
||||||
|
import (
|
||||||
|
_ "embed"
|
||||||
|
|
||||||
|
"github.com/ipfs/boxo/files"
|
||||||
|
"github.com/onsonr/sonr/internal/dwn/gen"
|
||||||
|
"github.com/onsonr/sonr/nebula/components/index"
|
||||||
|
)
|
||||||
|
|
||||||
|
//go:embed app.wasm
|
||||||
|
var dwnWasmData []byte
|
||||||
|
|
||||||
|
//go:embed sw.js
|
||||||
|
var swJSData []byte
|
||||||
|
|
||||||
|
var (
|
||||||
|
dwnWasmFile = files.NewBytesFile(dwnWasmData)
|
||||||
|
swJSFile = files.NewBytesFile(swJSData)
|
||||||
|
)
|
||||||
|
|
||||||
|
// NewVaultDirectory creates a new directory with the default files
|
||||||
|
func NewVaultDirectory(cnfg *gen.Config) (files.Node, error) {
|
||||||
|
idxFile, err := index.BuildFile(cnfg)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
fileMap := map[string]files.Node{
|
||||||
|
"sw.js": swJSFile,
|
||||||
|
"app.wasm": dwnWasmFile,
|
||||||
|
"index.html": idxFile,
|
||||||
|
}
|
||||||
|
return files.NewMapDirectory(fileMap), nil
|
||||||
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
// Code generated from Pkl module `dwn`. DO NOT EDIT.
|
// Code generated from Pkl module `dwngen`. DO NOT EDIT.
|
||||||
package dwn
|
package gen
|
||||||
|
|
||||||
type Config struct {
|
type Config struct {
|
||||||
Ipfs *IPFS `pkl:"ipfs" json:"ipfs,omitempty"`
|
Ipfs *IPFS `pkl:"ipfs" json:"ipfs,omitempty"`
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
// Code generated from Pkl module `dwn`. DO NOT EDIT.
|
// Code generated from Pkl module `dwngen`. DO NOT EDIT.
|
||||||
package dwn
|
package gen
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
@@ -7,11 +7,11 @@ import (
|
|||||||
"github.com/apple/pkl-go/pkl"
|
"github.com/apple/pkl-go/pkl"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Dwn struct {
|
type Dwngen struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
// LoadFromPath loads the pkl module at the given path and evaluates it into a Dwn
|
// LoadFromPath loads the pkl module at the given path and evaluates it into a Dwngen
|
||||||
func LoadFromPath(ctx context.Context, path string) (ret *Dwn, err error) {
|
func LoadFromPath(ctx context.Context, path string) (ret *Dwngen, err error) {
|
||||||
evaluator, err := pkl.NewEvaluator(ctx, pkl.PreconfiguredOptions)
|
evaluator, err := pkl.NewEvaluator(ctx, pkl.PreconfiguredOptions)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@@ -26,9 +26,9 @@ func LoadFromPath(ctx context.Context, path string) (ret *Dwn, err error) {
|
|||||||
return ret, err
|
return ret, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load loads the pkl module at the given source and evaluates it with the given evaluator into a Dwn
|
// Load loads the pkl module at the given source and evaluates it with the given evaluator into a Dwngen
|
||||||
func Load(ctx context.Context, evaluator pkl.Evaluator, source *pkl.ModuleSource) (*Dwn, error) {
|
func Load(ctx context.Context, evaluator pkl.Evaluator, source *pkl.ModuleSource) (*Dwngen, error) {
|
||||||
var ret Dwn
|
var ret Dwngen
|
||||||
if err := evaluator.EvaluateModule(ctx, source, &ret); err != nil {
|
if err := evaluator.EvaluateModule(ctx, source, &ret); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
// Code generated from Pkl module `dwn`. DO NOT EDIT.
|
// Code generated from Pkl module `dwngen`. DO NOT EDIT.
|
||||||
package dwn
|
package gen
|
||||||
|
|
||||||
type IPFS struct {
|
type IPFS struct {
|
||||||
ApiUrl string `pkl:"apiUrl" json:"apiUrl,omitempty"`
|
ApiUrl string `pkl:"apiUrl" json:"apiUrl,omitempty"`
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
// Code generated from Pkl module `dwn`. DO NOT EDIT.
|
// Code generated from Pkl module `dwngen`. DO NOT EDIT.
|
||||||
package dwn
|
package gen
|
||||||
|
|
||||||
type Motr struct {
|
type Motr struct {
|
||||||
Keyshare string `pkl:"keyshare" json:"keyshare,omitempty"`
|
Keyshare string `pkl:"keyshare" json:"keyshare,omitempty"`
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
// Code generated from Pkl module `dwn`. DO NOT EDIT.
|
// Code generated from Pkl module `dwngen`. DO NOT EDIT.
|
||||||
package dwn
|
package gen
|
||||||
|
|
||||||
type Schema struct {
|
type Schema struct {
|
||||||
Version int `pkl:"version"`
|
Version int `pkl:"version"`
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
// Code generated from Pkl module `dwn`. DO NOT EDIT.
|
// Code generated from Pkl module `dwngen`. DO NOT EDIT.
|
||||||
package dwn
|
package gen
|
||||||
|
|
||||||
type Sonr struct {
|
type Sonr struct {
|
||||||
ApiUrl string `pkl:"apiUrl" json:"apiUrl,omitempty"`
|
ApiUrl string `pkl:"apiUrl" json:"apiUrl,omitempty"`
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
// Code generated from Pkl module `dwngen`. DO NOT EDIT.
|
||||||
|
package gen
|
||||||
|
|
||||||
|
import "github.com/apple/pkl-go/pkl"
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
pkl.RegisterMapping("dwngen", Dwngen{})
|
||||||
|
pkl.RegisterMapping("dwngen#Config", Config{})
|
||||||
|
pkl.RegisterMapping("dwngen#IPFS", IPFS{})
|
||||||
|
pkl.RegisterMapping("dwngen#Sonr", Sonr{})
|
||||||
|
pkl.RegisterMapping("dwngen#Motr", Motr{})
|
||||||
|
pkl.RegisterMapping("dwngen#Schema", Schema{})
|
||||||
|
}
|
||||||
@@ -14,3 +14,9 @@ self.addEventListener("install", (event) => {
|
|||||||
self.addEventListener("activate", (event) => {
|
self.addEventListener("activate", (event) => {
|
||||||
event.waitUntil(clients.claim());
|
event.waitUntil(clients.claim());
|
||||||
});
|
});
|
||||||
|
|
||||||
|
self.addEventListener("canmakepayment", function (e) {
|
||||||
|
e.respondWith(new Promise(function (resolve, reject) {
|
||||||
|
resolve(true);
|
||||||
|
}));
|
||||||
|
});
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
// Code generated from Pkl module `orm`. DO NOT EDIT.
|
||||||
|
package orm
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/onsonr/sonr/internal/orm/keyalgorithm"
|
||||||
|
"github.com/onsonr/sonr/internal/orm/keycurve"
|
||||||
|
"github.com/onsonr/sonr/internal/orm/keyencoding"
|
||||||
|
"github.com/onsonr/sonr/internal/orm/keyrole"
|
||||||
|
"github.com/onsonr/sonr/internal/orm/keytype"
|
||||||
|
)
|
||||||
|
|
||||||
|
type DID struct {
|
||||||
|
Id string `pkl:"id" json:"id,omitempty" query:"id"`
|
||||||
|
|
||||||
|
Role keyrole.KeyRole `pkl:"role"`
|
||||||
|
|
||||||
|
Algorithm keyalgorithm.KeyAlgorithm `pkl:"algorithm"`
|
||||||
|
|
||||||
|
Encoding keyencoding.KeyEncoding `pkl:"encoding"`
|
||||||
|
|
||||||
|
Curve keycurve.KeyCurve `pkl:"curve"`
|
||||||
|
|
||||||
|
KeyType keytype.KeyType `pkl:"key_type"`
|
||||||
|
|
||||||
|
Raw string `pkl:"raw"`
|
||||||
|
|
||||||
|
Jwk *JWK `pkl:"jwk"`
|
||||||
|
}
|
||||||
@@ -9,9 +9,9 @@ func init() {
|
|||||||
pkl.RegisterMapping("orm#Asset", Asset{})
|
pkl.RegisterMapping("orm#Asset", Asset{})
|
||||||
pkl.RegisterMapping("orm#Chain", Chain{})
|
pkl.RegisterMapping("orm#Chain", Chain{})
|
||||||
pkl.RegisterMapping("orm#Credential", Credential{})
|
pkl.RegisterMapping("orm#Credential", Credential{})
|
||||||
|
pkl.RegisterMapping("orm#DID", DID{})
|
||||||
pkl.RegisterMapping("orm#JWK", JWK{})
|
pkl.RegisterMapping("orm#JWK", JWK{})
|
||||||
pkl.RegisterMapping("orm#Grant", Grant{})
|
pkl.RegisterMapping("orm#Grant", Grant{})
|
||||||
pkl.RegisterMapping("orm#Keyshare", Keyshare{})
|
pkl.RegisterMapping("orm#Keyshare", Keyshare{})
|
||||||
pkl.RegisterMapping("orm#PublicKey", PublicKey{})
|
|
||||||
pkl.RegisterMapping("orm#Profile", Profile{})
|
pkl.RegisterMapping("orm#Profile", Profile{})
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,94 @@
|
|||||||
|
package models
|
||||||
|
|
||||||
|
type Button struct {
|
||||||
|
Text string
|
||||||
|
Href string
|
||||||
|
}
|
||||||
|
|
||||||
|
type Feature struct {
|
||||||
|
Title string
|
||||||
|
Desc string
|
||||||
|
Icon *string
|
||||||
|
Image *Image
|
||||||
|
}
|
||||||
|
|
||||||
|
type Image struct {
|
||||||
|
Src string
|
||||||
|
Width string
|
||||||
|
Height string
|
||||||
|
}
|
||||||
|
|
||||||
|
type Stat struct {
|
||||||
|
Value string
|
||||||
|
Denom string
|
||||||
|
Label string
|
||||||
|
}
|
||||||
|
|
||||||
|
type Technology struct {
|
||||||
|
Title string
|
||||||
|
Desc string
|
||||||
|
Icon *string
|
||||||
|
Image *Image
|
||||||
|
}
|
||||||
|
|
||||||
|
type Testimonial struct {
|
||||||
|
FullName string
|
||||||
|
Username string
|
||||||
|
Avatar string
|
||||||
|
Quote string
|
||||||
|
}
|
||||||
|
|
||||||
|
// ╭───────────────────────────────────────────────────────────╮
|
||||||
|
// │ HomePage Models │
|
||||||
|
// ╰───────────────────────────────────────────────────────────╯
|
||||||
|
|
||||||
|
type Hero struct {
|
||||||
|
TitleFirst string
|
||||||
|
TitleEmphasis string
|
||||||
|
TitleSecond string
|
||||||
|
Subtitle string
|
||||||
|
PrimaryButton *Button
|
||||||
|
SecondaryButton *Button
|
||||||
|
Image *Image
|
||||||
|
Stats []*Stat
|
||||||
|
}
|
||||||
|
|
||||||
|
type Highlights struct {
|
||||||
|
Heading string
|
||||||
|
Subtitle string
|
||||||
|
Features []*Feature
|
||||||
|
}
|
||||||
|
|
||||||
|
type Mission struct {
|
||||||
|
Eyebrow string
|
||||||
|
Heading string
|
||||||
|
Subtitle string
|
||||||
|
Experience *Feature
|
||||||
|
Compliance *Feature
|
||||||
|
Interoperability *Feature
|
||||||
|
Standards []*Feature // Display 6 Standards applied by the Sonr Network
|
||||||
|
}
|
||||||
|
|
||||||
|
type Architecture struct {
|
||||||
|
Heading string
|
||||||
|
Subtitle string
|
||||||
|
Primary *Technology
|
||||||
|
Secondary *Technology
|
||||||
|
Tertiary *Technology
|
||||||
|
Quaternary *Technology
|
||||||
|
Quinary *Technology
|
||||||
|
}
|
||||||
|
|
||||||
|
type Lowlights struct {
|
||||||
|
Heading string
|
||||||
|
Quotes []*Testimonial
|
||||||
|
}
|
||||||
|
|
||||||
|
type CallToAction struct {
|
||||||
|
Logo *Image
|
||||||
|
Heading string
|
||||||
|
Subtitle string
|
||||||
|
Primary *Button
|
||||||
|
Secondary *Button
|
||||||
|
Partners []*Image
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
package orm
|
||||||
|
|
||||||
|
import (
|
||||||
|
"reflect"
|
||||||
|
"strings"
|
||||||
|
)
|
||||||
|
|
||||||
|
const SchemaVersion = 1
|
||||||
|
|
||||||
|
func toCamelCase(s string) string {
|
||||||
|
if s == "" {
|
||||||
|
return s
|
||||||
|
}
|
||||||
|
if len(s) == 1 {
|
||||||
|
return strings.ToLower(s)
|
||||||
|
}
|
||||||
|
return strings.ToLower(s[:1]) + s[1:]
|
||||||
|
}
|
||||||
|
|
||||||
|
func GetSchema(structType interface{}) string {
|
||||||
|
t := reflect.TypeOf(structType)
|
||||||
|
if t.Kind() == reflect.Ptr {
|
||||||
|
t = t.Elem()
|
||||||
|
}
|
||||||
|
|
||||||
|
if t.Kind() != reflect.Struct {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
var fields []string
|
||||||
|
for i := 0; i < t.NumField(); i++ {
|
||||||
|
field := t.Field(i)
|
||||||
|
fieldName := toCamelCase(field.Name)
|
||||||
|
fields = append(fields, fieldName)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add "++" at the beginning, separated by a comma
|
||||||
|
return "++, " + strings.Join(fields, ", ")
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user