mirror of
https://github.com/sonr-io/sonr.git
synced 2026-08-02 17:31:39 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c4aebe4ac3 | ||
|
|
cc6f4e6931 | ||
|
|
08c946547e | ||
|
|
64297772e4 | ||
|
|
e1ad117473 | ||
|
|
2cd44c0b66 | ||
|
|
c2f7a53017 | ||
|
|
b6c49828ed | ||
|
|
104df074e9 | ||
|
|
58aa71997d | ||
|
|
9a3c8e000b | ||
|
|
3790e926de | ||
|
|
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 |
@@ -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"
|
||||
tag_format = "v$version"
|
||||
version_scheme = "semver"
|
||||
version = "0.5.9"
|
||||
version = "0.5.12"
|
||||
update_changelog_on_bump = true
|
||||
major_version_zero = true
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
FROM jetpackio/devbox:latest
|
||||
|
||||
# Installing your devbox project
|
||||
WORKDIR /code
|
||||
USER root:root
|
||||
RUN mkdir -p /code && chown ${DEVBOX_USER}:${DEVBOX_USER} /code
|
||||
USER ${DEVBOX_USER}:${DEVBOX_USER}
|
||||
COPY --chown=${DEVBOX_USER}:${DEVBOX_USER} devbox.json devbox.json
|
||||
COPY --chown=${DEVBOX_USER}:${DEVBOX_USER} devbox.lock devbox.lock
|
||||
|
||||
|
||||
|
||||
RUN devbox run -- echo "Installed Packages."
|
||||
|
||||
RUN devbox shellenv --init-hook >> ~/.profile
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"name": "Devbox Remote Container",
|
||||
"build": {
|
||||
"dockerfile": "./Dockerfile",
|
||||
"context": ".."
|
||||
},
|
||||
"features": {
|
||||
"ghcr.io/devcontainers/features/sshd:1": {
|
||||
"version": "latest"
|
||||
}
|
||||
},
|
||||
"customizations": {
|
||||
"vscode": {
|
||||
"settings": {},
|
||||
"extensions": [
|
||||
"jetpack-io.devbox"
|
||||
]
|
||||
}
|
||||
},
|
||||
"remoteUser": "devbox"
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
title: "[Milestone] "
|
||||
labels: ["#OKR", "#PLANNING"]
|
||||
body:
|
||||
- type: input
|
||||
id: has-version
|
||||
attributes:
|
||||
label: Version
|
||||
description: A tag for the associated milestone.
|
||||
placeholder: v0.6.0
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Objective
|
||||
description: Explain the objective of the OKR in less than 100 characters.
|
||||
placeholder: Ethereum IBC integration with Sonr.
|
||||
render: markdown
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Task List
|
||||
description: |
|
||||
Break down the objective into a list of tasks to be completed.
|
||||
value: |
|
||||
- [ ] #
|
||||
- [ ] #
|
||||
- [ ] #
|
||||
validations:
|
||||
required: true
|
||||
@@ -1,30 +0,0 @@
|
||||
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,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,5 @@
|
||||
"@pr/feature": ["feature/*", "feat/*"]
|
||||
"@pr/fix": fix/*
|
||||
"@pr/chore": chore/*
|
||||
"@pr/docs": docs/*
|
||||
"@pr/refactor": refactor/*
|
||||
@@ -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
|
||||
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:
|
||||
runs-on: ubuntu-latest
|
||||
name: Publish to pkl.sh
|
||||
|
||||
@@ -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
|
||||
@@ -22,24 +22,8 @@ jobs:
|
||||
- name: Run tests
|
||||
run: make test
|
||||
|
||||
check-proto-changes:
|
||||
name: "Check Proto Changes"
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
proto_changed: ${{ steps.check_proto.outputs.proto_changed }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Check for changes in proto directory
|
||||
id: check_proto
|
||||
run: |
|
||||
git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -q '^proto/' && \
|
||||
echo "proto_changed=true" >> $GITHUB_OUTPUT || \
|
||||
echo "proto_changed=false" >> $GITHUB_OUTPUT
|
||||
|
||||
bump-version:
|
||||
needs: [run-tests, check-proto-changes]
|
||||
needs: [run-tests]
|
||||
runs-on: ubuntu-latest
|
||||
name: "Bump Version"
|
||||
if: ${{ !startsWith(github.event.head_commit.message, 'bump:') }}
|
||||
@@ -52,4 +36,4 @@ jobs:
|
||||
uses: commitizen-tools/commitizen-action@master
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
increment: ${{ needs.check-proto-changes.outputs.proto_changed == 'true' && 'MINOR' || 'PATCH' }}
|
||||
increment: "PATCH"
|
||||
|
||||
@@ -75,6 +75,7 @@ nebula/node_modules
|
||||
|
||||
mprocs.yaml
|
||||
build
|
||||
sonr.wiki
|
||||
|
||||
!devbox.lock
|
||||
!buf.lock
|
||||
|
||||
@@ -14,26 +14,6 @@ builds:
|
||||
ldflags:
|
||||
- -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}}
|
||||
|
||||
- id: hway
|
||||
goos: [linux, darwin]
|
||||
goarch: [amd64, arm64]
|
||||
main: ./cmd/hway
|
||||
binary: hway
|
||||
builder: go
|
||||
gobinary: go
|
||||
command: build
|
||||
ldflags:
|
||||
- -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}}
|
||||
|
||||
- id: motr
|
||||
goos: [js]
|
||||
goarch: [wasm]
|
||||
main: ./cmd/motr/motr.go
|
||||
binary: motr
|
||||
builder: go
|
||||
gobinary: go
|
||||
command: build
|
||||
|
||||
archives:
|
||||
- id: sonr
|
||||
builds: [sonr]
|
||||
@@ -43,14 +23,6 @@ archives:
|
||||
- src: README*
|
||||
- src: CHANGELOG*
|
||||
|
||||
- id: hway
|
||||
builds: [hway]
|
||||
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:
|
||||
github:
|
||||
owner: onsonr
|
||||
@@ -82,56 +54,6 @@ brews:
|
||||
branch: master
|
||||
token: "{{ .Env.GITHUB_PERSONAL_AUTH_TOKEN }}"
|
||||
|
||||
- name: hway
|
||||
ids: [hway]
|
||||
commit_author:
|
||||
name: goreleaserbot
|
||||
email: bot@goreleaser.com
|
||||
directory: Formula
|
||||
caveats: "Use hway 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
|
||||
|
||||
# .goreleaser.yaml
|
||||
dockers:
|
||||
- # Sonr Binary
|
||||
id: sonrd
|
||||
goos: linux
|
||||
goarch: amd64
|
||||
ids:
|
||||
- sonr
|
||||
image_templates:
|
||||
- "onsonr/sonrd:latest"
|
||||
- "onsonr/sonrd:{{ .Tag }}"
|
||||
dockerfile: "./deploy/release/sonrd.Dockerfile"
|
||||
build_flag_templates:
|
||||
- "--label=org.opencontainers.image.created={{.Date}}"
|
||||
- "--label=org.opencontainers.image.title=sonrd"
|
||||
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
|
||||
- "--label=org.opencontainers.image.version={{.Version}}"
|
||||
|
||||
- # Motr Binary
|
||||
id: hway
|
||||
goos: linux
|
||||
goarch: amd64
|
||||
ids:
|
||||
- hway
|
||||
image_templates:
|
||||
- "onsonr/hway:latest"
|
||||
- "onsonr/hway:{{ .Tag }}"
|
||||
dockerfile: "./deploy/release/hway.Dockerfile"
|
||||
build_flag_templates:
|
||||
- "--label=org.opencontainers.image.created={{.Date}}"
|
||||
- "--label=org.opencontainers.image.title=hway"
|
||||
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
|
||||
- "--label=org.opencontainers.image.version={{.Version}}"
|
||||
|
||||
announce:
|
||||
telegram:
|
||||
enabled: true
|
||||
|
||||
@@ -1,3 +1,89 @@
|
||||
## v0.5.12 (2024-10-18)
|
||||
|
||||
### Feat
|
||||
|
||||
- add User-Agent and Platform to session
|
||||
- introduce AuthState enum for authentication state
|
||||
|
||||
### Fix
|
||||
|
||||
- **version**: revert version bump to 0.5.11
|
||||
- **version**: update version to 0.5.12
|
||||
|
||||
### Refactor
|
||||
|
||||
- remove dependency on proto change detection
|
||||
- update asset publishing configuration
|
||||
|
||||
## 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
|
||||
|
||||
@@ -113,6 +113,7 @@ draw-deps:
|
||||
@goviz -i ./cmd/sonrd -d 2 | dot -Tpng -o dependency-graph.png
|
||||
|
||||
clean:
|
||||
rm -rf pkg/nebula/node_modules
|
||||
rm -rf snapcraft-local.yaml build/
|
||||
|
||||
distclean: clean
|
||||
@@ -183,13 +184,10 @@ protoVer=0.13.2
|
||||
protoImageName=ghcr.io/cosmos/proto-builder:$(protoVer)
|
||||
protoImage=$(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace $(protoImageName)
|
||||
|
||||
proto-all: proto-format proto-lint proto-gen format
|
||||
|
||||
proto-gen:
|
||||
@echo "Generating Protobuf files"
|
||||
@go install cosmossdk.io/orm/cmd/protoc-gen-go-cosmos-orm@latest
|
||||
@$(protoImage) sh ./scripts/protocgen.sh
|
||||
# generate the stubs for the proto files from the proto directory
|
||||
spawn stub-gen
|
||||
|
||||
proto-format:
|
||||
@@ -291,42 +289,26 @@ sh-testnet: mod-tidy
|
||||
|
||||
.PHONY: setup-testnet set-testnet-configs testnet testnet-basic sh-testnet
|
||||
|
||||
|
||||
###############################################################################
|
||||
### templ & vault ###
|
||||
### custom generation ###
|
||||
###############################################################################
|
||||
|
||||
.PHONY: motr hway templ pkl nebula
|
||||
.PHONY: templ-gen pkl-gen
|
||||
|
||||
hway:
|
||||
@echo "(motr) Building Highway gateway"
|
||||
go build -o ./build/hway ./cmd/hway
|
||||
assets-gen:
|
||||
@echo "(assets) Generating gateway cloudflare workers assets"
|
||||
go run github.com/syumai/workers/cmd/workers-assets-gen -mode=go -o ./cmd/hway/build
|
||||
|
||||
motr:
|
||||
@echo "(dwn) Building motr.wasm -> Service Worker IPFS Vault"
|
||||
GOOS=js GOARCH=wasm go build -o ./pkg/dwn/app.wasm ./cmd/motr/motr.go
|
||||
|
||||
templ:
|
||||
templ-gen:
|
||||
@echo "(templ) Generating templ files"
|
||||
templ generate
|
||||
|
||||
nebula:
|
||||
@echo "(nebula) Building nebula"
|
||||
cd pkg/nebula && bun run build
|
||||
|
||||
pkl:
|
||||
pkl-gen:
|
||||
@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/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/UIUX.pkl
|
||||
|
||||
start-caddy:
|
||||
@echo "(start-caddy) Starting caddy"
|
||||
./build/caddy run --config ./config/caddy/Caddyfile
|
||||
|
||||
start-hway: hway
|
||||
@echo "(start-proxy) Starting proxy server"
|
||||
./build/hway start
|
||||
|
||||
###############################################################################
|
||||
### help ###
|
||||
|
||||
@@ -1,37 +1,23 @@
|
||||
<div align="center" style="text-align: center;">
|
||||
|
||||
# `sonr` - Sonr Chain
|
||||
|
||||
<center>
|
||||
|
||||
[](https://pkg.go.dev/github.com/onsonr/sonr)
|
||||

|
||||

|
||||
[](https://sonr.io)
|
||||
|
||||
[](https://goreportcard.com/report/github.com/onsonr/sonr)
|
||||
[](https://sonarcloud.io/summary/new_code?id=sonr-io_sonr)
|
||||
|
||||
</div>
|
||||
<br />
|
||||
</center>
|
||||
|
||||
## Overview
|
||||
|
||||
Sonr is a combination of decentralized primitives. Fundamentally, it is a peer-to-peer identity and asset management system that leverages DID documents, Webauthn, and IPFS—providing users with a secure, portable decentralized identity.
|
||||
|
||||
<br />
|
||||
## Stats
|
||||
|
||||
## Components
|
||||
|
||||
### `sonrd`
|
||||
|
||||
The main blockchain node that runs the `sonr` chain. It is responsible for maintaining the state of the chain, including IPFS based vaults, and did documents.
|
||||
|
||||
### `vault`
|
||||
|
||||
The `vault` is a wasm module that is compiled and deployed to IPFS on behalf of the user. It is responsible for storing and retrieving encrypted data.
|
||||
|
||||
- SQLite Database backend
|
||||
- Encryption via admonition
|
||||
- Authentication via webauthn
|
||||
- Authorization via Macroons
|
||||
- HTTP API
|
||||

|
||||
|
||||
## Acknowledgements
|
||||
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
version: "3"
|
||||
|
||||
vars:
|
||||
ROOT_DIR:
|
||||
sh: pwd
|
||||
|
||||
tasks:
|
||||
hway:build:
|
||||
dir: cmd/hway
|
||||
env:
|
||||
GOOS: js
|
||||
GOARCH: wasm
|
||||
cmds:
|
||||
- go build -o build/app.wasm main.go
|
||||
|
||||
hway:dev:
|
||||
dir: cmd/hway
|
||||
cmds:
|
||||
- bunx wrangler dev
|
||||
|
||||
hway:deploy:
|
||||
dir: cmd/hway
|
||||
cmds:
|
||||
- bunx wrangler deploy
|
||||
|
||||
motr:build:
|
||||
dir: internal/dwn
|
||||
env:
|
||||
GOOS: js
|
||||
GOARCH: wasm
|
||||
cmds:
|
||||
- go build -o app.wasm wasm/main.go
|
||||
|
||||
nebula:build:
|
||||
dir: pkg/nebula
|
||||
cmds:
|
||||
- bun install
|
||||
- bun run deps.mjs
|
||||
- bunx tailwindcss -i ./global/styles/globals.css -o ./assets/css/styles.css
|
||||
@@ -104,9 +104,9 @@ 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: onsonr.sonr.did.module.v1.Module"))
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: did.module.v1.Module"))
|
||||
}
|
||||
panic(fmt.Errorf("message onsonr.sonr.did.module.v1.Module does not contain field %s", fd.FullName()))
|
||||
panic(fmt.Errorf("message did.module.v1.Module does not contain field %s", fd.FullName()))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,9 +120,9 @@ 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: onsonr.sonr.did.module.v1.Module"))
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: did.module.v1.Module"))
|
||||
}
|
||||
panic(fmt.Errorf("message onsonr.sonr.did.module.v1.Module does not contain field %s", fd.FullName()))
|
||||
panic(fmt.Errorf("message did.module.v1.Module does not contain field %s", fd.FullName()))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -136,9 +136,9 @@ func (x *fastReflection_Module) Get(descriptor protoreflect.FieldDescriptor) pro
|
||||
switch descriptor.FullName() {
|
||||
default:
|
||||
if descriptor.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: onsonr.sonr.did.module.v1.Module"))
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: did.module.v1.Module"))
|
||||
}
|
||||
panic(fmt.Errorf("message onsonr.sonr.did.module.v1.Module does not contain field %s", descriptor.FullName()))
|
||||
panic(fmt.Errorf("message did.module.v1.Module does not contain field %s", descriptor.FullName()))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -156,9 +156,9 @@ func (x *fastReflection_Module) Set(fd protoreflect.FieldDescriptor, value proto
|
||||
switch fd.FullName() {
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: onsonr.sonr.did.module.v1.Module"))
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: did.module.v1.Module"))
|
||||
}
|
||||
panic(fmt.Errorf("message onsonr.sonr.did.module.v1.Module does not contain field %s", fd.FullName()))
|
||||
panic(fmt.Errorf("message did.module.v1.Module does not contain field %s", fd.FullName()))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -176,9 +176,9 @@ func (x *fastReflection_Module) Mutable(fd protoreflect.FieldDescriptor) protore
|
||||
switch fd.FullName() {
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: onsonr.sonr.did.module.v1.Module"))
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: did.module.v1.Module"))
|
||||
}
|
||||
panic(fmt.Errorf("message onsonr.sonr.did.module.v1.Module does not contain field %s", fd.FullName()))
|
||||
panic(fmt.Errorf("message did.module.v1.Module does not contain field %s", fd.FullName()))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -189,9 +189,9 @@ func (x *fastReflection_Module) NewField(fd protoreflect.FieldDescriptor) protor
|
||||
switch fd.FullName() {
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: onsonr.sonr.did.module.v1.Module"))
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: did.module.v1.Module"))
|
||||
}
|
||||
panic(fmt.Errorf("message onsonr.sonr.did.module.v1.Module does not contain field %s", fd.FullName()))
|
||||
panic(fmt.Errorf("message did.module.v1.Module does not contain field %s", fd.FullName()))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -201,7 +201,7 @@ func (x *fastReflection_Module) NewField(fd protoreflect.FieldDescriptor) protor
|
||||
func (x *fastReflection_Module) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor {
|
||||
switch d.FullName() {
|
||||
default:
|
||||
panic(fmt.Errorf("%s is not a oneof field in onsonr.sonr.did.module.v1.Module", d.FullName()))
|
||||
panic(fmt.Errorf("%s is not a oneof field in did.module.v1.Module", d.FullName()))
|
||||
}
|
||||
panic("unreachable")
|
||||
}
|
||||
@@ -414,29 +414,24 @@ var File_did_module_v1_module_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_did_module_v1_module_proto_rawDesc = []byte{
|
||||
0x0a, 0x1a, 0x64, 0x69, 0x64, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f,
|
||||
0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x19, 0x6f, 0x6e,
|
||||
0x73, 0x6f, 0x6e, 0x72, 0x2e, 0x73, 0x6f, 0x6e, 0x72, 0x2e, 0x64, 0x69, 0x64, 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, 0xe8, 0x01, 0x0a, 0x1d, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x6e, 0x73, 0x6f,
|
||||
0x6e, 0x72, 0x2e, 0x73, 0x6f, 0x6e, 0x72, 0x2e, 0x64, 0x69, 0x64, 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, 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, 0x64, 0x69, 0x64, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6d,
|
||||
0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x04, 0x4f, 0x53, 0x44, 0x4d, 0xaa, 0x02,
|
||||
0x19, 0x4f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2e, 0x53, 0x6f, 0x6e, 0x72, 0x2e, 0x44, 0x69, 0x64,
|
||||
0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x19, 0x4f, 0x6e, 0x73,
|
||||
0x6f, 0x6e, 0x72, 0x5c, 0x53, 0x6f, 0x6e, 0x72, 0x5c, 0x44, 0x69, 0x64, 0x5c, 0x4d, 0x6f, 0x64,
|
||||
0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x25, 0x4f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x5c,
|
||||
0x53, 0x6f, 0x6e, 0x72, 0x5c, 0x44, 0x69, 0x64, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c,
|
||||
0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02,
|
||||
0x1d, 0x4f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x3a, 0x3a, 0x53, 0x6f, 0x6e, 0x72, 0x3a, 0x3a, 0x44,
|
||||
0x69, 0x64, 0x3a, 0x3a, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x64, 0x69,
|
||||
0x64, 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, 0xa9, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e,
|
||||
0x64, 0x69, 0x64, 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, 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, 0x64, 0x69, 0x64, 0x2f, 0x6d, 0x6f, 0x64,
|
||||
0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2,
|
||||
0x02, 0x03, 0x44, 0x4d, 0x58, 0xaa, 0x02, 0x0d, 0x44, 0x69, 0x64, 0x2e, 0x4d, 0x6f, 0x64, 0x75,
|
||||
0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0d, 0x44, 0x69, 0x64, 0x5c, 0x4d, 0x6f, 0x64, 0x75,
|
||||
0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x19, 0x44, 0x69, 0x64, 0x5c, 0x4d, 0x6f, 0x64, 0x75,
|
||||
0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74,
|
||||
0x61, 0xea, 0x02, 0x0f, 0x44, 0x69, 0x64, 0x3a, 0x3a, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a,
|
||||
0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
@@ -453,7 +448,7 @@ func file_did_module_v1_module_proto_rawDescGZIP() []byte {
|
||||
|
||||
var file_did_module_v1_module_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_did_module_v1_module_proto_goTypes = []interface{}{
|
||||
(*Module)(nil), // 0: onsonr.sonr.did.module.v1.Module
|
||||
(*Module)(nil), // 0: did.module.v1.Module
|
||||
}
|
||||
var file_did_module_v1_module_proto_depIdxs = []int32{
|
||||
0, // [0:0] is the sub-list for method output_type
|
||||
|
||||
+2877
-20
File diff suppressed because it is too large
Load Diff
@@ -9,6 +9,163 @@ import (
|
||||
ormerrors "cosmossdk.io/orm/types/ormerrors"
|
||||
)
|
||||
|
||||
type AssertionTable interface {
|
||||
Insert(ctx context.Context, assertion *Assertion) error
|
||||
Update(ctx context.Context, assertion *Assertion) error
|
||||
Save(ctx context.Context, assertion *Assertion) error
|
||||
Delete(ctx context.Context, assertion *Assertion) error
|
||||
Has(ctx context.Context, did 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, did string) (*Assertion, error)
|
||||
HasByControllerSubject(ctx context.Context, controller string, subject string) (found bool, err error)
|
||||
// GetByControllerSubject returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found.
|
||||
GetByControllerSubject(ctx context.Context, controller string, subject string) (*Assertion, error)
|
||||
List(ctx context.Context, prefixKey AssertionIndexKey, opts ...ormlist.Option) (AssertionIterator, error)
|
||||
ListRange(ctx context.Context, from, to AssertionIndexKey, opts ...ormlist.Option) (AssertionIterator, error)
|
||||
DeleteBy(ctx context.Context, prefixKey AssertionIndexKey) error
|
||||
DeleteRange(ctx context.Context, from, to AssertionIndexKey) error
|
||||
|
||||
doNotImplement()
|
||||
}
|
||||
|
||||
type AssertionIterator struct {
|
||||
ormtable.Iterator
|
||||
}
|
||||
|
||||
func (i AssertionIterator) Value() (*Assertion, error) {
|
||||
var assertion Assertion
|
||||
err := i.UnmarshalMessage(&assertion)
|
||||
return &assertion, err
|
||||
}
|
||||
|
||||
type AssertionIndexKey interface {
|
||||
id() uint32
|
||||
values() []interface{}
|
||||
assertionIndexKey()
|
||||
}
|
||||
|
||||
// primary key starting index..
|
||||
type AssertionPrimaryKey = AssertionDidIndexKey
|
||||
|
||||
type AssertionDidIndexKey struct {
|
||||
vs []interface{}
|
||||
}
|
||||
|
||||
func (x AssertionDidIndexKey) id() uint32 { return 0 }
|
||||
func (x AssertionDidIndexKey) values() []interface{} { return x.vs }
|
||||
func (x AssertionDidIndexKey) assertionIndexKey() {}
|
||||
|
||||
func (this AssertionDidIndexKey) WithDid(did string) AssertionDidIndexKey {
|
||||
this.vs = []interface{}{did}
|
||||
return this
|
||||
}
|
||||
|
||||
type AssertionControllerSubjectIndexKey struct {
|
||||
vs []interface{}
|
||||
}
|
||||
|
||||
func (x AssertionControllerSubjectIndexKey) id() uint32 { return 1 }
|
||||
func (x AssertionControllerSubjectIndexKey) values() []interface{} { return x.vs }
|
||||
func (x AssertionControllerSubjectIndexKey) assertionIndexKey() {}
|
||||
|
||||
func (this AssertionControllerSubjectIndexKey) WithController(controller string) AssertionControllerSubjectIndexKey {
|
||||
this.vs = []interface{}{controller}
|
||||
return this
|
||||
}
|
||||
|
||||
func (this AssertionControllerSubjectIndexKey) WithControllerSubject(controller string, subject string) AssertionControllerSubjectIndexKey {
|
||||
this.vs = []interface{}{controller, subject}
|
||||
return this
|
||||
}
|
||||
|
||||
type assertionTable struct {
|
||||
table ormtable.Table
|
||||
}
|
||||
|
||||
func (this assertionTable) Insert(ctx context.Context, assertion *Assertion) error {
|
||||
return this.table.Insert(ctx, assertion)
|
||||
}
|
||||
|
||||
func (this assertionTable) Update(ctx context.Context, assertion *Assertion) error {
|
||||
return this.table.Update(ctx, assertion)
|
||||
}
|
||||
|
||||
func (this assertionTable) Save(ctx context.Context, assertion *Assertion) error {
|
||||
return this.table.Save(ctx, assertion)
|
||||
}
|
||||
|
||||
func (this assertionTable) Delete(ctx context.Context, assertion *Assertion) error {
|
||||
return this.table.Delete(ctx, assertion)
|
||||
}
|
||||
|
||||
func (this assertionTable) Has(ctx context.Context, did string) (found bool, err error) {
|
||||
return this.table.PrimaryKey().Has(ctx, did)
|
||||
}
|
||||
|
||||
func (this assertionTable) Get(ctx context.Context, did string) (*Assertion, error) {
|
||||
var assertion Assertion
|
||||
found, err := this.table.PrimaryKey().Get(ctx, &assertion, did)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !found {
|
||||
return nil, ormerrors.NotFound
|
||||
}
|
||||
return &assertion, nil
|
||||
}
|
||||
|
||||
func (this assertionTable) HasByControllerSubject(ctx context.Context, controller string, subject string) (found bool, err error) {
|
||||
return this.table.GetIndexByID(1).(ormtable.UniqueIndex).Has(ctx,
|
||||
controller,
|
||||
subject,
|
||||
)
|
||||
}
|
||||
|
||||
func (this assertionTable) GetByControllerSubject(ctx context.Context, controller string, subject string) (*Assertion, error) {
|
||||
var assertion Assertion
|
||||
found, err := this.table.GetIndexByID(1).(ormtable.UniqueIndex).Get(ctx, &assertion,
|
||||
controller,
|
||||
subject,
|
||||
)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !found {
|
||||
return nil, ormerrors.NotFound
|
||||
}
|
||||
return &assertion, nil
|
||||
}
|
||||
|
||||
func (this assertionTable) List(ctx context.Context, prefixKey AssertionIndexKey, opts ...ormlist.Option) (AssertionIterator, error) {
|
||||
it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...)
|
||||
return AssertionIterator{it}, err
|
||||
}
|
||||
|
||||
func (this assertionTable) ListRange(ctx context.Context, from, to AssertionIndexKey, opts ...ormlist.Option) (AssertionIterator, error) {
|
||||
it, err := this.table.GetIndexByID(from.id()).ListRange(ctx, from.values(), to.values(), opts...)
|
||||
return AssertionIterator{it}, err
|
||||
}
|
||||
|
||||
func (this assertionTable) DeleteBy(ctx context.Context, prefixKey AssertionIndexKey) error {
|
||||
return this.table.GetIndexByID(prefixKey.id()).DeleteBy(ctx, prefixKey.values()...)
|
||||
}
|
||||
|
||||
func (this assertionTable) DeleteRange(ctx context.Context, from, to AssertionIndexKey) error {
|
||||
return this.table.GetIndexByID(from.id()).DeleteRange(ctx, from.values(), to.values())
|
||||
}
|
||||
|
||||
func (this assertionTable) doNotImplement() {}
|
||||
|
||||
var _ AssertionTable = assertionTable{}
|
||||
|
||||
func NewAssertionTable(db ormtable.Schema) (AssertionTable, error) {
|
||||
table := db.GetTable(&Assertion{})
|
||||
if table == nil {
|
||||
return nil, ormerrors.TableNotFound.Wrap(string((&Assertion{}).ProtoReflect().Descriptor().FullName()))
|
||||
}
|
||||
return assertionTable{table}, nil
|
||||
}
|
||||
|
||||
type AuthenticationTable interface {
|
||||
Insert(ctx context.Context, authentication *Authentication) error
|
||||
Update(ctx context.Context, authentication *Authentication) error
|
||||
@@ -692,6 +849,7 @@ func NewVerificationTable(db ormtable.Schema) (VerificationTable, error) {
|
||||
}
|
||||
|
||||
type StateStore interface {
|
||||
AssertionTable() AssertionTable
|
||||
AuthenticationTable() AuthenticationTable
|
||||
ControllerTable() ControllerTable
|
||||
VerificationTable() VerificationTable
|
||||
@@ -700,11 +858,16 @@ type StateStore interface {
|
||||
}
|
||||
|
||||
type stateStore struct {
|
||||
assertion AssertionTable
|
||||
authentication AuthenticationTable
|
||||
controller ControllerTable
|
||||
verification VerificationTable
|
||||
}
|
||||
|
||||
func (x stateStore) AssertionTable() AssertionTable {
|
||||
return x.assertion
|
||||
}
|
||||
|
||||
func (x stateStore) AuthenticationTable() AuthenticationTable {
|
||||
return x.authentication
|
||||
}
|
||||
@@ -722,6 +885,11 @@ func (stateStore) doNotImplement() {}
|
||||
var _ StateStore = stateStore{}
|
||||
|
||||
func NewStateStore(db ormtable.Schema) (StateStore, error) {
|
||||
assertionTable, err := NewAssertionTable(db)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
authenticationTable, err := NewAuthenticationTable(db)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -738,6 +906,7 @@ func NewStateStore(db ormtable.Schema) (StateStore, error) {
|
||||
}
|
||||
|
||||
return stateStore{
|
||||
assertionTable,
|
||||
authenticationTable,
|
||||
controllerTable,
|
||||
verificationTable,
|
||||
|
||||
+1281
-2960
File diff suppressed because it is too large
Load Diff
+3997
-830
File diff suppressed because it is too large
Load Diff
+134
-19
@@ -20,7 +20,10 @@ const _ = grpc.SupportPackageIsVersion7
|
||||
|
||||
const (
|
||||
Msg_ExecuteTx_FullMethodName = "/did.v1.Msg/ExecuteTx"
|
||||
Msg_RegisterController_FullMethodName = "/did.v1.Msg/RegisterController"
|
||||
Msg_LinkAssertion_FullMethodName = "/did.v1.Msg/LinkAssertion"
|
||||
Msg_LinkAuthentication_FullMethodName = "/did.v1.Msg/LinkAuthentication"
|
||||
Msg_UnlinkAssertion_FullMethodName = "/did.v1.Msg/UnlinkAssertion"
|
||||
Msg_UnlinkAuthentication_FullMethodName = "/did.v1.Msg/UnlinkAuthentication"
|
||||
Msg_UpdateParams_FullMethodName = "/did.v1.Msg/UpdateParams"
|
||||
)
|
||||
|
||||
@@ -31,9 +34,14 @@ type MsgClient interface {
|
||||
// ExecuteTx executes a transaction on the Sonr Blockchain. It leverages
|
||||
// Macaroon for verification.
|
||||
ExecuteTx(ctx context.Context, in *MsgExecuteTx, opts ...grpc.CallOption) (*MsgExecuteTxResponse, error)
|
||||
// RegisterController initializes a controller with the given authentication
|
||||
// set, address, cid, publicKey, and user-defined alias.
|
||||
RegisterController(ctx context.Context, in *MsgRegisterController, opts ...grpc.CallOption) (*MsgRegisterControllerResponse, error)
|
||||
// LinkAssertion links an assertion to a controller.
|
||||
LinkAssertion(ctx context.Context, in *MsgLinkAssertion, opts ...grpc.CallOption) (*MsgLinkAssertionResponse, error)
|
||||
// LinkAuthentication links an authentication to a controller.
|
||||
LinkAuthentication(ctx context.Context, in *MsgLinkAuthentication, opts ...grpc.CallOption) (*MsgLinkAuthenticationResponse, error)
|
||||
// UnlinkAssertion unlinks an assertion from a controller.
|
||||
UnlinkAssertion(ctx context.Context, in *MsgUnlinkAssertion, opts ...grpc.CallOption) (*MsgUnlinkAssertionResponse, error)
|
||||
// UnlinkAuthentication unlinks an authentication from a controller.
|
||||
UnlinkAuthentication(ctx context.Context, in *MsgUnlinkAuthentication, opts ...grpc.CallOption) (*MsgUnlinkAuthenticationResponse, error)
|
||||
// UpdateParams defines a governance operation for updating the parameters.
|
||||
UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error)
|
||||
}
|
||||
@@ -55,9 +63,36 @@ func (c *msgClient) ExecuteTx(ctx context.Context, in *MsgExecuteTx, opts ...grp
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *msgClient) RegisterController(ctx context.Context, in *MsgRegisterController, opts ...grpc.CallOption) (*MsgRegisterControllerResponse, error) {
|
||||
out := new(MsgRegisterControllerResponse)
|
||||
err := c.cc.Invoke(ctx, Msg_RegisterController_FullMethodName, in, out, opts...)
|
||||
func (c *msgClient) LinkAssertion(ctx context.Context, in *MsgLinkAssertion, opts ...grpc.CallOption) (*MsgLinkAssertionResponse, error) {
|
||||
out := new(MsgLinkAssertionResponse)
|
||||
err := c.cc.Invoke(ctx, Msg_LinkAssertion_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *msgClient) LinkAuthentication(ctx context.Context, in *MsgLinkAuthentication, opts ...grpc.CallOption) (*MsgLinkAuthenticationResponse, error) {
|
||||
out := new(MsgLinkAuthenticationResponse)
|
||||
err := c.cc.Invoke(ctx, Msg_LinkAuthentication_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *msgClient) UnlinkAssertion(ctx context.Context, in *MsgUnlinkAssertion, opts ...grpc.CallOption) (*MsgUnlinkAssertionResponse, error) {
|
||||
out := new(MsgUnlinkAssertionResponse)
|
||||
err := c.cc.Invoke(ctx, Msg_UnlinkAssertion_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *msgClient) UnlinkAuthentication(ctx context.Context, in *MsgUnlinkAuthentication, opts ...grpc.CallOption) (*MsgUnlinkAuthenticationResponse, error) {
|
||||
out := new(MsgUnlinkAuthenticationResponse)
|
||||
err := c.cc.Invoke(ctx, Msg_UnlinkAuthentication_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -80,9 +115,14 @@ type MsgServer interface {
|
||||
// ExecuteTx executes a transaction on the Sonr Blockchain. It leverages
|
||||
// Macaroon for verification.
|
||||
ExecuteTx(context.Context, *MsgExecuteTx) (*MsgExecuteTxResponse, error)
|
||||
// RegisterController initializes a controller with the given authentication
|
||||
// set, address, cid, publicKey, and user-defined alias.
|
||||
RegisterController(context.Context, *MsgRegisterController) (*MsgRegisterControllerResponse, error)
|
||||
// LinkAssertion links an assertion to a controller.
|
||||
LinkAssertion(context.Context, *MsgLinkAssertion) (*MsgLinkAssertionResponse, error)
|
||||
// LinkAuthentication links an authentication to a controller.
|
||||
LinkAuthentication(context.Context, *MsgLinkAuthentication) (*MsgLinkAuthenticationResponse, error)
|
||||
// UnlinkAssertion unlinks an assertion from a controller.
|
||||
UnlinkAssertion(context.Context, *MsgUnlinkAssertion) (*MsgUnlinkAssertionResponse, error)
|
||||
// UnlinkAuthentication unlinks an authentication from a controller.
|
||||
UnlinkAuthentication(context.Context, *MsgUnlinkAuthentication) (*MsgUnlinkAuthenticationResponse, error)
|
||||
// UpdateParams defines a governance operation for updating the parameters.
|
||||
UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error)
|
||||
mustEmbedUnimplementedMsgServer()
|
||||
@@ -95,8 +135,17 @@ type UnimplementedMsgServer struct {
|
||||
func (UnimplementedMsgServer) ExecuteTx(context.Context, *MsgExecuteTx) (*MsgExecuteTxResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ExecuteTx not implemented")
|
||||
}
|
||||
func (UnimplementedMsgServer) RegisterController(context.Context, *MsgRegisterController) (*MsgRegisterControllerResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method RegisterController not implemented")
|
||||
func (UnimplementedMsgServer) LinkAssertion(context.Context, *MsgLinkAssertion) (*MsgLinkAssertionResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method LinkAssertion not implemented")
|
||||
}
|
||||
func (UnimplementedMsgServer) LinkAuthentication(context.Context, *MsgLinkAuthentication) (*MsgLinkAuthenticationResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method LinkAuthentication not implemented")
|
||||
}
|
||||
func (UnimplementedMsgServer) UnlinkAssertion(context.Context, *MsgUnlinkAssertion) (*MsgUnlinkAssertionResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method UnlinkAssertion not implemented")
|
||||
}
|
||||
func (UnimplementedMsgServer) UnlinkAuthentication(context.Context, *MsgUnlinkAuthentication) (*MsgUnlinkAuthenticationResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method UnlinkAuthentication not implemented")
|
||||
}
|
||||
func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented")
|
||||
@@ -132,20 +181,74 @@ func _Msg_ExecuteTx_Handler(srv interface{}, ctx context.Context, dec func(inter
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Msg_RegisterController_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(MsgRegisterController)
|
||||
func _Msg_LinkAssertion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(MsgLinkAssertion)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(MsgServer).RegisterController(ctx, in)
|
||||
return srv.(MsgServer).LinkAssertion(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Msg_RegisterController_FullMethodName,
|
||||
FullMethod: Msg_LinkAssertion_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MsgServer).RegisterController(ctx, req.(*MsgRegisterController))
|
||||
return srv.(MsgServer).LinkAssertion(ctx, req.(*MsgLinkAssertion))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Msg_LinkAuthentication_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(MsgLinkAuthentication)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(MsgServer).LinkAuthentication(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Msg_LinkAuthentication_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MsgServer).LinkAuthentication(ctx, req.(*MsgLinkAuthentication))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Msg_UnlinkAssertion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(MsgUnlinkAssertion)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(MsgServer).UnlinkAssertion(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Msg_UnlinkAssertion_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MsgServer).UnlinkAssertion(ctx, req.(*MsgUnlinkAssertion))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Msg_UnlinkAuthentication_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(MsgUnlinkAuthentication)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(MsgServer).UnlinkAuthentication(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Msg_UnlinkAuthentication_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MsgServer).UnlinkAuthentication(ctx, req.(*MsgUnlinkAuthentication))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
@@ -180,8 +283,20 @@ var Msg_ServiceDesc = grpc.ServiceDesc{
|
||||
Handler: _Msg_ExecuteTx_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "RegisterController",
|
||||
Handler: _Msg_RegisterController_Handler,
|
||||
MethodName: "LinkAssertion",
|
||||
Handler: _Msg_LinkAssertion_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "LinkAuthentication",
|
||||
Handler: _Msg_LinkAuthentication_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UnlinkAssertion",
|
||||
Handler: _Msg_UnlinkAssertion_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UnlinkAuthentication",
|
||||
Handler: _Msg_UnlinkAuthentication_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UpdateParams",
|
||||
|
||||
+1479
-98
File diff suppressed because it is too large
Load Diff
@@ -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",
|
||||
}
|
||||
+1696
-1209
File diff suppressed because it is too large
Load Diff
@@ -20,7 +20,8 @@ const _ = grpc.SupportPackageIsVersion7
|
||||
|
||||
const (
|
||||
Query_Params_FullMethodName = "/vault.v1.Query/Params"
|
||||
Query_BuildTx_FullMethodName = "/vault.v1.Query/BuildTx"
|
||||
Query_Schema_FullMethodName = "/vault.v1.Query/Schema"
|
||||
Query_Allocate_FullMethodName = "/vault.v1.Query/Allocate"
|
||||
Query_Sync_FullMethodName = "/vault.v1.Query/Sync"
|
||||
)
|
||||
|
||||
@@ -30,8 +31,12 @@ const (
|
||||
type QueryClient interface {
|
||||
// Params queries all parameters of the module.
|
||||
Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error)
|
||||
// BuildTx builds an unsigned transaction message for the given PKL.
|
||||
BuildTx(ctx context.Context, in *BuildTxRequest, opts ...grpc.CallOption) (*BuildTxResponse, error)
|
||||
// Schema queries the DID document by its id. And returns the required PKL
|
||||
// information
|
||||
Schema(ctx context.Context, in *QuerySchemaRequest, opts ...grpc.CallOption) (*QuerySchemaResponse, error)
|
||||
// Allocate initializes a Target Vault available for claims with a compatible
|
||||
// Authentication mechanism. The default authentication mechanism is WebAuthn.
|
||||
Allocate(ctx context.Context, in *AllocateRequest, opts ...grpc.CallOption) (*AllocateResponse, error)
|
||||
// Sync queries the DID document by its id. And returns the required PKL
|
||||
// information
|
||||
Sync(ctx context.Context, in *SyncRequest, opts ...grpc.CallOption) (*SyncResponse, error)
|
||||
@@ -54,9 +59,18 @@ func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts .
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *queryClient) BuildTx(ctx context.Context, in *BuildTxRequest, opts ...grpc.CallOption) (*BuildTxResponse, error) {
|
||||
out := new(BuildTxResponse)
|
||||
err := c.cc.Invoke(ctx, Query_BuildTx_FullMethodName, in, out, opts...)
|
||||
func (c *queryClient) Schema(ctx context.Context, in *QuerySchemaRequest, opts ...grpc.CallOption) (*QuerySchemaResponse, error) {
|
||||
out := new(QuerySchemaResponse)
|
||||
err := c.cc.Invoke(ctx, Query_Schema_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *queryClient) Allocate(ctx context.Context, in *AllocateRequest, opts ...grpc.CallOption) (*AllocateResponse, error) {
|
||||
out := new(AllocateResponse)
|
||||
err := c.cc.Invoke(ctx, Query_Allocate_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -78,8 +92,12 @@ func (c *queryClient) Sync(ctx context.Context, in *SyncRequest, opts ...grpc.Ca
|
||||
type QueryServer interface {
|
||||
// Params queries all parameters of the module.
|
||||
Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error)
|
||||
// BuildTx builds an unsigned transaction message for the given PKL.
|
||||
BuildTx(context.Context, *BuildTxRequest) (*BuildTxResponse, error)
|
||||
// Schema queries the DID document by its id. And returns the required PKL
|
||||
// information
|
||||
Schema(context.Context, *QuerySchemaRequest) (*QuerySchemaResponse, error)
|
||||
// Allocate initializes a Target Vault available for claims with a compatible
|
||||
// Authentication mechanism. The default authentication mechanism is WebAuthn.
|
||||
Allocate(context.Context, *AllocateRequest) (*AllocateResponse, error)
|
||||
// Sync queries the DID document by its id. And returns the required PKL
|
||||
// information
|
||||
Sync(context.Context, *SyncRequest) (*SyncResponse, error)
|
||||
@@ -93,8 +111,11 @@ type UnimplementedQueryServer struct {
|
||||
func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Params not implemented")
|
||||
}
|
||||
func (UnimplementedQueryServer) BuildTx(context.Context, *BuildTxRequest) (*BuildTxResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method BuildTx not implemented")
|
||||
func (UnimplementedQueryServer) Schema(context.Context, *QuerySchemaRequest) (*QuerySchemaResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Schema not implemented")
|
||||
}
|
||||
func (UnimplementedQueryServer) Allocate(context.Context, *AllocateRequest) (*AllocateResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Allocate not implemented")
|
||||
}
|
||||
func (UnimplementedQueryServer) Sync(context.Context, *SyncRequest) (*SyncResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Sync not implemented")
|
||||
@@ -130,20 +151,38 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Query_BuildTx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(BuildTxRequest)
|
||||
func _Query_Schema_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(QuerySchemaRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(QueryServer).BuildTx(ctx, in)
|
||||
return srv.(QueryServer).Schema(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Query_BuildTx_FullMethodName,
|
||||
FullMethod: Query_Schema_FullMethodName,
|
||||
}
|
||||
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)
|
||||
}
|
||||
|
||||
func _Query_Allocate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(AllocateRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(QueryServer).Allocate(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Query_Allocate_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(QueryServer).Allocate(ctx, req.(*AllocateRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
@@ -178,8 +217,12 @@ var Query_ServiceDesc = grpc.ServiceDesc{
|
||||
Handler: _Query_Params_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "BuildTx",
|
||||
Handler: _Query_BuildTx_Handler,
|
||||
MethodName: "Schema",
|
||||
Handler: _Query_Schema_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "Allocate",
|
||||
Handler: _Query_Allocate_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "Sync",
|
||||
|
||||
+23
-1330
File diff suppressed because it is too large
Load Diff
@@ -19,7 +19,6 @@ import (
|
||||
const _ = grpc.SupportPackageIsVersion7
|
||||
|
||||
const (
|
||||
Msg_AllocateVault_FullMethodName = "/vault.v1.Msg/AllocateVault"
|
||||
Msg_UpdateParams_FullMethodName = "/vault.v1.Msg/UpdateParams"
|
||||
)
|
||||
|
||||
@@ -27,10 +26,6 @@ const (
|
||||
//
|
||||
// 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 {
|
||||
// AllocateVault assembles a sqlite3 database in a local directory and returns
|
||||
// the CID of the database. this operation is called by services initiating a
|
||||
// controller registration.
|
||||
AllocateVault(ctx context.Context, in *MsgAllocateVault, opts ...grpc.CallOption) (*MsgAllocateVaultResponse, error)
|
||||
// UpdateParams defines a governance operation for updating the parameters.
|
||||
//
|
||||
// Since: cosmos-sdk 0.47
|
||||
@@ -45,15 +40,6 @@ func NewMsgClient(cc grpc.ClientConnInterface) MsgClient {
|
||||
return &msgClient{cc}
|
||||
}
|
||||
|
||||
func (c *msgClient) AllocateVault(ctx context.Context, in *MsgAllocateVault, opts ...grpc.CallOption) (*MsgAllocateVaultResponse, error) {
|
||||
out := new(MsgAllocateVaultResponse)
|
||||
err := c.cc.Invoke(ctx, Msg_AllocateVault_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
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...)
|
||||
@@ -67,10 +53,6 @@ func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts
|
||||
// All implementations must embed UnimplementedMsgServer
|
||||
// for forward compatibility
|
||||
type MsgServer interface {
|
||||
// AllocateVault assembles a sqlite3 database in a local directory and returns
|
||||
// the CID of the database. this operation is called by services initiating a
|
||||
// controller registration.
|
||||
AllocateVault(context.Context, *MsgAllocateVault) (*MsgAllocateVaultResponse, error)
|
||||
// UpdateParams defines a governance operation for updating the parameters.
|
||||
//
|
||||
// Since: cosmos-sdk 0.47
|
||||
@@ -82,9 +64,6 @@ type MsgServer interface {
|
||||
type UnimplementedMsgServer struct {
|
||||
}
|
||||
|
||||
func (UnimplementedMsgServer) AllocateVault(context.Context, *MsgAllocateVault) (*MsgAllocateVaultResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method AllocateVault not implemented")
|
||||
}
|
||||
func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented")
|
||||
}
|
||||
@@ -101,24 +80,6 @@ func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) {
|
||||
s.RegisterService(&Msg_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _Msg_AllocateVault_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(MsgAllocateVault)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(MsgServer).AllocateVault(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Msg_AllocateVault_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MsgServer).AllocateVault(ctx, req.(*MsgAllocateVault))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
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 {
|
||||
@@ -144,10 +105,6 @@ var Msg_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "vault.v1.Msg",
|
||||
HandlerType: (*MsgServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "AllocateVault",
|
||||
Handler: _Msg_AllocateVault_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UpdateParams",
|
||||
Handler: _Msg_UpdateParams_Handler,
|
||||
|
||||
+13
-29
@@ -151,9 +151,6 @@ import (
|
||||
macaroon "github.com/onsonr/sonr/x/macaroon"
|
||||
macaroonkeeper "github.com/onsonr/sonr/x/macaroon/keeper"
|
||||
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"
|
||||
servicekeeper "github.com/onsonr/sonr/x/service/keeper"
|
||||
servicetypes "github.com/onsonr/sonr/x/service/types"
|
||||
@@ -241,7 +238,6 @@ type SonrApp struct {
|
||||
VaultKeeper vaultkeeper.Keeper
|
||||
MacaroonKeeper macaroonkeeper.Keeper
|
||||
ServiceKeeper servicekeeper.Keeper
|
||||
OracleKeeper oraclekeeper.Keeper
|
||||
sm *module.SimulationManager
|
||||
BasicModuleManager module.BasicManager
|
||||
ModuleManager *module.Manager
|
||||
@@ -377,7 +373,6 @@ func NewChainApp(
|
||||
vaulttypes.StoreKey,
|
||||
macaroontypes.StoreKey,
|
||||
servicetypes.StoreKey,
|
||||
oracletypes.StoreKey,
|
||||
)
|
||||
|
||||
tkeys := storetypes.NewTransientStoreKeys(paramstypes.TStoreKey)
|
||||
@@ -637,15 +632,6 @@ func NewChainApp(
|
||||
app.StakingKeeper,
|
||||
)
|
||||
|
||||
// Create the vault Keeper
|
||||
app.VaultKeeper = vaultkeeper.NewKeeper(
|
||||
appCodec,
|
||||
sdkruntime.NewKVStoreService(keys[vaulttypes.StoreKey]),
|
||||
logger,
|
||||
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
|
||||
app.AccountKeeper,
|
||||
app.DidKeeper,
|
||||
)
|
||||
// Create the macaroon Keeper
|
||||
app.MacaroonKeeper = macaroonkeeper.NewKeeper(
|
||||
appCodec,
|
||||
@@ -656,6 +642,17 @@ func NewChainApp(
|
||||
app.DidKeeper,
|
||||
)
|
||||
|
||||
// Create the vault Keeper
|
||||
app.VaultKeeper = vaultkeeper.NewKeeper(
|
||||
appCodec,
|
||||
sdkruntime.NewKVStoreService(keys[vaulttypes.StoreKey]),
|
||||
logger,
|
||||
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
|
||||
app.AccountKeeper,
|
||||
app.DidKeeper,
|
||||
app.MacaroonKeeper,
|
||||
)
|
||||
|
||||
// Create the service Keeper
|
||||
app.ServiceKeeper = servicekeeper.NewKeeper(
|
||||
appCodec,
|
||||
@@ -666,14 +663,7 @@ func NewChainApp(
|
||||
app.GroupKeeper,
|
||||
app.MacaroonKeeper,
|
||||
app.NFTKeeper,
|
||||
)
|
||||
|
||||
// Create the oracle Keeper
|
||||
app.OracleKeeper = oraclekeeper.NewKeeper(
|
||||
appCodec,
|
||||
sdkruntime.NewKVStoreService(keys[oracletypes.StoreKey]),
|
||||
logger,
|
||||
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
|
||||
app.VaultKeeper,
|
||||
)
|
||||
|
||||
// Create the globalfee keeper
|
||||
@@ -938,7 +928,6 @@ func NewChainApp(
|
||||
vault.NewAppModule(appCodec, app.VaultKeeper, app.DidKeeper),
|
||||
|
||||
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,
|
||||
@@ -990,7 +979,6 @@ func NewChainApp(
|
||||
vaulttypes.ModuleName,
|
||||
macaroontypes.ModuleName,
|
||||
servicetypes.ModuleName,
|
||||
oracletypes.ModuleName,
|
||||
)
|
||||
|
||||
app.ModuleManager.SetOrderEndBlockers(
|
||||
@@ -1013,7 +1001,6 @@ func NewChainApp(
|
||||
vaulttypes.ModuleName,
|
||||
macaroontypes.ModuleName,
|
||||
servicetypes.ModuleName,
|
||||
oracletypes.ModuleName,
|
||||
)
|
||||
|
||||
// NOTE: The genutils module must occur after staking so that pools are
|
||||
@@ -1045,7 +1032,6 @@ func NewChainApp(
|
||||
vaulttypes.ModuleName,
|
||||
macaroontypes.ModuleName,
|
||||
servicetypes.ModuleName,
|
||||
oracletypes.ModuleName,
|
||||
}
|
||||
app.ModuleManager.SetOrderInitGenesis(genesisModuleOrder...)
|
||||
app.ModuleManager.SetOrderExportGenesis(genesisModuleOrder...)
|
||||
@@ -1204,8 +1190,7 @@ func GetDefaultBypassFeeMessages() []string {
|
||||
sdk.MsgTypeURL(&ibcchanneltypes.MsgChannelOpenTry{}),
|
||||
sdk.MsgTypeURL(&ibcchanneltypes.MsgChannelOpenConfirm{}),
|
||||
sdk.MsgTypeURL(&ibcchanneltypes.MsgChannelOpenAck{}),
|
||||
sdk.MsgTypeURL(&vaulttypes.MsgAllocateVault{}),
|
||||
sdk.MsgTypeURL(&didtypes.MsgRegisterController{}),
|
||||
sdk.MsgTypeURL(&didtypes.MsgLinkAuthentication{}),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1508,7 +1493,6 @@ func initParamsKeeper(
|
||||
paramsKeeper.Subspace(vaulttypes.ModuleName)
|
||||
paramsKeeper.Subspace(macaroontypes.ModuleName)
|
||||
paramsKeeper.Subspace(servicetypes.ModuleName)
|
||||
paramsKeeper.Subspace(oracletypes.ModuleName)
|
||||
|
||||
return paramsKeeper
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
Executable
BIN
Binary file not shown.
@@ -1,10 +0,0 @@
|
||||
package commands
|
||||
|
||||
import "github.com/spf13/cobra"
|
||||
|
||||
func NewRootCmd() *cobra.Command {
|
||||
return &cobra.Command{
|
||||
Use: "motr",
|
||||
Short: "Manage a local DWN instance for the Sonr blockchain",
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package commands
|
||||
|
||||
import (
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/onsonr/sonr/cmd/hway/server"
|
||||
)
|
||||
|
||||
func NewStartCmd() *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) {
|
||||
s := server.New()
|
||||
s.Start()
|
||||
},
|
||||
}
|
||||
}
|
||||
+11
-6
@@ -1,13 +1,18 @@
|
||||
//go:build js && wasm
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/onsonr/sonr/cmd/hway/commands"
|
||||
"github.com/labstack/echo/v4"
|
||||
"github.com/onsonr/sonr/internal/ctx"
|
||||
"github.com/onsonr/sonr/pkg/workers/routes"
|
||||
"github.com/syumai/workers"
|
||||
)
|
||||
|
||||
func main() {
|
||||
rootCmd := commands.NewRootCmd()
|
||||
rootCmd.AddCommand(commands.NewStartCmd())
|
||||
if err := rootCmd.Execute(); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
s := echo.New()
|
||||
s.Use(ctx.HighwaySessionMiddleware)
|
||||
routes.RegisterGatewayViews(s)
|
||||
routes.RegisterGatewayAPI(s)
|
||||
workers.Serve(s)
|
||||
}
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
package handlers
|
||||
@@ -1 +0,0 @@
|
||||
package handlers
|
||||
@@ -1,40 +0,0 @@
|
||||
package server
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/labstack/echo/v4"
|
||||
"github.com/labstack/gommon/log"
|
||||
|
||||
"github.com/onsonr/sonr/internal/session"
|
||||
"github.com/onsonr/sonr/pkg/nebula"
|
||||
"github.com/onsonr/sonr/pkg/nebula/pages"
|
||||
)
|
||||
|
||||
type Server struct {
|
||||
*echo.Echo
|
||||
}
|
||||
|
||||
func New() *Server {
|
||||
s := &Server{Echo: echo.New()}
|
||||
s.Logger.SetLevel(log.INFO)
|
||||
s.Use(session.UseSession)
|
||||
|
||||
// Configure the server
|
||||
if err := nebula.UseAssets(s.Echo); err != nil {
|
||||
s.Logger.Fatal(err)
|
||||
}
|
||||
|
||||
s.GET("/", pages.Home)
|
||||
s.GET("/login", pages.Login)
|
||||
s.GET("/register", pages.Register)
|
||||
s.GET("/profile", pages.Profile)
|
||||
|
||||
return s
|
||||
}
|
||||
|
||||
func (s *Server) Start() {
|
||||
if err := s.Echo.Start(":1323"); err != http.ErrServerClosed {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
name = "sonr-id"
|
||||
main = "./build/worker.mjs"
|
||||
compatibility_date = "2024-10-07"
|
||||
|
||||
routes = [{ pattern = "sonr.id", custom_domain = true }]
|
||||
|
||||
[build]
|
||||
command = "task hway:build"
|
||||
@@ -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,23 +0,0 @@
|
||||
package state
|
||||
|
||||
import (
|
||||
"github.com/labstack/echo/v4"
|
||||
)
|
||||
|
||||
func GrantAuthorization(e echo.Context) error {
|
||||
// Implement authorization endpoint using passkey authentication
|
||||
// Store session data in cache
|
||||
return nil
|
||||
}
|
||||
|
||||
func GetJWKS(e echo.Context) error {
|
||||
// Implement token endpoint
|
||||
// Use cached session data for validation
|
||||
return nil
|
||||
}
|
||||
|
||||
func GetToken(e echo.Context) error {
|
||||
// Implement token endpoint
|
||||
// Use cached session data for validation
|
||||
return nil
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
package state
|
||||
@@ -9,14 +9,12 @@ import (
|
||||
|
||||
"github.com/onsonr/sonr/app"
|
||||
"github.com/onsonr/sonr/app/cli"
|
||||
"github.com/onsonr/sonr/app/proxy"
|
||||
)
|
||||
|
||||
func main() {
|
||||
rootCmd := NewRootCmd()
|
||||
rootCmd.AddCommand(cli.NewBuildTxnTUICmd())
|
||||
rootCmd.AddCommand(cli.NewExplorerTUICmd())
|
||||
rootCmd.AddCommand(proxy.NewProxyCmd())
|
||||
|
||||
if err := svrcmd.Execute(rootCmd, "", app.DefaultNodeHome); err != nil {
|
||||
log.NewLogger(rootCmd.OutOrStderr()).Error("failure when running app", "err", err)
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -1,35 +0,0 @@
|
||||
version: "0.6"
|
||||
|
||||
processes:
|
||||
ipfs:
|
||||
namespace: testnet
|
||||
command: "sh scripts/setup_ipfs.sh"
|
||||
background: true
|
||||
availability:
|
||||
restart: on_failure
|
||||
max_restarts: 0
|
||||
|
||||
sonr:
|
||||
namespace: testnet
|
||||
command: "devbox run start:testnet"
|
||||
restart: on_failure
|
||||
max_restarts: 1
|
||||
depends:
|
||||
- ipfs
|
||||
|
||||
hway:
|
||||
namespace: testnet
|
||||
command: "devbox run start:hway"
|
||||
restart: on_failure
|
||||
max_restarts: 1
|
||||
depends:
|
||||
- ipfs
|
||||
- sonr
|
||||
|
||||
tunnel:
|
||||
namespace: public
|
||||
command: "cloudflared tunnel run --token $TUNNEL_TOKEN"
|
||||
restart: on_failure
|
||||
max_restarts: 1
|
||||
depends:
|
||||
- caddy
|
||||
@@ -1,3 +0,0 @@
|
||||
FROM scratch
|
||||
ENTRYPOINT ["/hway"]
|
||||
COPY hway /
|
||||
@@ -1,3 +0,0 @@
|
||||
FROM scratch
|
||||
ENTRYPOINT ["/sonrd"]
|
||||
COPY sonrd /
|
||||
@@ -1,37 +0,0 @@
|
||||
# This file is used to create docker images using the heighliner binary.
|
||||
# see: https://github.com/strangelove-ventures/heighliner
|
||||
|
||||
# Sonr Node - Identity
|
||||
- name: sonr
|
||||
github-organization: onsonr
|
||||
github-repo: sonr
|
||||
dockerfile: cosmos
|
||||
build-target: make install
|
||||
binaries:
|
||||
- /go/bin/sonrd
|
||||
build-env:
|
||||
- LEDGER_ENABLED=false
|
||||
- BUILD_TAGS=muslc
|
||||
|
||||
# Ethereum Node - Web3
|
||||
- name: evmos
|
||||
github-organization: tharsis
|
||||
github-repo: evmos
|
||||
dockerfile: cosmos
|
||||
build-target: make install
|
||||
binaries:
|
||||
- /go/bin/evmosd
|
||||
|
||||
# Bitcoin Node - Gold
|
||||
- name: nomic
|
||||
github-organization: nomic-io
|
||||
github-repo: nomic
|
||||
dockerfile: cargo
|
||||
build-target: |
|
||||
TOOLCHAIN=$(cat rust-toolchain.toml | grep channel | awk '{print $3}' | tr -d '"')
|
||||
rustup component add rust-src --toolchain ${TOOLCHAIN}-$(uname -m)-unknown-linux-gnu
|
||||
cargo install --locked --path . -Zbuild-std
|
||||
binaries:
|
||||
- /build/nomic/target/${ARCH}-unknown-linux-gnu/release/nomic
|
||||
platforms:
|
||||
- linux/amd64
|
||||
@@ -1,92 +0,0 @@
|
||||
{
|
||||
"$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.12.0/.schema/devbox.schema.json",
|
||||
"packages": [
|
||||
"go@1.22",
|
||||
"air@latest",
|
||||
"bun@latest",
|
||||
"ipfs@latest",
|
||||
"skate@latest",
|
||||
"cloudflared@latest",
|
||||
"process-compose@latest"
|
||||
],
|
||||
"env": {
|
||||
"GOPATH": "$HOME/go",
|
||||
"PATH": "$HOME/go/bin:$PATH",
|
||||
"CHAIN_ID": "sonr-testnet-1",
|
||||
"DENOM": "usnr",
|
||||
"KEYRING": "test",
|
||||
"MONIKER": "florence",
|
||||
"BINARY": "sonrd",
|
||||
"ACC0_NAME": "acc0",
|
||||
"ACC1_NAME": "acc1",
|
||||
"ACC0_ADDRESS": "idx1efd63aw40lxf3n4mhf7dzhjkr453axur9vjt6y",
|
||||
"ACC1_ADDRESS": "idx1hj5fveer5cjtn4wd6wstzugjfdxzl0xpecp0nd",
|
||||
"ACC0_MNEMONIC": "$(skate get ACC0_MNEMONIC)",
|
||||
"ACC1_MNEMONIC": "$(skate get ACC1_MNEMONIC)",
|
||||
"TUNNEL_TOKEN": "$(skate get CLOUDFLARE_TUNNEL_TOKEN)",
|
||||
"TEMPL_EXPERIMENT": "rawgo"
|
||||
},
|
||||
"shell": {
|
||||
"scripts": {
|
||||
"dev": [
|
||||
"air"
|
||||
],
|
||||
"build:docker": [
|
||||
"make local-image"
|
||||
],
|
||||
"build:motr": [
|
||||
"make nebula",
|
||||
"make motr"
|
||||
],
|
||||
"build:nebula": [
|
||||
"make nebula"
|
||||
],
|
||||
"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"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
@@ -1,36 +0,0 @@
|
||||
version: "0.6"
|
||||
|
||||
processes:
|
||||
ipfs:
|
||||
namespace: testnet
|
||||
command: "sh scripts/setup_ipfs.sh"
|
||||
background: true
|
||||
availability:
|
||||
restart: on_failure
|
||||
max_restarts: 0
|
||||
|
||||
sonr:
|
||||
namespace: testnet
|
||||
command: "devbox run start:testnet"
|
||||
restart: on_failure
|
||||
env:
|
||||
max_restarts: 1
|
||||
depends:
|
||||
- ipfs
|
||||
|
||||
hway:
|
||||
namespace: testnet
|
||||
command: "hway start"
|
||||
restart: on_failure
|
||||
max_restarts: 1
|
||||
depends:
|
||||
- ipfs
|
||||
- sonr
|
||||
|
||||
tunnel:
|
||||
namespace: public
|
||||
command: "cloudflared tunnel run --token $TUNNEL_TOKEN"
|
||||
restart: on_failure
|
||||
max_restarts: 1
|
||||
depends:
|
||||
- caddy
|
||||
+5
-38
@@ -2,14 +2,9 @@
|
||||
"$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.12.0/.schema/devbox.schema.json",
|
||||
"packages": [
|
||||
"go@1.22",
|
||||
"air@latest",
|
||||
"bun@latest",
|
||||
"gum@latest",
|
||||
"ipfs@latest",
|
||||
"skate@latest",
|
||||
"templ@latest",
|
||||
"cloudflared@latest",
|
||||
"process-compose@latest"
|
||||
"templ@latest"
|
||||
],
|
||||
"env": {
|
||||
"GOPATH": "$HOME/go",
|
||||
@@ -30,45 +25,17 @@
|
||||
},
|
||||
"shell": {
|
||||
"scripts": {
|
||||
"dev": [
|
||||
"air"
|
||||
],
|
||||
"build:docker": [
|
||||
"make local-image"
|
||||
],
|
||||
"build:hway": [
|
||||
"make nebula",
|
||||
"make hway"
|
||||
],
|
||||
"build:nebula": [
|
||||
"make nebula"
|
||||
],
|
||||
"build:motr": [
|
||||
"make motr"
|
||||
],
|
||||
"build:sonrd": [
|
||||
"make motr",
|
||||
"make build"
|
||||
],
|
||||
"build": [
|
||||
"make motr",
|
||||
"make build",
|
||||
"make hway"
|
||||
],
|
||||
"gen:proto": [
|
||||
"make proto-gen"
|
||||
],
|
||||
"gen:pkl": [
|
||||
"make pkl"
|
||||
"make gen-pkl"
|
||||
],
|
||||
"gen:templ": [
|
||||
"make templ"
|
||||
"make gen-templ"
|
||||
],
|
||||
"start": [
|
||||
"process-compose up -f ./deploy/testnet/process-compose.yaml"
|
||||
"process-compose up -f ./deploy/process-compose.yaml"
|
||||
],
|
||||
"stop": [
|
||||
"process-compose down -f ./deploy/testnet/process-compose.yaml"
|
||||
"process-compose down -f ./deploy/process-compose.yaml"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
-240
@@ -1,54 +1,6 @@
|
||||
{
|
||||
"lockfile_version": "1",
|
||||
"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": {
|
||||
"last_modified": "2024-09-20T22:35:44Z",
|
||||
"resolved": "github:NixOS/nixpkgs/a1d92660c6b3b7c26fb883500a80ea9d33321be2#bun",
|
||||
@@ -97,54 +49,6 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"cloudflared@latest": {
|
||||
"last_modified": "2024-09-10T15:01:03Z",
|
||||
"resolved": "github:NixOS/nixpkgs/5ed627539ac84809c78b2dd6d26a5cebeb5ae269#cloudflared",
|
||||
"source": "devbox-search",
|
||||
"version": "2024.8.3",
|
||||
"systems": {
|
||||
"aarch64-darwin": {
|
||||
"outputs": [
|
||||
{
|
||||
"name": "out",
|
||||
"path": "/nix/store/nmmh1dx4rvqayxq31c99gxpbwvcchx9w-cloudflared-2024.8.3",
|
||||
"default": true
|
||||
}
|
||||
],
|
||||
"store_path": "/nix/store/nmmh1dx4rvqayxq31c99gxpbwvcchx9w-cloudflared-2024.8.3"
|
||||
},
|
||||
"aarch64-linux": {
|
||||
"outputs": [
|
||||
{
|
||||
"name": "out",
|
||||
"path": "/nix/store/kwikn13v0rddmr8kjhnj67li8aq8qwa6-cloudflared-2024.8.3",
|
||||
"default": true
|
||||
}
|
||||
],
|
||||
"store_path": "/nix/store/kwikn13v0rddmr8kjhnj67li8aq8qwa6-cloudflared-2024.8.3"
|
||||
},
|
||||
"x86_64-darwin": {
|
||||
"outputs": [
|
||||
{
|
||||
"name": "out",
|
||||
"path": "/nix/store/9630bavr6jb44g0pcwwqn0zpgin39dc7-cloudflared-2024.8.3",
|
||||
"default": true
|
||||
}
|
||||
],
|
||||
"store_path": "/nix/store/9630bavr6jb44g0pcwwqn0zpgin39dc7-cloudflared-2024.8.3"
|
||||
},
|
||||
"x86_64-linux": {
|
||||
"outputs": [
|
||||
{
|
||||
"name": "out",
|
||||
"path": "/nix/store/hybva7brncispiqm6f0qrpn897r3y3ja-cloudflared-2024.8.3",
|
||||
"default": true
|
||||
}
|
||||
],
|
||||
"store_path": "/nix/store/hybva7brncispiqm6f0qrpn897r3y3ja-cloudflared-2024.8.3"
|
||||
}
|
||||
}
|
||||
},
|
||||
"go@1.22": {
|
||||
"last_modified": "2024-09-12T11:58:09Z",
|
||||
"resolved": "github:NixOS/nixpkgs/280db3decab4cbeb22a4599bd472229ab74d25e1#go",
|
||||
@@ -193,156 +97,12 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"gum@latest": {
|
||||
"last_modified": "2024-09-10T15:01:03Z",
|
||||
"resolved": "github:NixOS/nixpkgs/5ed627539ac84809c78b2dd6d26a5cebeb5ae269#gum",
|
||||
"source": "devbox-search",
|
||||
"version": "0.14.5",
|
||||
"systems": {
|
||||
"aarch64-darwin": {
|
||||
"outputs": [
|
||||
{
|
||||
"name": "out",
|
||||
"path": "/nix/store/n1gqffrwdzr3vpsmwmwx3hmw814c1k6g-gum-0.14.5",
|
||||
"default": true
|
||||
}
|
||||
],
|
||||
"store_path": "/nix/store/n1gqffrwdzr3vpsmwmwx3hmw814c1k6g-gum-0.14.5"
|
||||
},
|
||||
"aarch64-linux": {
|
||||
"outputs": [
|
||||
{
|
||||
"name": "out",
|
||||
"path": "/nix/store/ggp10jr3l6higs0gqibp6ypjlf7yakpc-gum-0.14.5",
|
||||
"default": true
|
||||
}
|
||||
],
|
||||
"store_path": "/nix/store/ggp10jr3l6higs0gqibp6ypjlf7yakpc-gum-0.14.5"
|
||||
},
|
||||
"x86_64-darwin": {
|
||||
"outputs": [
|
||||
{
|
||||
"name": "out",
|
||||
"path": "/nix/store/jq8shghha81s1wg67fcjrfnf4hbliimn-gum-0.14.5",
|
||||
"default": true
|
||||
}
|
||||
],
|
||||
"store_path": "/nix/store/jq8shghha81s1wg67fcjrfnf4hbliimn-gum-0.14.5"
|
||||
},
|
||||
"x86_64-linux": {
|
||||
"outputs": [
|
||||
{
|
||||
"name": "out",
|
||||
"path": "/nix/store/f199acwir08z47f3d5kf1fhmhajmd1ig-gum-0.14.5",
|
||||
"default": true
|
||||
}
|
||||
],
|
||||
"store_path": "/nix/store/f199acwir08z47f3d5kf1fhmhajmd1ig-gum-0.14.5"
|
||||
}
|
||||
}
|
||||
},
|
||||
"ipfs@latest": {
|
||||
"last_modified": "2023-02-24T09:01:09Z",
|
||||
"resolved": "github:NixOS/nixpkgs/7d0ed7f2e5aea07ab22ccb338d27fbe347ed2f11#ipfs",
|
||||
"source": "devbox-search",
|
||||
"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": {
|
||||
"last_modified": "2024-09-10T15:01:03Z",
|
||||
"resolved": "github:NixOS/nixpkgs/5ed627539ac84809c78b2dd6d26a5cebeb5ae269#skate",
|
||||
"source": "devbox-search",
|
||||
"version": "1.0.0",
|
||||
"systems": {
|
||||
"aarch64-darwin": {
|
||||
"outputs": [
|
||||
{
|
||||
"name": "out",
|
||||
"path": "/nix/store/5hn4s18zy08inhimckf3794zszxjn077-skate-1.0.0",
|
||||
"default": true
|
||||
}
|
||||
],
|
||||
"store_path": "/nix/store/5hn4s18zy08inhimckf3794zszxjn077-skate-1.0.0"
|
||||
},
|
||||
"aarch64-linux": {
|
||||
"outputs": [
|
||||
{
|
||||
"name": "out",
|
||||
"path": "/nix/store/jxwx4fn5qbaz2nan3gmpydqx6vv8ldp1-skate-1.0.0",
|
||||
"default": true
|
||||
}
|
||||
],
|
||||
"store_path": "/nix/store/jxwx4fn5qbaz2nan3gmpydqx6vv8ldp1-skate-1.0.0"
|
||||
},
|
||||
"x86_64-darwin": {
|
||||
"outputs": [
|
||||
{
|
||||
"name": "out",
|
||||
"path": "/nix/store/zs6ik66kpz9q8mdmzxqmgjv51y39r76h-skate-1.0.0",
|
||||
"default": true
|
||||
}
|
||||
],
|
||||
"store_path": "/nix/store/zs6ik66kpz9q8mdmzxqmgjv51y39r76h-skate-1.0.0"
|
||||
},
|
||||
"x86_64-linux": {
|
||||
"outputs": [
|
||||
{
|
||||
"name": "out",
|
||||
"path": "/nix/store/6zbyhj72wh0645lj6b9c392aqqg11a84-skate-1.0.0",
|
||||
"default": true
|
||||
}
|
||||
],
|
||||
"store_path": "/nix/store/6zbyhj72wh0645lj6b9c392aqqg11a84-skate-1.0.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"templ@latest": {
|
||||
"last_modified": "2024-09-10T15:01:03Z",
|
||||
"resolved": "github:NixOS/nixpkgs/5ed627539ac84809c78b2dd6d26a5cebeb5ae269#templ",
|
||||
|
||||
@@ -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
|
||||
@@ -1,6 +1,8 @@
|
||||
module github.com/onsonr/sonr
|
||||
|
||||
go 1.22.5
|
||||
go 1.23
|
||||
|
||||
toolchain go1.23.1
|
||||
|
||||
// overrides
|
||||
replace (
|
||||
@@ -44,7 +46,7 @@ require (
|
||||
cosmossdk.io/x/evidence v0.1.0
|
||||
cosmossdk.io/x/feegrant v0.1.0
|
||||
cosmossdk.io/x/nft v0.1.0
|
||||
cosmossdk.io/x/tx v0.13.3
|
||||
cosmossdk.io/x/tx v0.13.5
|
||||
cosmossdk.io/x/upgrade v0.1.1
|
||||
github.com/a-h/templ v0.2.778
|
||||
github.com/apple/pkl-go v0.8.0
|
||||
@@ -56,11 +58,10 @@ require (
|
||||
github.com/cosmos/cosmos-db v1.0.2
|
||||
github.com/cosmos/cosmos-proto v1.0.0-beta.5
|
||||
github.com/cosmos/cosmos-sdk v0.50.5
|
||||
github.com/cosmos/gogoproto v1.4.12
|
||||
github.com/cosmos/gogoproto v1.7.0
|
||||
github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8 v8.0.2-0.20240228211029-91e486ec4dbb
|
||||
github.com/cosmos/ibc-go/modules/capability v1.0.0
|
||||
github.com/cosmos/ibc-go/v8 v8.2.0
|
||||
github.com/donseba/go-htmx v1.10.0
|
||||
github.com/ethereum/go-ethereum v1.14.6
|
||||
github.com/go-webauthn/webauthn v0.10.2
|
||||
github.com/golang/protobuf v1.5.4
|
||||
@@ -70,9 +71,8 @@ require (
|
||||
github.com/ipfs/kubo v0.29.0
|
||||
github.com/joho/godotenv v1.5.1
|
||||
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/onsonr/crypto v1.32.0
|
||||
github.com/onsonr/crypto v1.33.0
|
||||
github.com/segmentio/ksuid v1.0.4
|
||||
github.com/spf13/cast v1.6.0
|
||||
github.com/spf13/cobra v1.8.0
|
||||
@@ -82,6 +82,7 @@ require (
|
||||
github.com/strangelove-ventures/poa v0.50.0
|
||||
github.com/strangelove-ventures/tokenfactory v0.50.0
|
||||
github.com/stretchr/testify v1.9.0
|
||||
github.com/syumai/workers v0.26.3
|
||||
golang.org/x/crypto v0.26.0
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20240617180043-68d350f18fd4
|
||||
google.golang.org/grpc v1.64.0
|
||||
@@ -232,6 +233,7 @@ require (
|
||||
github.com/klauspost/cpuid/v2 v2.2.8 // indirect
|
||||
github.com/kr/pretty v0.3.1 // 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/libp2p/go-buffer-pool v0.1.0 // indirect
|
||||
github.com/libp2p/go-cidranger v1.1.0 // indirect
|
||||
|
||||
@@ -794,8 +794,8 @@ cosmossdk.io/x/feegrant v0.1.0 h1:c7s3oAq/8/UO0EiN1H5BIjwVntujVTkYs35YPvvrdQk=
|
||||
cosmossdk.io/x/feegrant v0.1.0/go.mod h1:4r+FsViJRpcZif/yhTn+E0E6OFfg4n0Lx+6cCtnZElU=
|
||||
cosmossdk.io/x/nft v0.1.0 h1:VhcsFiEK33ODN27kxKLa0r/CeFd8laBfbDBwYqCyYCM=
|
||||
cosmossdk.io/x/nft v0.1.0/go.mod h1:ec4j4QAO4mJZ+45jeYRnW7awLHby1JZANqe1hNZ4S3g=
|
||||
cosmossdk.io/x/tx v0.13.3 h1:Ha4mNaHmxBc6RMun9aKuqul8yHiL78EKJQ8g23Zf73g=
|
||||
cosmossdk.io/x/tx v0.13.3/go.mod h1:I8xaHv0rhUdIvIdptKIqzYy27+n2+zBVaxO6fscFhys=
|
||||
cosmossdk.io/x/tx v0.13.5 h1:FdnU+MdmFWn1pTsbfU0OCf2u6mJ8cqc1H4OMG418MLw=
|
||||
cosmossdk.io/x/tx v0.13.5/go.mod h1:V6DImnwJMTq5qFjeGWpXNiT/fjgE4HtmclRmTqRVM3w=
|
||||
cosmossdk.io/x/upgrade v0.1.1 h1:aoPe2gNvH+Gwt/Pgq3dOxxQVU3j5P6Xf+DaUJTDZATc=
|
||||
cosmossdk.io/x/upgrade v0.1.1/go.mod h1:MNLptLPcIFK9CWt7Ra//8WUZAxweyRDNcbs5nkOcQy0=
|
||||
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
|
||||
@@ -1024,8 +1024,8 @@ github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4x
|
||||
github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE=
|
||||
github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI=
|
||||
github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU=
|
||||
github.com/cosmos/gogoproto v1.4.12 h1:vB6Lbe/rtnYGjQuFxkPiPYiCybqFT8QvLipDZP8JpFE=
|
||||
github.com/cosmos/gogoproto v1.4.12/go.mod h1:LnZob1bXRdUoqMMtwYlcR3wjiElmlC+FkjaZRv1/eLY=
|
||||
github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro=
|
||||
github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0=
|
||||
github.com/cosmos/iavl v1.1.2 h1:zL9FK7C4L/P4IF1Dm5fIwz0WXCnn7Bp1M2FxH0ayM7Y=
|
||||
github.com/cosmos/iavl v1.1.2/go.mod h1:jLeUvm6bGT1YutCaL2fIar/8vGUE8cPZvh/gXEWDaDM=
|
||||
github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8 v8.0.2-0.20240228211029-91e486ec4dbb h1:jcSPWsQTcbpQcFKmZppgD37GIXAzvFmYRH4E6kxPBFQ=
|
||||
@@ -1091,8 +1091,6 @@ github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5Xh
|
||||
github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4=
|
||||
github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
|
||||
github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE=
|
||||
github.com/donseba/go-htmx v1.10.0 h1:ByeQd8frMPSX38vkjvsprSQ7+xTkHMDrkzBV0ljfYvA=
|
||||
github.com/donseba/go-htmx v1.10.0/go.mod h1:8PTAYvNKf8+QYis+DpAsggKz+sa2qljtMgvdAeNBh5s=
|
||||
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
|
||||
github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
|
||||
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
|
||||
@@ -1831,8 +1829,8 @@ github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7J
|
||||
github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
|
||||
github.com/onsi/gomega v1.33.1 h1:dsYjIxxSR755MDmKVsaFQTE22ChNBcuuTWgkUDSubOk=
|
||||
github.com/onsi/gomega v1.33.1/go.mod h1:U4R44UsT+9eLIaYRB2a5qajjtQYn0hauxvRm16AVYg0=
|
||||
github.com/onsonr/crypto v1.32.0 h1:3XxItjoYg4vLuTU7uvpbIl/MTk2tb6L43SSO9RFcEXc=
|
||||
github.com/onsonr/crypto v1.32.0/go.mod h1:NSfeCO6XoyQeSDEp6Jy42UGG5047GvzG6lW9lRnjrR0=
|
||||
github.com/onsonr/crypto v1.33.0 h1:K0KgEQXrzppw/nPXn1swY1a7oUmMdQGcLycuipoqjqM=
|
||||
github.com/onsonr/crypto v1.33.0/go.mod h1:NSfeCO6XoyQeSDEp6Jy42UGG5047GvzG6lW9lRnjrR0=
|
||||
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
|
||||
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
|
||||
github.com/opencontainers/image-spec v1.1.0-rc5 h1:Ygwkfw9bpDvs+c9E34SdgGOj41dX/cbdlwvlWt0pnFI=
|
||||
@@ -2048,6 +2046,8 @@ github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8
|
||||
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/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/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME=
|
||||
github.com/tidwall/btree v1.7.0 h1:L1fkJH/AuEh5zBnnBbmTwQ5Lt+bRJ5A8EWecslvo9iI=
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
package auth
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/labstack/echo/v4"
|
||||
"gopkg.in/macaroon.v2"
|
||||
)
|
||||
|
||||
func MacaroonMiddleware(secretKeyStr string, location string) echo.MiddlewareFunc {
|
||||
secretKey := []byte(secretKeyStr)
|
||||
return func(next echo.HandlerFunc) echo.HandlerFunc {
|
||||
return func(c echo.Context) error {
|
||||
// Extract the macaroon from the Authorization header
|
||||
auth := c.Request().Header.Get("Authorization")
|
||||
if auth == "" {
|
||||
return c.JSON(http.StatusUnauthorized, map[string]string{"error": "Missing Authorization header"})
|
||||
}
|
||||
|
||||
// Decode the macaroon
|
||||
mac, err := macaroon.Base64Decode([]byte(auth))
|
||||
if err != nil {
|
||||
return c.JSON(http.StatusBadRequest, map[string]string{"error": "Invalid macaroon encoding"})
|
||||
}
|
||||
|
||||
token, err := macaroon.New(secretKey, mac, location, macaroon.LatestVersion)
|
||||
if err != nil {
|
||||
return c.JSON(http.StatusBadRequest, map[string]string{"error": "Invalid macaroon"})
|
||||
}
|
||||
|
||||
// Verify the macaroon
|
||||
err = token.Verify(secretKey, func(caveat string) error {
|
||||
for _, c := range MacroonCaveats {
|
||||
if c.String() == caveat {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
return nil // Return nil if the caveat is valid
|
||||
}, nil)
|
||||
if err != nil {
|
||||
return c.JSON(http.StatusUnauthorized, map[string]string{"error": "Invalid macaroon"})
|
||||
}
|
||||
|
||||
// Macaroon is valid, proceed to the next handler
|
||||
return next(c)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package ctx
|
||||
|
||||
import (
|
||||
"github.com/labstack/echo/v4"
|
||||
"github.com/segmentio/ksuid"
|
||||
)
|
||||
|
||||
type CookieKey string
|
||||
|
||||
const (
|
||||
CookieKeySessionID CookieKey = "session.id"
|
||||
CookieKeySonrAddr CookieKey = "sonr.addr"
|
||||
CookieKeySonrDID CookieKey = "sonr.did"
|
||||
CookieKeyVaultCID CookieKey = "vault.cid"
|
||||
CookieKeyVaultSchema CookieKey = "vault.schema"
|
||||
)
|
||||
|
||||
func (c CookieKey) String() string {
|
||||
return string(c)
|
||||
}
|
||||
|
||||
func GetSessionID(c echo.Context) string {
|
||||
// Attempt to read the session ID from the "session" cookie
|
||||
sessionID, err := ReadCookie(c, CookieKeySessionID)
|
||||
if err != nil {
|
||||
// Generate a new KSUID if the session cookie is missing or invalid
|
||||
WriteCookie(c, CookieKeySessionID, ksuid.New().String())
|
||||
}
|
||||
return sessionID
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
package ctx
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
|
||||
"github.com/labstack/echo/v4"
|
||||
dwngen "github.com/onsonr/sonr/internal/dwn/gen"
|
||||
)
|
||||
|
||||
type DWNContext struct {
|
||||
echo.Context
|
||||
|
||||
// Defaults
|
||||
id string // Generated ksuid http cookie; Initialized on first request
|
||||
}
|
||||
|
||||
func (s *DWNContext) HasAuthorization() bool {
|
||||
v := ReadHeader(s.Context, HeaderAuthorization)
|
||||
return v != ""
|
||||
}
|
||||
|
||||
func (s *DWNContext) ID() string {
|
||||
return s.id
|
||||
}
|
||||
|
||||
func (s *DWNContext) Address() string {
|
||||
v, err := ReadCookie(s.Context, CookieKeySonrAddr)
|
||||
if err != nil {
|
||||
return ""
|
||||
}
|
||||
return v
|
||||
}
|
||||
|
||||
func (s *DWNContext) IPFSGatewayURL() string {
|
||||
return ReadHeader(s.Context, HeaderIPFSGatewayURL)
|
||||
}
|
||||
|
||||
func (s *DWNContext) ChainID() string {
|
||||
return ReadHeader(s.Context, HeaderSonrChainID)
|
||||
}
|
||||
|
||||
func (s *DWNContext) Schema() *dwngen.Schema {
|
||||
v, err := ReadCookie(s.Context, CookieKeyVaultSchema)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
var schema dwngen.Schema
|
||||
err = json.Unmarshal([]byte(v), &schema)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
return &schema
|
||||
}
|
||||
|
||||
func GetDWNContext(c echo.Context) (*DWNContext, error) {
|
||||
ctx, ok := c.(*DWNContext)
|
||||
if !ok {
|
||||
return nil, echo.NewHTTPError(http.StatusInternalServerError, "DWN Context not found")
|
||||
}
|
||||
return ctx, nil
|
||||
}
|
||||
|
||||
// HighwaySessionMiddleware establishes a Session Cookie.
|
||||
func DWNSessionMiddleware(config *dwngen.Config) echo.MiddlewareFunc {
|
||||
return func(next echo.HandlerFunc) echo.HandlerFunc {
|
||||
return func(c echo.Context) error {
|
||||
sessionID := GetSessionID(c)
|
||||
injectConfig(c, config)
|
||||
cc := &DWNContext{
|
||||
Context: c,
|
||||
id: sessionID,
|
||||
}
|
||||
return next(cc)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package ctx
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/labstack/echo/v4"
|
||||
)
|
||||
|
||||
type HwayContext struct {
|
||||
echo.Context
|
||||
|
||||
// Defaults
|
||||
id string // Generated ksuid http cookie; Initialized on first request
|
||||
}
|
||||
|
||||
func (s *HwayContext) ID() string {
|
||||
return s.id
|
||||
}
|
||||
|
||||
func GetHWAYContext(c echo.Context) (*HwayContext, error) {
|
||||
ctx, ok := c.(*HwayContext)
|
||||
if !ok {
|
||||
return nil, echo.NewHTTPError(http.StatusInternalServerError, "Highway Context not found")
|
||||
}
|
||||
return ctx, nil
|
||||
}
|
||||
|
||||
// HighwaySessionMiddleware establishes a Session Cookie.
|
||||
func HighwaySessionMiddleware(next echo.HandlerFunc) echo.HandlerFunc {
|
||||
return func(c echo.Context) error {
|
||||
sessionID := GetSessionID(c)
|
||||
cc := &HwayContext{
|
||||
Context: c,
|
||||
id: sessionID,
|
||||
}
|
||||
return next(cc)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package ctx
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/labstack/echo/v4"
|
||||
dwngen "github.com/onsonr/sonr/internal/dwn/gen"
|
||||
)
|
||||
|
||||
type HeaderKey string
|
||||
|
||||
const (
|
||||
HeaderAuthorization HeaderKey = "Authorization"
|
||||
|
||||
HeaderIPFSGatewayURL HeaderKey = "X-IPFS-Gateway"
|
||||
HeaderSonrChainID HeaderKey = "X-Sonr-ChainID"
|
||||
HeaderSonrKeyshare HeaderKey = "X-Sonr-Keyshare"
|
||||
)
|
||||
|
||||
func (h HeaderKey) String() string {
|
||||
return string(h)
|
||||
}
|
||||
|
||||
func injectConfig(c echo.Context, config *dwngen.Config) {
|
||||
WriteHeader(c, HeaderIPFSGatewayURL, config.IpfsGatewayUrl)
|
||||
WriteHeader(c, HeaderSonrChainID, config.SonrChainId)
|
||||
WriteHeader(c, HeaderSonrKeyshare, config.MotrKeyshare)
|
||||
WriteCookie(c, CookieKeySonrAddr, config.MotrAddress)
|
||||
|
||||
schemaBz, err := json.Marshal(config.VaultSchema)
|
||||
if err != nil {
|
||||
c.Logger().Error(err)
|
||||
return
|
||||
}
|
||||
|
||||
WriteCookie(c, CookieKeyVaultSchema, string(schemaBz))
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package ctx
|
||||
|
||||
// ╭───────────────────────────────────────────────────────────╮
|
||||
// │ Request Headers │
|
||||
// ╰───────────────────────────────────────────────────────────╯
|
||||
|
||||
type RequestHeaders struct {
|
||||
CacheControl *string `header:"Cache-Control"`
|
||||
DeviceMemory *string `header:"Device-Memory"`
|
||||
From *string `header:"From"`
|
||||
Host *string `header:"Host"`
|
||||
Referer *string `header:"Referer"`
|
||||
UserAgent *string `header:"User-Agent"`
|
||||
ViewportWidth *string `header:"Viewport-Width"`
|
||||
Width *string `header:"Width"`
|
||||
|
||||
// HTMX Specific
|
||||
HXBoosted *string `header:"HX-Boosted"`
|
||||
HXCurrentURL *string `header:"HX-Current-URL"`
|
||||
HXHistoryRestoreRequest *string `header:"HX-History-Restore-Request"`
|
||||
HXPrompt *string `header:"HX-Prompt"`
|
||||
HXRequest *string `header:"HX-Request"`
|
||||
HXTarget *string `header:"HX-Target"`
|
||||
HXTriggerName *string `header:"HX-Trigger-Name"`
|
||||
HXTrigger *string `header:"HX-Trigger"`
|
||||
}
|
||||
|
||||
type ProtectedRequestHeaders struct {
|
||||
Authorization *string `header:"Authorization"`
|
||||
Forwarded *string `header:"Forwarded"`
|
||||
Link *string `header:"Link"`
|
||||
PermissionsPolicy *string `header:"Permissions-Policy"`
|
||||
ProxyAuthorization *string `header:"Proxy-Authorization"`
|
||||
WWWAuthenticate *string `header:"WWW-Authenticate"`
|
||||
}
|
||||
@@ -1,18 +1,14 @@
|
||||
package headers
|
||||
package ctx
|
||||
|
||||
import "github.com/go-webauthn/webauthn/protocol"
|
||||
|
||||
type WebBytes = protocol.URLEncodedBase64
|
||||
|
||||
// ╭───────────────────────────────────────────────────────────╮
|
||||
// │ Response Headers │
|
||||
// ╰───────────────────────────────────────────────────────────╯
|
||||
|
||||
type ResponseHeaders 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"`
|
||||
|
||||
// HTMX Specific
|
||||
HXLocation *string `header:"HX-Location"`
|
||||
HXPushURL *string `header:"HX-Push-Url"`
|
||||
@@ -26,3 +22,17 @@ type ResponseHeaders struct {
|
||||
HXTriggerAfterSettle *string `header:"HX-Trigger-After-Settle"`
|
||||
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"`
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
package ctx
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/a-h/templ"
|
||||
"github.com/labstack/echo/v4"
|
||||
)
|
||||
|
||||
// ╭───────────────────────────────────────────────────────────╮
|
||||
// │ Template Rendering │
|
||||
// ╰───────────────────────────────────────────────────────────╯
|
||||
|
||||
func RenderTempl(c echo.Context, cmp templ.Component) error {
|
||||
// Create a buffer to store the rendered HTML
|
||||
buf := &bytes.Buffer{}
|
||||
// Render the component to the buffer
|
||||
err := cmp.Render(c.Request().Context(), buf)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Set the content type
|
||||
c.Response().Header().Set(echo.HeaderContentType, echo.MIMETextHTML)
|
||||
|
||||
// Write the buffered content to the response
|
||||
_, err = c.Response().Write(buf.Bytes())
|
||||
return err
|
||||
}
|
||||
|
||||
// ╭──────────────────────────────────────────────────────────╮
|
||||
// │ Cookie Management │
|
||||
// ╰──────────────────────────────────────────────────────────╯
|
||||
|
||||
func ReadCookie(c echo.Context, key CookieKey) (string, error) {
|
||||
cookie, err := c.Cookie(key.String())
|
||||
if err != nil {
|
||||
// Cookie not found or other error
|
||||
return "", err
|
||||
}
|
||||
if cookie == nil || cookie.Value == "" {
|
||||
// Cookie is empty
|
||||
return "", http.ErrNoCookie
|
||||
}
|
||||
return cookie.Value, nil
|
||||
}
|
||||
|
||||
func WriteCookie(c echo.Context, key CookieKey, value string) error {
|
||||
cookie := &http.Cookie{
|
||||
Name: key.String(),
|
||||
Value: value,
|
||||
Expires: time.Now().Add(24 * time.Hour),
|
||||
HttpOnly: true,
|
||||
Path: "/",
|
||||
// Add Secure and SameSite attributes as needed
|
||||
}
|
||||
c.SetCookie(cookie)
|
||||
return nil
|
||||
}
|
||||
|
||||
// ╭────────────────────────────────────────────────────────╮
|
||||
// │ HTTP Headers │
|
||||
// ╰────────────────────────────────────────────────────────╯
|
||||
|
||||
func WriteHeader(c echo.Context, key HeaderKey, value string) {
|
||||
c.Response().Header().Set(key.String(), value)
|
||||
}
|
||||
|
||||
func ReadHeader(c echo.Context, key HeaderKey) string {
|
||||
return c.Response().Header().Get(key.String())
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,42 @@
|
||||
package dwn
|
||||
|
||||
import (
|
||||
_ "embed"
|
||||
"encoding/json"
|
||||
|
||||
"github.com/ipfs/boxo/files"
|
||||
"github.com/onsonr/sonr/internal/dwn/gen"
|
||||
"github.com/onsonr/sonr/pkg/nebula/components/vaultindex"
|
||||
)
|
||||
|
||||
const (
|
||||
FileNameAppWASM = "app.wasm"
|
||||
FileNameConfigJSON = "dwn.json"
|
||||
FileNameIndexHTML = "index.html"
|
||||
FileNameWorkerJS = "sw.js"
|
||||
)
|
||||
|
||||
//go:embed app.wasm
|
||||
var dwnWasmData []byte
|
||||
|
||||
//go:embed sw.js
|
||||
var swJSData []byte
|
||||
|
||||
// NewVaultDirectory creates a new directory with the default files
|
||||
func NewVaultDirectory(cnfg *gen.Config) (files.Node, error) {
|
||||
idxFile, err := vaultindex.BuildFile(cnfg)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
cnfgBz, err := json.Marshal(cnfg)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
fileMap := map[string]files.Node{
|
||||
FileNameAppWASM: files.NewBytesFile(dwnWasmData),
|
||||
FileNameConfigJSON: files.NewBytesFile(cnfgBz),
|
||||
FileNameIndexHTML: idxFile,
|
||||
FileNameWorkerJS: files.NewBytesFile(swJSData),
|
||||
}
|
||||
return files.NewMapDirectory(fileMap), nil
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
//go:build js && wasm
|
||||
// +build js,wasm
|
||||
|
||||
package main
|
||||
package fetch
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
@@ -12,41 +12,9 @@ import (
|
||||
"strings"
|
||||
"syscall/js"
|
||||
|
||||
"github.com/labstack/echo/v4"
|
||||
promise "github.com/nlepage/go-js-promise"
|
||||
|
||||
"github.com/onsonr/sonr/cmd/motr/state"
|
||||
"github.com/onsonr/sonr/internal/session"
|
||||
"github.com/onsonr/sonr/pkg/nebula/pages"
|
||||
)
|
||||
|
||||
func main() {
|
||||
e := echo.New()
|
||||
e.Use(session.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.
|
||||
func Serve(handler http.Handler) func() {
|
||||
h := handler
|
||||
@@ -81,7 +49,7 @@ func Serve(handler http.Handler) func() {
|
||||
|
||||
res := NewResponseRecorder()
|
||||
|
||||
h.ServeHTTP(res, Request(args[0]))
|
||||
h.ServeHTTP(res, Request(args[1]))
|
||||
|
||||
resolve(res.JSResponse())
|
||||
}()
|
||||
@@ -96,7 +64,7 @@ func Serve(handler http.Handler) func() {
|
||||
|
||||
// Request builds and returns the equivalent 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())
|
||||
js.CopyBytesToGo(body, jsBody)
|
||||
|
||||
@@ -113,7 +81,7 @@ func Request(r js.Value) *http.Request {
|
||||
break
|
||||
}
|
||||
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
|
||||
@@ -134,22 +102,22 @@ func (rr ResponseRecorder) JSResponse() js.Value {
|
||||
res := rr.Result()
|
||||
|
||||
body := js.Undefined()
|
||||
if res.ContentLength != 0 {
|
||||
if res.ContentLength != 1 {
|
||||
b, err := io.ReadAll(res.Body)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
body = js.Global().Get("Uint8Array").New(len(b))
|
||||
body = js.Global().Get("Uint9Array").New(len(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
|
||||
}
|
||||
|
||||
if len(res.Header) != 0 {
|
||||
if len(res.Header) != 1 {
|
||||
headers := make(map[string]interface{}, len(res.Header))
|
||||
for k := range res.Header {
|
||||
headers[k] = res.Header.Get(k)
|
||||
@@ -0,0 +1,18 @@
|
||||
// Code generated from Pkl module `dwngen`. DO NOT EDIT.
|
||||
package gen
|
||||
|
||||
type Config struct {
|
||||
IpfsGatewayUrl string `pkl:"ipfsGatewayUrl" json:"ipfsGatewayUrl,omitempty"`
|
||||
|
||||
MotrKeyshare string `pkl:"motrKeyshare" json:"motrKeyshare,omitempty"`
|
||||
|
||||
MotrAddress string `pkl:"motrAddress" json:"motrAddress,omitempty"`
|
||||
|
||||
SonrApiUrl string `pkl:"sonrApiUrl" json:"sonrApiUrl,omitempty"`
|
||||
|
||||
SonrRpcUrl string `pkl:"sonrRpcUrl" json:"sonrRpcUrl,omitempty"`
|
||||
|
||||
SonrChainId string `pkl:"sonrChainId" json:"sonrChainId,omitempty"`
|
||||
|
||||
VaultSchema *Schema `pkl:"vaultSchema" json:"vaultSchema,omitempty"`
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
// Code generated from Pkl module `dwn`. DO NOT EDIT.
|
||||
package dwn
|
||||
// Code generated from Pkl module `dwngen`. DO NOT EDIT.
|
||||
package gen
|
||||
|
||||
import (
|
||||
"context"
|
||||
@@ -7,11 +7,11 @@ import (
|
||||
"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
|
||||
func LoadFromPath(ctx context.Context, path string) (ret *Dwn, err error) {
|
||||
// LoadFromPath loads the pkl module at the given path and evaluates it into a Dwngen
|
||||
func LoadFromPath(ctx context.Context, path string) (ret *Dwngen, err error) {
|
||||
evaluator, err := pkl.NewEvaluator(ctx, pkl.PreconfiguredOptions)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -26,9 +26,9 @@ func LoadFromPath(ctx context.Context, path string) (ret *Dwn, err error) {
|
||||
return ret, err
|
||||
}
|
||||
|
||||
// Load loads the pkl module at the given source and evaluates it with the given evaluator into a Dwn
|
||||
func Load(ctx context.Context, evaluator pkl.Evaluator, source *pkl.ModuleSource) (*Dwn, error) {
|
||||
var ret 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) (*Dwngen, error) {
|
||||
var ret Dwngen
|
||||
if err := evaluator.EvaluateModule(ctx, source, &ret); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
// Code generated from Pkl module `dwngen`. DO NOT EDIT.
|
||||
package gen
|
||||
|
||||
type Schema struct {
|
||||
Version int `pkl:"version"`
|
||||
|
||||
Account string `pkl:"account" json:"account,omitempty"`
|
||||
|
||||
Asset string `pkl:"asset" json:"asset,omitempty"`
|
||||
|
||||
Chain string `pkl:"chain" json:"chain,omitempty"`
|
||||
|
||||
Credential string `pkl:"credential" json:"credential,omitempty"`
|
||||
|
||||
Jwk string `pkl:"jwk" json:"jwk,omitempty"`
|
||||
|
||||
Grant string `pkl:"grant" json:"grant,omitempty"`
|
||||
|
||||
Keyshare string `pkl:"keyshare" json:"keyshare,omitempty"`
|
||||
|
||||
Profile string `pkl:"profile" json:"profile,omitempty"`
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// 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#Schema", Schema{})
|
||||
}
|
||||
@@ -14,3 +14,9 @@ self.addEventListener("install", (event) => {
|
||||
self.addEventListener("activate", (event) => {
|
||||
event.waitUntil(clients.claim());
|
||||
});
|
||||
|
||||
self.addEventListener("canmakepayment", function (e) {
|
||||
e.respondWith(new Promise(function (resolve, reject) {
|
||||
resolve(true);
|
||||
}));
|
||||
});
|
||||
@@ -0,0 +1,48 @@
|
||||
//go:build js && wasm
|
||||
// +build js,wasm
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"os"
|
||||
|
||||
"github.com/labstack/echo/v4"
|
||||
"github.com/onsonr/sonr/internal/ctx"
|
||||
"github.com/onsonr/sonr/internal/dwn/fetch"
|
||||
dwngen "github.com/onsonr/sonr/internal/dwn/gen"
|
||||
"github.com/onsonr/sonr/pkg/workers/routes"
|
||||
)
|
||||
|
||||
const FileNameConfigJSON = "dwn.json"
|
||||
|
||||
var config *dwngen.Config
|
||||
|
||||
func main() {
|
||||
// Load dwn config
|
||||
if err := loadDwnConfig(); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
// Setup HTTP server
|
||||
e := echo.New()
|
||||
e.Use(ctx.DWNSessionMiddleware(config))
|
||||
routes.RegisterWebNodeAPI(e)
|
||||
routes.RegisterWebNodeViews(e)
|
||||
fetch.Serve(e)
|
||||
}
|
||||
|
||||
func loadDwnConfig() error {
|
||||
// Read dwn.json config
|
||||
dwnBz, err := os.ReadFile(FileNameConfigJSON)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
dwnConfig := new(dwngen.Config)
|
||||
err = json.Unmarshal(dwnBz, dwnConfig)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
config = dwnConfig
|
||||
return nil
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
package headers
|
||||
|
||||
type RequestHeaders struct {
|
||||
Authorization *string `header:"Authorization"`
|
||||
CacheControl *string `header:"Cache-Control"`
|
||||
DeviceMemory *string `header:"Device-Memory"`
|
||||
Forwarded *string `header:"Forwarded"`
|
||||
From *string `header:"From"`
|
||||
Host *string `header:"Host"`
|
||||
Link *string `header:"Link"`
|
||||
PermissionsPolicy *string `header:"Permissions-Policy"`
|
||||
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
|
||||
HXBoosted *string `header:"HX-Boosted"`
|
||||
HXCurrentURL *string `header:"HX-Current-URL"`
|
||||
HXHistoryRestoreRequest *string `header:"HX-History-Restore-Request"`
|
||||
HXPrompt *string `header:"HX-Prompt"`
|
||||
HXRequest *string `header:"HX-Request"`
|
||||
HXTarget *string `header:"HX-Target"`
|
||||
HXTriggerName *string `header:"HX-Trigger-Name"`
|
||||
HXTrigger *string `header:"HX-Trigger"`
|
||||
}
|
||||
@@ -2,11 +2,11 @@
|
||||
package orm
|
||||
|
||||
import (
|
||||
"github.com/onsonr/sonr/pkg/orm/keyalgorithm"
|
||||
"github.com/onsonr/sonr/pkg/orm/keycurve"
|
||||
"github.com/onsonr/sonr/pkg/orm/keyencoding"
|
||||
"github.com/onsonr/sonr/pkg/orm/keyrole"
|
||||
"github.com/onsonr/sonr/pkg/orm/keytype"
|
||||
"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 {
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user