mirror of
https://github.com/onsonr/sonr.git
synced 2025-03-10 13:07:09 +00:00
Merge branch 'develop'
This commit is contained in:
commit
c17bdebffd
49
.air.toml
49
.air.toml
@ -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
|
25
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
25
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
@ -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):
|
11
.github/dependabot.yml
vendored
Normal file
11
.github/dependabot.yml
vendored
Normal file
@ -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"
|
3
.github/pr-labeler.yml
vendored
Normal file
3
.github/pr-labeler.yml
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
feature: ["feature/*", "feat/*"]
|
||||
fix: fix/*
|
||||
chore :hammer:: chore/*
|
20
.github/workflows/deploy-hway.yml
vendored
Normal file
20
.github/workflows/deploy-hway.yml
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
name: Deploy Hway (sonr.id)
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- develop
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
name: Deploy Sonr.ID on Cloudflare
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Install devbox
|
||||
uses: jetify-com/devbox-install-action@v0.11.0
|
||||
- name: Deploy
|
||||
uses: cloudflare/wrangler-action@v3
|
||||
with:
|
||||
apiToken: ${{ secrets.CF_WORKERS_TOKEN }}
|
||||
workingDirectory: web
|
19
.github/workflows/label-pr.yml
vendored
Normal file
19
.github/workflows/label-pr.yml
vendored
Normal file
@ -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
|
19
.github/workflows/publish-assets.yml
vendored
19
.github/workflows/publish-assets.yml
vendored
@ -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
|
||||
|
60
.github/workflows/run-tests.yml
vendored
Normal file
60
.github/workflows/run-tests.yml
vendored
Normal file
@ -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
|
2
.github/workflows/scheduled-release.yml
vendored
2
.github/workflows/scheduled-release.yml
vendored
@ -5,6 +5,8 @@ on:
|
||||
push:
|
||||
tags:
|
||||
- v*
|
||||
branches:
|
||||
- master
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
@ -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/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/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
|
||||
|
59
Makefile
59
Makefile
@ -183,13 +183,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,43 +288,51 @@ 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"
|
||||
templ generate
|
||||
go build -o ./build/hway ./cmd/hway
|
||||
|
||||
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
|
||||
|
||||
###############################################################################
|
||||
### motr, hway & nebula ###
|
||||
###############################################################################
|
||||
|
||||
.PHONY: motr-build hway-build nebula-build
|
||||
|
||||
nebula-build:
|
||||
@echo "(ui) Building nebula"
|
||||
cd nebula && bun install && bun run build
|
||||
rm -rf ./nebula/node_modules
|
||||
|
||||
motr-build: templ-gen pkl-gen
|
||||
@echo "(dwn) Building motr.wasm -> Service Worker IPFS Vault"
|
||||
GOOS=js GOARCH=wasm go build -o ./pkg/dwn/app.wasm ./cmd/motr/main.go
|
||||
|
||||
hway-build: nebula-build templ-gen
|
||||
@echo "(hway) Building Highway gateway"
|
||||
GOOS=js GOARCH=wasm go build -o ./cmd/hway/build/app.wasm ./cmd/hway/main.go
|
||||
|
||||
hway-dev:
|
||||
@echo "(hway) Serving Highway gateway"
|
||||
bunx wrangler dev
|
||||
|
||||
hway-deploy:
|
||||
@echo "(hway) Deploying Highway gateway"
|
||||
bunx wrangler deploy
|
||||
|
||||
###############################################################################
|
||||
### help ###
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -6,6 +6,7 @@ import (
|
||||
fmt "fmt"
|
||||
runtime "github.com/cosmos/cosmos-proto/runtime"
|
||||
_ "github.com/cosmos/gogoproto/gogoproto"
|
||||
_ "github.com/onsonr/sonr/api/did/v1"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoiface "google.golang.org/protobuf/runtime/protoiface"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
@ -2734,6 +2735,610 @@ func (x *fastReflection_Caveats) ProtoMethods() *protoiface.Methods {
|
||||
}
|
||||
}
|
||||
|
||||
var _ protoreflect.List = (*_Transactions_1_list)(nil)
|
||||
|
||||
type _Transactions_1_list struct {
|
||||
list *[]string
|
||||
}
|
||||
|
||||
func (x *_Transactions_1_list) Len() int {
|
||||
if x.list == nil {
|
||||
return 0
|
||||
}
|
||||
return len(*x.list)
|
||||
}
|
||||
|
||||
func (x *_Transactions_1_list) Get(i int) protoreflect.Value {
|
||||
return protoreflect.ValueOfString((*x.list)[i])
|
||||
}
|
||||
|
||||
func (x *_Transactions_1_list) Set(i int, value protoreflect.Value) {
|
||||
valueUnwrapped := value.String()
|
||||
concreteValue := valueUnwrapped
|
||||
(*x.list)[i] = concreteValue
|
||||
}
|
||||
|
||||
func (x *_Transactions_1_list) Append(value protoreflect.Value) {
|
||||
valueUnwrapped := value.String()
|
||||
concreteValue := valueUnwrapped
|
||||
*x.list = append(*x.list, concreteValue)
|
||||
}
|
||||
|
||||
func (x *_Transactions_1_list) AppendMutable() protoreflect.Value {
|
||||
panic(fmt.Errorf("AppendMutable can not be called on message Transactions at list field Allowlist as it is not of Message kind"))
|
||||
}
|
||||
|
||||
func (x *_Transactions_1_list) Truncate(n int) {
|
||||
*x.list = (*x.list)[:n]
|
||||
}
|
||||
|
||||
func (x *_Transactions_1_list) NewElement() protoreflect.Value {
|
||||
v := ""
|
||||
return protoreflect.ValueOfString(v)
|
||||
}
|
||||
|
||||
func (x *_Transactions_1_list) IsValid() bool {
|
||||
return x.list != nil
|
||||
}
|
||||
|
||||
var _ protoreflect.List = (*_Transactions_2_list)(nil)
|
||||
|
||||
type _Transactions_2_list struct {
|
||||
list *[]string
|
||||
}
|
||||
|
||||
func (x *_Transactions_2_list) Len() int {
|
||||
if x.list == nil {
|
||||
return 0
|
||||
}
|
||||
return len(*x.list)
|
||||
}
|
||||
|
||||
func (x *_Transactions_2_list) Get(i int) protoreflect.Value {
|
||||
return protoreflect.ValueOfString((*x.list)[i])
|
||||
}
|
||||
|
||||
func (x *_Transactions_2_list) Set(i int, value protoreflect.Value) {
|
||||
valueUnwrapped := value.String()
|
||||
concreteValue := valueUnwrapped
|
||||
(*x.list)[i] = concreteValue
|
||||
}
|
||||
|
||||
func (x *_Transactions_2_list) Append(value protoreflect.Value) {
|
||||
valueUnwrapped := value.String()
|
||||
concreteValue := valueUnwrapped
|
||||
*x.list = append(*x.list, concreteValue)
|
||||
}
|
||||
|
||||
func (x *_Transactions_2_list) AppendMutable() protoreflect.Value {
|
||||
panic(fmt.Errorf("AppendMutable can not be called on message Transactions at list field Denylist as it is not of Message kind"))
|
||||
}
|
||||
|
||||
func (x *_Transactions_2_list) Truncate(n int) {
|
||||
*x.list = (*x.list)[:n]
|
||||
}
|
||||
|
||||
func (x *_Transactions_2_list) NewElement() protoreflect.Value {
|
||||
v := ""
|
||||
return protoreflect.ValueOfString(v)
|
||||
}
|
||||
|
||||
func (x *_Transactions_2_list) IsValid() bool {
|
||||
return x.list != nil
|
||||
}
|
||||
|
||||
var (
|
||||
md_Transactions protoreflect.MessageDescriptor
|
||||
fd_Transactions_allowlist protoreflect.FieldDescriptor
|
||||
fd_Transactions_denylist protoreflect.FieldDescriptor
|
||||
)
|
||||
|
||||
func init() {
|
||||
file_macaroon_v1_genesis_proto_init()
|
||||
md_Transactions = File_macaroon_v1_genesis_proto.Messages().ByName("Transactions")
|
||||
fd_Transactions_allowlist = md_Transactions.Fields().ByName("allowlist")
|
||||
fd_Transactions_denylist = md_Transactions.Fields().ByName("denylist")
|
||||
}
|
||||
|
||||
var _ protoreflect.Message = (*fastReflection_Transactions)(nil)
|
||||
|
||||
type fastReflection_Transactions Transactions
|
||||
|
||||
func (x *Transactions) ProtoReflect() protoreflect.Message {
|
||||
return (*fastReflection_Transactions)(x)
|
||||
}
|
||||
|
||||
func (x *Transactions) slowProtoReflect() protoreflect.Message {
|
||||
mi := &file_macaroon_v1_genesis_proto_msgTypes[5]
|
||||
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_Transactions_messageType fastReflection_Transactions_messageType
|
||||
var _ protoreflect.MessageType = fastReflection_Transactions_messageType{}
|
||||
|
||||
type fastReflection_Transactions_messageType struct{}
|
||||
|
||||
func (x fastReflection_Transactions_messageType) Zero() protoreflect.Message {
|
||||
return (*fastReflection_Transactions)(nil)
|
||||
}
|
||||
func (x fastReflection_Transactions_messageType) New() protoreflect.Message {
|
||||
return new(fastReflection_Transactions)
|
||||
}
|
||||
func (x fastReflection_Transactions_messageType) Descriptor() protoreflect.MessageDescriptor {
|
||||
return md_Transactions
|
||||
}
|
||||
|
||||
// Descriptor returns message descriptor, which contains only the protobuf
|
||||
// type information for the message.
|
||||
func (x *fastReflection_Transactions) Descriptor() protoreflect.MessageDescriptor {
|
||||
return md_Transactions
|
||||
}
|
||||
|
||||
// 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_Transactions) Type() protoreflect.MessageType {
|
||||
return _fastReflection_Transactions_messageType
|
||||
}
|
||||
|
||||
// New returns a newly allocated and mutable empty message.
|
||||
func (x *fastReflection_Transactions) New() protoreflect.Message {
|
||||
return new(fastReflection_Transactions)
|
||||
}
|
||||
|
||||
// Interface unwraps the message reflection interface and
|
||||
// returns the underlying ProtoMessage interface.
|
||||
func (x *fastReflection_Transactions) Interface() protoreflect.ProtoMessage {
|
||||
return (*Transactions)(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_Transactions) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {
|
||||
if len(x.Allowlist) != 0 {
|
||||
value := protoreflect.ValueOfList(&_Transactions_1_list{list: &x.Allowlist})
|
||||
if !f(fd_Transactions_allowlist, value) {
|
||||
return
|
||||
}
|
||||
}
|
||||
if len(x.Denylist) != 0 {
|
||||
value := protoreflect.ValueOfList(&_Transactions_2_list{list: &x.Denylist})
|
||||
if !f(fd_Transactions_denylist, 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_Transactions) Has(fd protoreflect.FieldDescriptor) bool {
|
||||
switch fd.FullName() {
|
||||
case "macaroon.v1.Transactions.allowlist":
|
||||
return len(x.Allowlist) != 0
|
||||
case "macaroon.v1.Transactions.denylist":
|
||||
return len(x.Denylist) != 0
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: macaroon.v1.Transactions"))
|
||||
}
|
||||
panic(fmt.Errorf("message macaroon.v1.Transactions 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_Transactions) Clear(fd protoreflect.FieldDescriptor) {
|
||||
switch fd.FullName() {
|
||||
case "macaroon.v1.Transactions.allowlist":
|
||||
x.Allowlist = nil
|
||||
case "macaroon.v1.Transactions.denylist":
|
||||
x.Denylist = nil
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: macaroon.v1.Transactions"))
|
||||
}
|
||||
panic(fmt.Errorf("message macaroon.v1.Transactions 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_Transactions) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value {
|
||||
switch descriptor.FullName() {
|
||||
case "macaroon.v1.Transactions.allowlist":
|
||||
if len(x.Allowlist) == 0 {
|
||||
return protoreflect.ValueOfList(&_Transactions_1_list{})
|
||||
}
|
||||
listValue := &_Transactions_1_list{list: &x.Allowlist}
|
||||
return protoreflect.ValueOfList(listValue)
|
||||
case "macaroon.v1.Transactions.denylist":
|
||||
if len(x.Denylist) == 0 {
|
||||
return protoreflect.ValueOfList(&_Transactions_2_list{})
|
||||
}
|
||||
listValue := &_Transactions_2_list{list: &x.Denylist}
|
||||
return protoreflect.ValueOfList(listValue)
|
||||
default:
|
||||
if descriptor.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: macaroon.v1.Transactions"))
|
||||
}
|
||||
panic(fmt.Errorf("message macaroon.v1.Transactions 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_Transactions) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) {
|
||||
switch fd.FullName() {
|
||||
case "macaroon.v1.Transactions.allowlist":
|
||||
lv := value.List()
|
||||
clv := lv.(*_Transactions_1_list)
|
||||
x.Allowlist = *clv.list
|
||||
case "macaroon.v1.Transactions.denylist":
|
||||
lv := value.List()
|
||||
clv := lv.(*_Transactions_2_list)
|
||||
x.Denylist = *clv.list
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: macaroon.v1.Transactions"))
|
||||
}
|
||||
panic(fmt.Errorf("message macaroon.v1.Transactions 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_Transactions) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value {
|
||||
switch fd.FullName() {
|
||||
case "macaroon.v1.Transactions.allowlist":
|
||||
if x.Allowlist == nil {
|
||||
x.Allowlist = []string{}
|
||||
}
|
||||
value := &_Transactions_1_list{list: &x.Allowlist}
|
||||
return protoreflect.ValueOfList(value)
|
||||
case "macaroon.v1.Transactions.denylist":
|
||||
if x.Denylist == nil {
|
||||
x.Denylist = []string{}
|
||||
}
|
||||
value := &_Transactions_2_list{list: &x.Denylist}
|
||||
return protoreflect.ValueOfList(value)
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: macaroon.v1.Transactions"))
|
||||
}
|
||||
panic(fmt.Errorf("message macaroon.v1.Transactions 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_Transactions) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value {
|
||||
switch fd.FullName() {
|
||||
case "macaroon.v1.Transactions.allowlist":
|
||||
list := []string{}
|
||||
return protoreflect.ValueOfList(&_Transactions_1_list{list: &list})
|
||||
case "macaroon.v1.Transactions.denylist":
|
||||
list := []string{}
|
||||
return protoreflect.ValueOfList(&_Transactions_2_list{list: &list})
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: macaroon.v1.Transactions"))
|
||||
}
|
||||
panic(fmt.Errorf("message macaroon.v1.Transactions 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_Transactions) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor {
|
||||
switch d.FullName() {
|
||||
default:
|
||||
panic(fmt.Errorf("%s is not a oneof field in macaroon.v1.Transactions", 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_Transactions) 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_Transactions) 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_Transactions) 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_Transactions) ProtoMethods() *protoiface.Methods {
|
||||
size := func(input protoiface.SizeInput) protoiface.SizeOutput {
|
||||
x := input.Message.Interface().(*Transactions)
|
||||
if x == nil {
|
||||
return protoiface.SizeOutput{
|
||||
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
||||
Size: 0,
|
||||
}
|
||||
}
|
||||
options := runtime.SizeInputToOptions(input)
|
||||
_ = options
|
||||
var n int
|
||||
var l int
|
||||
_ = l
|
||||
if len(x.Allowlist) > 0 {
|
||||
for _, s := range x.Allowlist {
|
||||
l = len(s)
|
||||
n += 1 + l + runtime.Sov(uint64(l))
|
||||
}
|
||||
}
|
||||
if len(x.Denylist) > 0 {
|
||||
for _, s := range x.Denylist {
|
||||
l = len(s)
|
||||
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().(*Transactions)
|
||||
if x == nil {
|
||||
return protoiface.MarshalOutput{
|
||||
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
||||
Buf: input.Buf,
|
||||
}, nil
|
||||
}
|
||||
options := runtime.MarshalInputToOptions(input)
|
||||
_ = options
|
||||
size := options.Size(x)
|
||||
dAtA := make([]byte, size)
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if x.unknownFields != nil {
|
||||
i -= len(x.unknownFields)
|
||||
copy(dAtA[i:], x.unknownFields)
|
||||
}
|
||||
if len(x.Denylist) > 0 {
|
||||
for iNdEx := len(x.Denylist) - 1; iNdEx >= 0; iNdEx-- {
|
||||
i -= len(x.Denylist[iNdEx])
|
||||
copy(dAtA[i:], x.Denylist[iNdEx])
|
||||
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Denylist[iNdEx])))
|
||||
i--
|
||||
dAtA[i] = 0x12
|
||||
}
|
||||
}
|
||||
if len(x.Allowlist) > 0 {
|
||||
for iNdEx := len(x.Allowlist) - 1; iNdEx >= 0; iNdEx-- {
|
||||
i -= len(x.Allowlist[iNdEx])
|
||||
copy(dAtA[i:], x.Allowlist[iNdEx])
|
||||
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Allowlist[iNdEx])))
|
||||
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().(*Transactions)
|
||||
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: Transactions: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Transactions: 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 Allowlist", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLen |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex < 0 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
|
||||
}
|
||||
if postIndex > l {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||
}
|
||||
x.Allowlist = append(x.Allowlist, string(dAtA[iNdEx:postIndex]))
|
||||
iNdEx = postIndex
|
||||
case 2:
|
||||
if wireType != 2 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Denylist", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLen |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex < 0 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
|
||||
}
|
||||
if postIndex > l {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||
}
|
||||
x.Denylist = append(x.Denylist, string(dAtA[iNdEx:postIndex]))
|
||||
iNdEx = postIndex
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := runtime.Skip(dAtA[iNdEx:])
|
||||
if err != nil {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
|
||||
}
|
||||
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
|
||||
}
|
||||
if (iNdEx + skippy) > l {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||
}
|
||||
if !options.DiscardUnknown {
|
||||
x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...)
|
||||
}
|
||||
iNdEx += skippy
|
||||
}
|
||||
}
|
||||
|
||||
if iNdEx > l {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||
}
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil
|
||||
}
|
||||
return &protoiface.Methods{
|
||||
NoUnkeyedLiterals: struct{}{},
|
||||
Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown,
|
||||
Size: size,
|
||||
Marshal: marshal,
|
||||
Unmarshal: unmarshal,
|
||||
Merge: nil,
|
||||
CheckInitialized: nil,
|
||||
}
|
||||
}
|
||||
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.27.0
|
||||
@ -2971,6 +3576,51 @@ func (x *Caveats) GetSupportedThirdParty() []string {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Transactions defines the allowlist,denylist for transactions which can be
|
||||
// broadcasted to the network with the Sonr DWN Signed macaroon.
|
||||
type Transactions struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Allowlist []string `protobuf:"bytes,1,rep,name=allowlist,proto3" json:"allowlist,omitempty"`
|
||||
Denylist []string `protobuf:"bytes,2,rep,name=denylist,proto3" json:"denylist,omitempty"`
|
||||
}
|
||||
|
||||
func (x *Transactions) Reset() {
|
||||
*x = Transactions{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_macaroon_v1_genesis_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Transactions) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Transactions) ProtoMessage() {}
|
||||
|
||||
// Deprecated: Use Transactions.ProtoReflect.Descriptor instead.
|
||||
func (*Transactions) Descriptor() ([]byte, []int) {
|
||||
return file_macaroon_v1_genesis_proto_rawDescGZIP(), []int{5}
|
||||
}
|
||||
|
||||
func (x *Transactions) GetAllowlist() []string {
|
||||
if x != nil {
|
||||
return x.Allowlist
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Transactions) GetDenylist() []string {
|
||||
if x != nil {
|
||||
return x.Denylist
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_macaroon_v1_genesis_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_macaroon_v1_genesis_proto_rawDesc = []byte{
|
||||
@ -2979,53 +3629,61 @@ var file_macaroon_v1_genesis_proto_rawDesc = []byte{
|
||||
0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f,
|
||||
0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67,
|
||||
0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x22, 0x41, 0x0a, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x53, 0x74, 0x61, 0x74,
|
||||
0x65, 0x12, 0x31, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||
0x0b, 0x32, 0x13, 0x2e, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e,
|
||||
0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x70, 0x61,
|
||||
0x72, 0x61, 0x6d, 0x73, 0x22, 0xb3, 0x01, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12,
|
||||
0x2e, 0x0a, 0x07, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b,
|
||||
0x32, 0x14, 0x2e, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4d,
|
||||
0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x52, 0x07, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x12,
|
||||
0x2b, 0x0a, 0x06, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32,
|
||||
0x13, 0x2e, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x63,
|
||||
0x6f, 0x70, 0x65, 0x73, 0x52, 0x06, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x12, 0x2e, 0x0a, 0x07,
|
||||
0x63, 0x61, 0x76, 0x65, 0x61, 0x74, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e,
|
||||
0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x76, 0x65,
|
||||
0x61, 0x74, 0x73, 0x52, 0x07, 0x63, 0x61, 0x76, 0x65, 0x61, 0x74, 0x73, 0x3a, 0x1c, 0x98, 0xa0,
|
||||
0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x0f, 0x6d, 0x61, 0x63, 0x61, 0x72,
|
||||
0x6f, 0x6f, 0x6e, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x5c, 0x0a, 0x07, 0x4d, 0x65,
|
||||
0x74, 0x68, 0x6f, 0x64, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74,
|
||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12,
|
||||
0x1c, 0x0a, 0x09, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x18, 0x02, 0x20, 0x03,
|
||||
0x28, 0x09, 0x52, 0x09, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x3a, 0x19, 0xe8,
|
||||
0xa0, 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x10, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e,
|
||||
0x2f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x22, 0x54, 0x0a, 0x06, 0x53, 0x63, 0x6f, 0x70,
|
||||
0x65, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
|
||||
0x52, 0x04, 0x62, 0x61, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72,
|
||||
0x74, 0x65, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x73, 0x75, 0x70, 0x70, 0x6f,
|
||||
0x72, 0x74, 0x65, 0x64, 0x3a, 0x18, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x0f, 0x6d,
|
||||
0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x22, 0x8b,
|
||||
0x01, 0x0a, 0x07, 0x43, 0x61, 0x76, 0x65, 0x61, 0x74, 0x73, 0x12, 0x32, 0x0a, 0x15, 0x73, 0x75,
|
||||
0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x5f, 0x66, 0x69, 0x72, 0x73, 0x74, 0x5f, 0x70, 0x61,
|
||||
0x72, 0x74, 0x79, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x13, 0x73, 0x75, 0x70, 0x70, 0x6f,
|
||||
0x72, 0x74, 0x65, 0x64, 0x46, 0x69, 0x72, 0x73, 0x74, 0x50, 0x61, 0x72, 0x74, 0x79, 0x12, 0x32,
|
||||
0x0a, 0x15, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x68, 0x69, 0x72,
|
||||
0x64, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x79, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x13, 0x73,
|
||||
0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x68, 0x69, 0x72, 0x64, 0x50, 0x61, 0x72,
|
||||
0x74, 0x79, 0x3a, 0x18, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x0f, 0x6d, 0x61, 0x63,
|
||||
0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2f, 0x63, 0x61, 0x76, 0x65, 0x61, 0x74, 0x42, 0x9f, 0x01, 0x0a,
|
||||
0x0f, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2e, 0x76, 0x31,
|
||||
0x42, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01,
|
||||
0x5a, 0x31, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73,
|
||||
0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x61, 0x63,
|
||||
0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f,
|
||||
0x6e, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4d, 0x58, 0x58, 0xaa, 0x02, 0x0b, 0x4d, 0x61, 0x63, 0x61,
|
||||
0x72, 0x6f, 0x6f, 0x6e, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0b, 0x4d, 0x61, 0x63, 0x61, 0x72, 0x6f,
|
||||
0x6f, 0x6e, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x17, 0x4d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e,
|
||||
0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea,
|
||||
0x02, 0x0c, 0x4d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
0x6f, 0x1a, 0x0f, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x78, 0x2e, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x22, 0x41, 0x0a, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x53, 0x74, 0x61,
|
||||
0x74, 0x65, 0x12, 0x31, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01,
|
||||
0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2e, 0x76, 0x31,
|
||||
0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x70,
|
||||
0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0xb3, 0x01, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73,
|
||||
0x12, 0x2e, 0x0a, 0x07, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||
0x0b, 0x32, 0x14, 0x2e, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e,
|
||||
0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x52, 0x07, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73,
|
||||
0x12, 0x2b, 0x0a, 0x06, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b,
|
||||
0x32, 0x13, 0x2e, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53,
|
||||
0x63, 0x6f, 0x70, 0x65, 0x73, 0x52, 0x06, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x12, 0x2e, 0x0a,
|
||||
0x07, 0x63, 0x61, 0x76, 0x65, 0x61, 0x74, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14,
|
||||
0x2e, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x76,
|
||||
0x65, 0x61, 0x74, 0x73, 0x52, 0x07, 0x63, 0x61, 0x76, 0x65, 0x61, 0x74, 0x73, 0x3a, 0x1c, 0x98,
|
||||
0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x0f, 0x6d, 0x61, 0x63, 0x61,
|
||||
0x72, 0x6f, 0x6f, 0x6e, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x5c, 0x0a, 0x07, 0x4d,
|
||||
0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c,
|
||||
0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74,
|
||||
0x12, 0x1c, 0x0a, 0x09, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x18, 0x02, 0x20,
|
||||
0x03, 0x28, 0x09, 0x52, 0x09, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x3a, 0x19,
|
||||
0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x10, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f,
|
||||
0x6e, 0x2f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x22, 0x54, 0x0a, 0x06, 0x53, 0x63, 0x6f,
|
||||
0x70, 0x65, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||
0x09, 0x52, 0x04, 0x62, 0x61, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x75, 0x70, 0x70, 0x6f,
|
||||
0x72, 0x74, 0x65, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x73, 0x75, 0x70, 0x70,
|
||||
0x6f, 0x72, 0x74, 0x65, 0x64, 0x3a, 0x18, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x0f,
|
||||
0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x22,
|
||||
0x8c, 0x01, 0x0a, 0x07, 0x43, 0x61, 0x76, 0x65, 0x61, 0x74, 0x73, 0x12, 0x32, 0x0a, 0x15, 0x73,
|
||||
0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x5f, 0x66, 0x69, 0x72, 0x73, 0x74, 0x5f, 0x70,
|
||||
0x61, 0x72, 0x74, 0x79, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x13, 0x73, 0x75, 0x70, 0x70,
|
||||
0x6f, 0x72, 0x74, 0x65, 0x64, 0x46, 0x69, 0x72, 0x73, 0x74, 0x50, 0x61, 0x72, 0x74, 0x79, 0x12,
|
||||
0x32, 0x0a, 0x15, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x68, 0x69,
|
||||
0x72, 0x64, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x79, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x13,
|
||||
0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x68, 0x69, 0x72, 0x64, 0x50, 0x61,
|
||||
0x72, 0x74, 0x79, 0x3a, 0x19, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x10, 0x6d, 0x61,
|
||||
0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2f, 0x63, 0x61, 0x76, 0x65, 0x61, 0x74, 0x73, 0x22, 0x68,
|
||||
0x0a, 0x0c, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1c,
|
||||
0x0a, 0x09, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28,
|
||||
0x09, 0x52, 0x09, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x6c, 0x69, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08,
|
||||
0x64, 0x65, 0x6e, 0x79, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08,
|
||||
0x64, 0x65, 0x6e, 0x79, 0x6c, 0x69, 0x73, 0x74, 0x3a, 0x1e, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7,
|
||||
0xb0, 0x2a, 0x15, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2f, 0x74, 0x72, 0x61, 0x6e,
|
||||
0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x9f, 0x01, 0x0a, 0x0f, 0x63, 0x6f, 0x6d,
|
||||
0x2e, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x47, 0x65,
|
||||
0x6e, 0x65, 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x31, 0x67, 0x69,
|
||||
0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f,
|
||||
0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f,
|
||||
0x6e, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x76, 0x31, 0xa2,
|
||||
0x02, 0x03, 0x4d, 0x58, 0x58, 0xaa, 0x02, 0x0b, 0x4d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e,
|
||||
0x2e, 0x56, 0x31, 0xca, 0x02, 0x0b, 0x4d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x5c, 0x56,
|
||||
0x31, 0xe2, 0x02, 0x17, 0x4d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x5c, 0x56, 0x31, 0x5c,
|
||||
0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0c, 0x4d, 0x61,
|
||||
0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
@ -3040,13 +3698,14 @@ func file_macaroon_v1_genesis_proto_rawDescGZIP() []byte {
|
||||
return file_macaroon_v1_genesis_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_macaroon_v1_genesis_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
|
||||
var file_macaroon_v1_genesis_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
|
||||
var file_macaroon_v1_genesis_proto_goTypes = []interface{}{
|
||||
(*GenesisState)(nil), // 0: macaroon.v1.GenesisState
|
||||
(*Params)(nil), // 1: macaroon.v1.Params
|
||||
(*Methods)(nil), // 2: macaroon.v1.Methods
|
||||
(*Scopes)(nil), // 3: macaroon.v1.Scopes
|
||||
(*Caveats)(nil), // 4: macaroon.v1.Caveats
|
||||
(*Transactions)(nil), // 5: macaroon.v1.Transactions
|
||||
}
|
||||
var file_macaroon_v1_genesis_proto_depIdxs = []int32{
|
||||
1, // 0: macaroon.v1.GenesisState.params:type_name -> macaroon.v1.Params
|
||||
@ -3126,6 +3785,18 @@ func file_macaroon_v1_genesis_proto_init() {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_macaroon_v1_genesis_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Transactions); 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{
|
||||
@ -3133,7 +3804,7 @@ func file_macaroon_v1_genesis_proto_init() {
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_macaroon_v1_genesis_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 5,
|
||||
NumMessages: 6,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
|
@ -1,500 +0,0 @@
|
||||
// Code generated by protoc-gen-go-pulsar. DO NOT EDIT.
|
||||
package modulev1
|
||||
|
||||
import (
|
||||
_ "cosmossdk.io/api/cosmos/app/v1alpha1"
|
||||
fmt "fmt"
|
||||
runtime "github.com/cosmos/cosmos-proto/runtime"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoiface "google.golang.org/protobuf/runtime/protoiface"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
io "io"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
var (
|
||||
md_Module protoreflect.MessageDescriptor
|
||||
)
|
||||
|
||||
func init() {
|
||||
file_oracle_module_v1_module_proto_init()
|
||||
md_Module = File_oracle_module_v1_module_proto.Messages().ByName("Module")
|
||||
}
|
||||
|
||||
var _ protoreflect.Message = (*fastReflection_Module)(nil)
|
||||
|
||||
type fastReflection_Module Module
|
||||
|
||||
func (x *Module) ProtoReflect() protoreflect.Message {
|
||||
return (*fastReflection_Module)(x)
|
||||
}
|
||||
|
||||
func (x *Module) slowProtoReflect() protoreflect.Message {
|
||||
mi := &file_oracle_module_v1_module_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
var _fastReflection_Module_messageType fastReflection_Module_messageType
|
||||
var _ protoreflect.MessageType = fastReflection_Module_messageType{}
|
||||
|
||||
type fastReflection_Module_messageType struct{}
|
||||
|
||||
func (x fastReflection_Module_messageType) Zero() protoreflect.Message {
|
||||
return (*fastReflection_Module)(nil)
|
||||
}
|
||||
func (x fastReflection_Module_messageType) New() protoreflect.Message {
|
||||
return new(fastReflection_Module)
|
||||
}
|
||||
func (x fastReflection_Module_messageType) Descriptor() protoreflect.MessageDescriptor {
|
||||
return md_Module
|
||||
}
|
||||
|
||||
// Descriptor returns message descriptor, which contains only the protobuf
|
||||
// type information for the message.
|
||||
func (x *fastReflection_Module) Descriptor() protoreflect.MessageDescriptor {
|
||||
return md_Module
|
||||
}
|
||||
|
||||
// Type returns the message type, which encapsulates both Go and protobuf
|
||||
// type information. If the Go type information is not needed,
|
||||
// it is recommended that the message descriptor be used instead.
|
||||
func (x *fastReflection_Module) Type() protoreflect.MessageType {
|
||||
return _fastReflection_Module_messageType
|
||||
}
|
||||
|
||||
// New returns a newly allocated and mutable empty message.
|
||||
func (x *fastReflection_Module) New() protoreflect.Message {
|
||||
return new(fastReflection_Module)
|
||||
}
|
||||
|
||||
// Interface unwraps the message reflection interface and
|
||||
// returns the underlying ProtoMessage interface.
|
||||
func (x *fastReflection_Module) Interface() protoreflect.ProtoMessage {
|
||||
return (*Module)(x)
|
||||
}
|
||||
|
||||
// Range iterates over every populated field in an undefined order,
|
||||
// calling f for each field descriptor and value encountered.
|
||||
// Range returns immediately if f returns false.
|
||||
// While iterating, mutating operations may only be performed
|
||||
// on the current field descriptor.
|
||||
func (x *fastReflection_Module) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {
|
||||
}
|
||||
|
||||
// Has reports whether a field is populated.
|
||||
//
|
||||
// Some fields have the property of nullability where it is possible to
|
||||
// distinguish between the default value of a field and whether the field
|
||||
// was explicitly populated with the default value. Singular message fields,
|
||||
// member fields of a oneof, and proto2 scalar fields are nullable. Such
|
||||
// fields are populated only if explicitly set.
|
||||
//
|
||||
// In other cases (aside from the nullable cases above),
|
||||
// a proto3 scalar field is populated if it contains a non-zero value, and
|
||||
// a repeated field is populated if it is non-empty.
|
||||
func (x *fastReflection_Module) Has(fd protoreflect.FieldDescriptor) bool {
|
||||
switch fd.FullName() {
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.module.v1.Module"))
|
||||
}
|
||||
panic(fmt.Errorf("message oracle.module.v1.Module does not contain field %s", fd.FullName()))
|
||||
}
|
||||
}
|
||||
|
||||
// Clear clears the field such that a subsequent Has call reports false.
|
||||
//
|
||||
// Clearing an extension field clears both the extension type and value
|
||||
// associated with the given field number.
|
||||
//
|
||||
// Clear is a mutating operation and unsafe for concurrent use.
|
||||
func (x *fastReflection_Module) Clear(fd protoreflect.FieldDescriptor) {
|
||||
switch fd.FullName() {
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.module.v1.Module"))
|
||||
}
|
||||
panic(fmt.Errorf("message oracle.module.v1.Module does not contain field %s", fd.FullName()))
|
||||
}
|
||||
}
|
||||
|
||||
// Get retrieves the value for a field.
|
||||
//
|
||||
// For unpopulated scalars, it returns the default value, where
|
||||
// the default value of a bytes scalar is guaranteed to be a copy.
|
||||
// For unpopulated composite types, it returns an empty, read-only view
|
||||
// of the value; to obtain a mutable reference, use Mutable.
|
||||
func (x *fastReflection_Module) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value {
|
||||
switch descriptor.FullName() {
|
||||
default:
|
||||
if descriptor.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.module.v1.Module"))
|
||||
}
|
||||
panic(fmt.Errorf("message oracle.module.v1.Module does not contain field %s", descriptor.FullName()))
|
||||
}
|
||||
}
|
||||
|
||||
// Set stores the value for a field.
|
||||
//
|
||||
// For a field belonging to a oneof, it implicitly clears any other field
|
||||
// that may be currently set within the same oneof.
|
||||
// For extension fields, it implicitly stores the provided ExtensionType.
|
||||
// When setting a composite type, it is unspecified whether the stored value
|
||||
// aliases the source's memory in any way. If the composite value is an
|
||||
// empty, read-only value, then it panics.
|
||||
//
|
||||
// Set is a mutating operation and unsafe for concurrent use.
|
||||
func (x *fastReflection_Module) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) {
|
||||
switch fd.FullName() {
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.module.v1.Module"))
|
||||
}
|
||||
panic(fmt.Errorf("message oracle.module.v1.Module does not contain field %s", fd.FullName()))
|
||||
}
|
||||
}
|
||||
|
||||
// Mutable returns a mutable reference to a composite type.
|
||||
//
|
||||
// If the field is unpopulated, it may allocate a composite value.
|
||||
// For a field belonging to a oneof, it implicitly clears any other field
|
||||
// that may be currently set within the same oneof.
|
||||
// For extension fields, it implicitly stores the provided ExtensionType
|
||||
// if not already stored.
|
||||
// It panics if the field does not contain a composite type.
|
||||
//
|
||||
// Mutable is a mutating operation and unsafe for concurrent use.
|
||||
func (x *fastReflection_Module) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value {
|
||||
switch fd.FullName() {
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.module.v1.Module"))
|
||||
}
|
||||
panic(fmt.Errorf("message oracle.module.v1.Module does not contain field %s", fd.FullName()))
|
||||
}
|
||||
}
|
||||
|
||||
// NewField returns a new value that is assignable to the field
|
||||
// for the given descriptor. For scalars, this returns the default value.
|
||||
// For lists, maps, and messages, this returns a new, empty, mutable value.
|
||||
func (x *fastReflection_Module) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value {
|
||||
switch fd.FullName() {
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.module.v1.Module"))
|
||||
}
|
||||
panic(fmt.Errorf("message oracle.module.v1.Module does not contain field %s", fd.FullName()))
|
||||
}
|
||||
}
|
||||
|
||||
// WhichOneof reports which field within the oneof is populated,
|
||||
// returning nil if none are populated.
|
||||
// It panics if the oneof descriptor does not belong to this message.
|
||||
func (x *fastReflection_Module) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor {
|
||||
switch d.FullName() {
|
||||
default:
|
||||
panic(fmt.Errorf("%s is not a oneof field in oracle.module.v1.Module", d.FullName()))
|
||||
}
|
||||
panic("unreachable")
|
||||
}
|
||||
|
||||
// GetUnknown retrieves the entire list of unknown fields.
|
||||
// The caller may only mutate the contents of the RawFields
|
||||
// if the mutated bytes are stored back into the message with SetUnknown.
|
||||
func (x *fastReflection_Module) GetUnknown() protoreflect.RawFields {
|
||||
return x.unknownFields
|
||||
}
|
||||
|
||||
// SetUnknown stores an entire list of unknown fields.
|
||||
// The raw fields must be syntactically valid according to the wire format.
|
||||
// An implementation may panic if this is not the case.
|
||||
// Once stored, the caller must not mutate the content of the RawFields.
|
||||
// An empty RawFields may be passed to clear the fields.
|
||||
//
|
||||
// SetUnknown is a mutating operation and unsafe for concurrent use.
|
||||
func (x *fastReflection_Module) SetUnknown(fields protoreflect.RawFields) {
|
||||
x.unknownFields = fields
|
||||
}
|
||||
|
||||
// IsValid reports whether the message is valid.
|
||||
//
|
||||
// An invalid message is an empty, read-only value.
|
||||
//
|
||||
// An invalid message often corresponds to a nil pointer of the concrete
|
||||
// message type, but the details are implementation dependent.
|
||||
// Validity is not part of the protobuf data model, and may not
|
||||
// be preserved in marshaling or other operations.
|
||||
func (x *fastReflection_Module) IsValid() bool {
|
||||
return x != nil
|
||||
}
|
||||
|
||||
// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations.
|
||||
// This method may return nil.
|
||||
//
|
||||
// The returned methods type is identical to
|
||||
// "google.golang.org/protobuf/runtime/protoiface".Methods.
|
||||
// Consult the protoiface package documentation for details.
|
||||
func (x *fastReflection_Module) ProtoMethods() *protoiface.Methods {
|
||||
size := func(input protoiface.SizeInput) protoiface.SizeOutput {
|
||||
x := input.Message.Interface().(*Module)
|
||||
if x == nil {
|
||||
return protoiface.SizeOutput{
|
||||
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
||||
Size: 0,
|
||||
}
|
||||
}
|
||||
options := runtime.SizeInputToOptions(input)
|
||||
_ = options
|
||||
var n int
|
||||
var l int
|
||||
_ = l
|
||||
if x.unknownFields != nil {
|
||||
n += len(x.unknownFields)
|
||||
}
|
||||
return protoiface.SizeOutput{
|
||||
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
||||
Size: n,
|
||||
}
|
||||
}
|
||||
|
||||
marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) {
|
||||
x := input.Message.Interface().(*Module)
|
||||
if x == nil {
|
||||
return protoiface.MarshalOutput{
|
||||
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
||||
Buf: input.Buf,
|
||||
}, nil
|
||||
}
|
||||
options := runtime.MarshalInputToOptions(input)
|
||||
_ = options
|
||||
size := options.Size(x)
|
||||
dAtA := make([]byte, size)
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if x.unknownFields != nil {
|
||||
i -= len(x.unknownFields)
|
||||
copy(dAtA[i:], x.unknownFields)
|
||||
}
|
||||
if input.Buf != nil {
|
||||
input.Buf = append(input.Buf, dAtA...)
|
||||
} else {
|
||||
input.Buf = dAtA
|
||||
}
|
||||
return protoiface.MarshalOutput{
|
||||
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
||||
Buf: input.Buf,
|
||||
}, nil
|
||||
}
|
||||
unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) {
|
||||
x := input.Message.Interface().(*Module)
|
||||
if x == nil {
|
||||
return protoiface.UnmarshalOutput{
|
||||
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
||||
Flags: input.Flags,
|
||||
}, nil
|
||||
}
|
||||
options := runtime.UnmarshalInputToOptions(input)
|
||||
_ = options
|
||||
dAtA := input.Buf
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
for iNdEx < l {
|
||||
preIndex := iNdEx
|
||||
var wire uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
wire |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
fieldNum := int32(wire >> 3)
|
||||
wireType := int(wire & 0x7)
|
||||
if wireType == 4 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Module: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Module: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := runtime.Skip(dAtA[iNdEx:])
|
||||
if err != nil {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
|
||||
}
|
||||
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
|
||||
}
|
||||
if (iNdEx + skippy) > l {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||
}
|
||||
if !options.DiscardUnknown {
|
||||
x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...)
|
||||
}
|
||||
iNdEx += skippy
|
||||
}
|
||||
}
|
||||
|
||||
if iNdEx > l {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||
}
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil
|
||||
}
|
||||
return &protoiface.Methods{
|
||||
NoUnkeyedLiterals: struct{}{},
|
||||
Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown,
|
||||
Size: size,
|
||||
Marshal: marshal,
|
||||
Unmarshal: unmarshal,
|
||||
Merge: nil,
|
||||
CheckInitialized: nil,
|
||||
}
|
||||
}
|
||||
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.27.0
|
||||
// protoc (unknown)
|
||||
// source: oracle/module/v1/module.proto
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// Module is the app config object of the module.
|
||||
// Learn more: https://docs.cosmos.network/main/building-modules/depinject
|
||||
type Module struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
}
|
||||
|
||||
func (x *Module) Reset() {
|
||||
*x = Module{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_oracle_module_v1_module_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Module) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Module) ProtoMessage() {}
|
||||
|
||||
// Deprecated: Use Module.ProtoReflect.Descriptor instead.
|
||||
func (*Module) Descriptor() ([]byte, []int) {
|
||||
return file_oracle_module_v1_module_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
var File_oracle_module_v1_module_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_oracle_module_v1_module_proto_rawDesc = []byte{
|
||||
0x0a, 0x1d, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f,
|
||||
0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
|
||||
0x10, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76,
|
||||
0x31, 0x1a, 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x76, 0x31,
|
||||
0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x22, 0x28, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x1e, 0xba,
|
||||
0xc0, 0x96, 0xda, 0x01, 0x18, 0x0a, 0x16, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f,
|
||||
0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x42, 0xbb, 0x01,
|
||||
0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x64,
|
||||
0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x34, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f,
|
||||
0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x61, 0x70,
|
||||
0x69, 0x2f, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f,
|
||||
0x76, 0x31, 0x3b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4f, 0x4d,
|
||||
0x58, 0xaa, 0x02, 0x10, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c,
|
||||
0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x10, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x5c, 0x4d, 0x6f,
|
||||
0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1c, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65,
|
||||
0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65,
|
||||
0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x12, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x3a,
|
||||
0x3a, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_oracle_module_v1_module_proto_rawDescOnce sync.Once
|
||||
file_oracle_module_v1_module_proto_rawDescData = file_oracle_module_v1_module_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_oracle_module_v1_module_proto_rawDescGZIP() []byte {
|
||||
file_oracle_module_v1_module_proto_rawDescOnce.Do(func() {
|
||||
file_oracle_module_v1_module_proto_rawDescData = protoimpl.X.CompressGZIP(file_oracle_module_v1_module_proto_rawDescData)
|
||||
})
|
||||
return file_oracle_module_v1_module_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_oracle_module_v1_module_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_oracle_module_v1_module_proto_goTypes = []interface{}{
|
||||
(*Module)(nil), // 0: oracle.module.v1.Module
|
||||
}
|
||||
var file_oracle_module_v1_module_proto_depIdxs = []int32{
|
||||
0, // [0:0] is the sub-list for method output_type
|
||||
0, // [0:0] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
0, // [0:0] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_oracle_module_v1_module_proto_init() }
|
||||
func file_oracle_module_v1_module_proto_init() {
|
||||
if File_oracle_module_v1_module_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_oracle_module_v1_module_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Module); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_oracle_module_v1_module_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_oracle_module_v1_module_proto_goTypes,
|
||||
DependencyIndexes: file_oracle_module_v1_module_proto_depIdxs,
|
||||
MessageInfos: file_oracle_module_v1_module_proto_msgTypes,
|
||||
}.Build()
|
||||
File_oracle_module_v1_module_proto = out.File
|
||||
file_oracle_module_v1_module_proto_rawDesc = nil
|
||||
file_oracle_module_v1_module_proto_goTypes = nil
|
||||
file_oracle_module_v1_module_proto_depIdxs = nil
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -1,996 +0,0 @@
|
||||
// Code generated by protoc-gen-go-pulsar. DO NOT EDIT.
|
||||
package oraclev1
|
||||
|
||||
import (
|
||||
fmt "fmt"
|
||||
runtime "github.com/cosmos/cosmos-proto/runtime"
|
||||
_ "google.golang.org/genproto/googleapis/api/annotations"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoiface "google.golang.org/protobuf/runtime/protoiface"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
io "io"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
var (
|
||||
md_QueryParamsRequest protoreflect.MessageDescriptor
|
||||
)
|
||||
|
||||
func init() {
|
||||
file_oracle_v1_query_proto_init()
|
||||
md_QueryParamsRequest = File_oracle_v1_query_proto.Messages().ByName("QueryParamsRequest")
|
||||
}
|
||||
|
||||
var _ protoreflect.Message = (*fastReflection_QueryParamsRequest)(nil)
|
||||
|
||||
type fastReflection_QueryParamsRequest QueryParamsRequest
|
||||
|
||||
func (x *QueryParamsRequest) ProtoReflect() protoreflect.Message {
|
||||
return (*fastReflection_QueryParamsRequest)(x)
|
||||
}
|
||||
|
||||
func (x *QueryParamsRequest) slowProtoReflect() protoreflect.Message {
|
||||
mi := &file_oracle_v1_query_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
var _fastReflection_QueryParamsRequest_messageType fastReflection_QueryParamsRequest_messageType
|
||||
var _ protoreflect.MessageType = fastReflection_QueryParamsRequest_messageType{}
|
||||
|
||||
type fastReflection_QueryParamsRequest_messageType struct{}
|
||||
|
||||
func (x fastReflection_QueryParamsRequest_messageType) Zero() protoreflect.Message {
|
||||
return (*fastReflection_QueryParamsRequest)(nil)
|
||||
}
|
||||
func (x fastReflection_QueryParamsRequest_messageType) New() protoreflect.Message {
|
||||
return new(fastReflection_QueryParamsRequest)
|
||||
}
|
||||
func (x fastReflection_QueryParamsRequest_messageType) Descriptor() protoreflect.MessageDescriptor {
|
||||
return md_QueryParamsRequest
|
||||
}
|
||||
|
||||
// Descriptor returns message descriptor, which contains only the protobuf
|
||||
// type information for the message.
|
||||
func (x *fastReflection_QueryParamsRequest) Descriptor() protoreflect.MessageDescriptor {
|
||||
return md_QueryParamsRequest
|
||||
}
|
||||
|
||||
// Type returns the message type, which encapsulates both Go and protobuf
|
||||
// type information. If the Go type information is not needed,
|
||||
// it is recommended that the message descriptor be used instead.
|
||||
func (x *fastReflection_QueryParamsRequest) Type() protoreflect.MessageType {
|
||||
return _fastReflection_QueryParamsRequest_messageType
|
||||
}
|
||||
|
||||
// New returns a newly allocated and mutable empty message.
|
||||
func (x *fastReflection_QueryParamsRequest) New() protoreflect.Message {
|
||||
return new(fastReflection_QueryParamsRequest)
|
||||
}
|
||||
|
||||
// Interface unwraps the message reflection interface and
|
||||
// returns the underlying ProtoMessage interface.
|
||||
func (x *fastReflection_QueryParamsRequest) Interface() protoreflect.ProtoMessage {
|
||||
return (*QueryParamsRequest)(x)
|
||||
}
|
||||
|
||||
// Range iterates over every populated field in an undefined order,
|
||||
// calling f for each field descriptor and value encountered.
|
||||
// Range returns immediately if f returns false.
|
||||
// While iterating, mutating operations may only be performed
|
||||
// on the current field descriptor.
|
||||
func (x *fastReflection_QueryParamsRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {
|
||||
}
|
||||
|
||||
// Has reports whether a field is populated.
|
||||
//
|
||||
// Some fields have the property of nullability where it is possible to
|
||||
// distinguish between the default value of a field and whether the field
|
||||
// was explicitly populated with the default value. Singular message fields,
|
||||
// member fields of a oneof, and proto2 scalar fields are nullable. Such
|
||||
// fields are populated only if explicitly set.
|
||||
//
|
||||
// In other cases (aside from the nullable cases above),
|
||||
// a proto3 scalar field is populated if it contains a non-zero value, and
|
||||
// a repeated field is populated if it is non-empty.
|
||||
func (x *fastReflection_QueryParamsRequest) Has(fd protoreflect.FieldDescriptor) bool {
|
||||
switch fd.FullName() {
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryParamsRequest"))
|
||||
}
|
||||
panic(fmt.Errorf("message oracle.v1.QueryParamsRequest does not contain field %s", fd.FullName()))
|
||||
}
|
||||
}
|
||||
|
||||
// Clear clears the field such that a subsequent Has call reports false.
|
||||
//
|
||||
// Clearing an extension field clears both the extension type and value
|
||||
// associated with the given field number.
|
||||
//
|
||||
// Clear is a mutating operation and unsafe for concurrent use.
|
||||
func (x *fastReflection_QueryParamsRequest) Clear(fd protoreflect.FieldDescriptor) {
|
||||
switch fd.FullName() {
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryParamsRequest"))
|
||||
}
|
||||
panic(fmt.Errorf("message oracle.v1.QueryParamsRequest does not contain field %s", fd.FullName()))
|
||||
}
|
||||
}
|
||||
|
||||
// Get retrieves the value for a field.
|
||||
//
|
||||
// For unpopulated scalars, it returns the default value, where
|
||||
// the default value of a bytes scalar is guaranteed to be a copy.
|
||||
// For unpopulated composite types, it returns an empty, read-only view
|
||||
// of the value; to obtain a mutable reference, use Mutable.
|
||||
func (x *fastReflection_QueryParamsRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value {
|
||||
switch descriptor.FullName() {
|
||||
default:
|
||||
if descriptor.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryParamsRequest"))
|
||||
}
|
||||
panic(fmt.Errorf("message oracle.v1.QueryParamsRequest does not contain field %s", descriptor.FullName()))
|
||||
}
|
||||
}
|
||||
|
||||
// Set stores the value for a field.
|
||||
//
|
||||
// For a field belonging to a oneof, it implicitly clears any other field
|
||||
// that may be currently set within the same oneof.
|
||||
// For extension fields, it implicitly stores the provided ExtensionType.
|
||||
// When setting a composite type, it is unspecified whether the stored value
|
||||
// aliases the source's memory in any way. If the composite value is an
|
||||
// empty, read-only value, then it panics.
|
||||
//
|
||||
// Set is a mutating operation and unsafe for concurrent use.
|
||||
func (x *fastReflection_QueryParamsRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) {
|
||||
switch fd.FullName() {
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryParamsRequest"))
|
||||
}
|
||||
panic(fmt.Errorf("message oracle.v1.QueryParamsRequest does not contain field %s", fd.FullName()))
|
||||
}
|
||||
}
|
||||
|
||||
// Mutable returns a mutable reference to a composite type.
|
||||
//
|
||||
// If the field is unpopulated, it may allocate a composite value.
|
||||
// For a field belonging to a oneof, it implicitly clears any other field
|
||||
// that may be currently set within the same oneof.
|
||||
// For extension fields, it implicitly stores the provided ExtensionType
|
||||
// if not already stored.
|
||||
// It panics if the field does not contain a composite type.
|
||||
//
|
||||
// Mutable is a mutating operation and unsafe for concurrent use.
|
||||
func (x *fastReflection_QueryParamsRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value {
|
||||
switch fd.FullName() {
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryParamsRequest"))
|
||||
}
|
||||
panic(fmt.Errorf("message oracle.v1.QueryParamsRequest does not contain field %s", fd.FullName()))
|
||||
}
|
||||
}
|
||||
|
||||
// NewField returns a new value that is assignable to the field
|
||||
// for the given descriptor. For scalars, this returns the default value.
|
||||
// For lists, maps, and messages, this returns a new, empty, mutable value.
|
||||
func (x *fastReflection_QueryParamsRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value {
|
||||
switch fd.FullName() {
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryParamsRequest"))
|
||||
}
|
||||
panic(fmt.Errorf("message oracle.v1.QueryParamsRequest does not contain field %s", fd.FullName()))
|
||||
}
|
||||
}
|
||||
|
||||
// WhichOneof reports which field within the oneof is populated,
|
||||
// returning nil if none are populated.
|
||||
// It panics if the oneof descriptor does not belong to this message.
|
||||
func (x *fastReflection_QueryParamsRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor {
|
||||
switch d.FullName() {
|
||||
default:
|
||||
panic(fmt.Errorf("%s is not a oneof field in oracle.v1.QueryParamsRequest", d.FullName()))
|
||||
}
|
||||
panic("unreachable")
|
||||
}
|
||||
|
||||
// GetUnknown retrieves the entire list of unknown fields.
|
||||
// The caller may only mutate the contents of the RawFields
|
||||
// if the mutated bytes are stored back into the message with SetUnknown.
|
||||
func (x *fastReflection_QueryParamsRequest) GetUnknown() protoreflect.RawFields {
|
||||
return x.unknownFields
|
||||
}
|
||||
|
||||
// SetUnknown stores an entire list of unknown fields.
|
||||
// The raw fields must be syntactically valid according to the wire format.
|
||||
// An implementation may panic if this is not the case.
|
||||
// Once stored, the caller must not mutate the content of the RawFields.
|
||||
// An empty RawFields may be passed to clear the fields.
|
||||
//
|
||||
// SetUnknown is a mutating operation and unsafe for concurrent use.
|
||||
func (x *fastReflection_QueryParamsRequest) SetUnknown(fields protoreflect.RawFields) {
|
||||
x.unknownFields = fields
|
||||
}
|
||||
|
||||
// IsValid reports whether the message is valid.
|
||||
//
|
||||
// An invalid message is an empty, read-only value.
|
||||
//
|
||||
// An invalid message often corresponds to a nil pointer of the concrete
|
||||
// message type, but the details are implementation dependent.
|
||||
// Validity is not part of the protobuf data model, and may not
|
||||
// be preserved in marshaling or other operations.
|
||||
func (x *fastReflection_QueryParamsRequest) IsValid() bool {
|
||||
return x != nil
|
||||
}
|
||||
|
||||
// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations.
|
||||
// This method may return nil.
|
||||
//
|
||||
// The returned methods type is identical to
|
||||
// "google.golang.org/protobuf/runtime/protoiface".Methods.
|
||||
// Consult the protoiface package documentation for details.
|
||||
func (x *fastReflection_QueryParamsRequest) ProtoMethods() *protoiface.Methods {
|
||||
size := func(input protoiface.SizeInput) protoiface.SizeOutput {
|
||||
x := input.Message.Interface().(*QueryParamsRequest)
|
||||
if x == nil {
|
||||
return protoiface.SizeOutput{
|
||||
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
||||
Size: 0,
|
||||
}
|
||||
}
|
||||
options := runtime.SizeInputToOptions(input)
|
||||
_ = options
|
||||
var n int
|
||||
var l int
|
||||
_ = l
|
||||
if x.unknownFields != nil {
|
||||
n += len(x.unknownFields)
|
||||
}
|
||||
return protoiface.SizeOutput{
|
||||
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
||||
Size: n,
|
||||
}
|
||||
}
|
||||
|
||||
marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) {
|
||||
x := input.Message.Interface().(*QueryParamsRequest)
|
||||
if x == nil {
|
||||
return protoiface.MarshalOutput{
|
||||
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
||||
Buf: input.Buf,
|
||||
}, nil
|
||||
}
|
||||
options := runtime.MarshalInputToOptions(input)
|
||||
_ = options
|
||||
size := options.Size(x)
|
||||
dAtA := make([]byte, size)
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if x.unknownFields != nil {
|
||||
i -= len(x.unknownFields)
|
||||
copy(dAtA[i:], x.unknownFields)
|
||||
}
|
||||
if input.Buf != nil {
|
||||
input.Buf = append(input.Buf, dAtA...)
|
||||
} else {
|
||||
input.Buf = dAtA
|
||||
}
|
||||
return protoiface.MarshalOutput{
|
||||
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
||||
Buf: input.Buf,
|
||||
}, nil
|
||||
}
|
||||
unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) {
|
||||
x := input.Message.Interface().(*QueryParamsRequest)
|
||||
if x == nil {
|
||||
return protoiface.UnmarshalOutput{
|
||||
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
||||
Flags: input.Flags,
|
||||
}, nil
|
||||
}
|
||||
options := runtime.UnmarshalInputToOptions(input)
|
||||
_ = options
|
||||
dAtA := input.Buf
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
for iNdEx < l {
|
||||
preIndex := iNdEx
|
||||
var wire uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
wire |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
fieldNum := int32(wire >> 3)
|
||||
wireType := int(wire & 0x7)
|
||||
if wireType == 4 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsRequest: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := runtime.Skip(dAtA[iNdEx:])
|
||||
if err != nil {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
|
||||
}
|
||||
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
|
||||
}
|
||||
if (iNdEx + skippy) > l {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||
}
|
||||
if !options.DiscardUnknown {
|
||||
x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...)
|
||||
}
|
||||
iNdEx += skippy
|
||||
}
|
||||
}
|
||||
|
||||
if iNdEx > l {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||
}
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil
|
||||
}
|
||||
return &protoiface.Methods{
|
||||
NoUnkeyedLiterals: struct{}{},
|
||||
Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown,
|
||||
Size: size,
|
||||
Marshal: marshal,
|
||||
Unmarshal: unmarshal,
|
||||
Merge: nil,
|
||||
CheckInitialized: nil,
|
||||
}
|
||||
}
|
||||
|
||||
var (
|
||||
md_QueryParamsResponse protoreflect.MessageDescriptor
|
||||
fd_QueryParamsResponse_params protoreflect.FieldDescriptor
|
||||
)
|
||||
|
||||
func init() {
|
||||
file_oracle_v1_query_proto_init()
|
||||
md_QueryParamsResponse = File_oracle_v1_query_proto.Messages().ByName("QueryParamsResponse")
|
||||
fd_QueryParamsResponse_params = md_QueryParamsResponse.Fields().ByName("params")
|
||||
}
|
||||
|
||||
var _ protoreflect.Message = (*fastReflection_QueryParamsResponse)(nil)
|
||||
|
||||
type fastReflection_QueryParamsResponse QueryParamsResponse
|
||||
|
||||
func (x *QueryParamsResponse) ProtoReflect() protoreflect.Message {
|
||||
return (*fastReflection_QueryParamsResponse)(x)
|
||||
}
|
||||
|
||||
func (x *QueryParamsResponse) slowProtoReflect() protoreflect.Message {
|
||||
mi := &file_oracle_v1_query_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
var _fastReflection_QueryParamsResponse_messageType fastReflection_QueryParamsResponse_messageType
|
||||
var _ protoreflect.MessageType = fastReflection_QueryParamsResponse_messageType{}
|
||||
|
||||
type fastReflection_QueryParamsResponse_messageType struct{}
|
||||
|
||||
func (x fastReflection_QueryParamsResponse_messageType) Zero() protoreflect.Message {
|
||||
return (*fastReflection_QueryParamsResponse)(nil)
|
||||
}
|
||||
func (x fastReflection_QueryParamsResponse_messageType) New() protoreflect.Message {
|
||||
return new(fastReflection_QueryParamsResponse)
|
||||
}
|
||||
func (x fastReflection_QueryParamsResponse_messageType) Descriptor() protoreflect.MessageDescriptor {
|
||||
return md_QueryParamsResponse
|
||||
}
|
||||
|
||||
// Descriptor returns message descriptor, which contains only the protobuf
|
||||
// type information for the message.
|
||||
func (x *fastReflection_QueryParamsResponse) Descriptor() protoreflect.MessageDescriptor {
|
||||
return md_QueryParamsResponse
|
||||
}
|
||||
|
||||
// Type returns the message type, which encapsulates both Go and protobuf
|
||||
// type information. If the Go type information is not needed,
|
||||
// it is recommended that the message descriptor be used instead.
|
||||
func (x *fastReflection_QueryParamsResponse) Type() protoreflect.MessageType {
|
||||
return _fastReflection_QueryParamsResponse_messageType
|
||||
}
|
||||
|
||||
// New returns a newly allocated and mutable empty message.
|
||||
func (x *fastReflection_QueryParamsResponse) New() protoreflect.Message {
|
||||
return new(fastReflection_QueryParamsResponse)
|
||||
}
|
||||
|
||||
// Interface unwraps the message reflection interface and
|
||||
// returns the underlying ProtoMessage interface.
|
||||
func (x *fastReflection_QueryParamsResponse) Interface() protoreflect.ProtoMessage {
|
||||
return (*QueryParamsResponse)(x)
|
||||
}
|
||||
|
||||
// Range iterates over every populated field in an undefined order,
|
||||
// calling f for each field descriptor and value encountered.
|
||||
// Range returns immediately if f returns false.
|
||||
// While iterating, mutating operations may only be performed
|
||||
// on the current field descriptor.
|
||||
func (x *fastReflection_QueryParamsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {
|
||||
if x.Params != nil {
|
||||
value := protoreflect.ValueOfMessage(x.Params.ProtoReflect())
|
||||
if !f(fd_QueryParamsResponse_params, value) {
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Has reports whether a field is populated.
|
||||
//
|
||||
// Some fields have the property of nullability where it is possible to
|
||||
// distinguish between the default value of a field and whether the field
|
||||
// was explicitly populated with the default value. Singular message fields,
|
||||
// member fields of a oneof, and proto2 scalar fields are nullable. Such
|
||||
// fields are populated only if explicitly set.
|
||||
//
|
||||
// In other cases (aside from the nullable cases above),
|
||||
// a proto3 scalar field is populated if it contains a non-zero value, and
|
||||
// a repeated field is populated if it is non-empty.
|
||||
func (x *fastReflection_QueryParamsResponse) Has(fd protoreflect.FieldDescriptor) bool {
|
||||
switch fd.FullName() {
|
||||
case "oracle.v1.QueryParamsResponse.params":
|
||||
return x.Params != nil
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryParamsResponse"))
|
||||
}
|
||||
panic(fmt.Errorf("message oracle.v1.QueryParamsResponse does not contain field %s", fd.FullName()))
|
||||
}
|
||||
}
|
||||
|
||||
// Clear clears the field such that a subsequent Has call reports false.
|
||||
//
|
||||
// Clearing an extension field clears both the extension type and value
|
||||
// associated with the given field number.
|
||||
//
|
||||
// Clear is a mutating operation and unsafe for concurrent use.
|
||||
func (x *fastReflection_QueryParamsResponse) Clear(fd protoreflect.FieldDescriptor) {
|
||||
switch fd.FullName() {
|
||||
case "oracle.v1.QueryParamsResponse.params":
|
||||
x.Params = nil
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryParamsResponse"))
|
||||
}
|
||||
panic(fmt.Errorf("message oracle.v1.QueryParamsResponse does not contain field %s", fd.FullName()))
|
||||
}
|
||||
}
|
||||
|
||||
// Get retrieves the value for a field.
|
||||
//
|
||||
// For unpopulated scalars, it returns the default value, where
|
||||
// the default value of a bytes scalar is guaranteed to be a copy.
|
||||
// For unpopulated composite types, it returns an empty, read-only view
|
||||
// of the value; to obtain a mutable reference, use Mutable.
|
||||
func (x *fastReflection_QueryParamsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value {
|
||||
switch descriptor.FullName() {
|
||||
case "oracle.v1.QueryParamsResponse.params":
|
||||
value := x.Params
|
||||
return protoreflect.ValueOfMessage(value.ProtoReflect())
|
||||
default:
|
||||
if descriptor.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryParamsResponse"))
|
||||
}
|
||||
panic(fmt.Errorf("message oracle.v1.QueryParamsResponse does not contain field %s", descriptor.FullName()))
|
||||
}
|
||||
}
|
||||
|
||||
// Set stores the value for a field.
|
||||
//
|
||||
// For a field belonging to a oneof, it implicitly clears any other field
|
||||
// that may be currently set within the same oneof.
|
||||
// For extension fields, it implicitly stores the provided ExtensionType.
|
||||
// When setting a composite type, it is unspecified whether the stored value
|
||||
// aliases the source's memory in any way. If the composite value is an
|
||||
// empty, read-only value, then it panics.
|
||||
//
|
||||
// Set is a mutating operation and unsafe for concurrent use.
|
||||
func (x *fastReflection_QueryParamsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) {
|
||||
switch fd.FullName() {
|
||||
case "oracle.v1.QueryParamsResponse.params":
|
||||
x.Params = value.Message().Interface().(*Params)
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryParamsResponse"))
|
||||
}
|
||||
panic(fmt.Errorf("message oracle.v1.QueryParamsResponse does not contain field %s", fd.FullName()))
|
||||
}
|
||||
}
|
||||
|
||||
// Mutable returns a mutable reference to a composite type.
|
||||
//
|
||||
// If the field is unpopulated, it may allocate a composite value.
|
||||
// For a field belonging to a oneof, it implicitly clears any other field
|
||||
// that may be currently set within the same oneof.
|
||||
// For extension fields, it implicitly stores the provided ExtensionType
|
||||
// if not already stored.
|
||||
// It panics if the field does not contain a composite type.
|
||||
//
|
||||
// Mutable is a mutating operation and unsafe for concurrent use.
|
||||
func (x *fastReflection_QueryParamsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value {
|
||||
switch fd.FullName() {
|
||||
case "oracle.v1.QueryParamsResponse.params":
|
||||
if x.Params == nil {
|
||||
x.Params = new(Params)
|
||||
}
|
||||
return protoreflect.ValueOfMessage(x.Params.ProtoReflect())
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryParamsResponse"))
|
||||
}
|
||||
panic(fmt.Errorf("message oracle.v1.QueryParamsResponse does not contain field %s", fd.FullName()))
|
||||
}
|
||||
}
|
||||
|
||||
// NewField returns a new value that is assignable to the field
|
||||
// for the given descriptor. For scalars, this returns the default value.
|
||||
// For lists, maps, and messages, this returns a new, empty, mutable value.
|
||||
func (x *fastReflection_QueryParamsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value {
|
||||
switch fd.FullName() {
|
||||
case "oracle.v1.QueryParamsResponse.params":
|
||||
m := new(Params)
|
||||
return protoreflect.ValueOfMessage(m.ProtoReflect())
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryParamsResponse"))
|
||||
}
|
||||
panic(fmt.Errorf("message oracle.v1.QueryParamsResponse does not contain field %s", fd.FullName()))
|
||||
}
|
||||
}
|
||||
|
||||
// WhichOneof reports which field within the oneof is populated,
|
||||
// returning nil if none are populated.
|
||||
// It panics if the oneof descriptor does not belong to this message.
|
||||
func (x *fastReflection_QueryParamsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor {
|
||||
switch d.FullName() {
|
||||
default:
|
||||
panic(fmt.Errorf("%s is not a oneof field in oracle.v1.QueryParamsResponse", d.FullName()))
|
||||
}
|
||||
panic("unreachable")
|
||||
}
|
||||
|
||||
// GetUnknown retrieves the entire list of unknown fields.
|
||||
// The caller may only mutate the contents of the RawFields
|
||||
// if the mutated bytes are stored back into the message with SetUnknown.
|
||||
func (x *fastReflection_QueryParamsResponse) GetUnknown() protoreflect.RawFields {
|
||||
return x.unknownFields
|
||||
}
|
||||
|
||||
// SetUnknown stores an entire list of unknown fields.
|
||||
// The raw fields must be syntactically valid according to the wire format.
|
||||
// An implementation may panic if this is not the case.
|
||||
// Once stored, the caller must not mutate the content of the RawFields.
|
||||
// An empty RawFields may be passed to clear the fields.
|
||||
//
|
||||
// SetUnknown is a mutating operation and unsafe for concurrent use.
|
||||
func (x *fastReflection_QueryParamsResponse) SetUnknown(fields protoreflect.RawFields) {
|
||||
x.unknownFields = fields
|
||||
}
|
||||
|
||||
// IsValid reports whether the message is valid.
|
||||
//
|
||||
// An invalid message is an empty, read-only value.
|
||||
//
|
||||
// An invalid message often corresponds to a nil pointer of the concrete
|
||||
// message type, but the details are implementation dependent.
|
||||
// Validity is not part of the protobuf data model, and may not
|
||||
// be preserved in marshaling or other operations.
|
||||
func (x *fastReflection_QueryParamsResponse) IsValid() bool {
|
||||
return x != nil
|
||||
}
|
||||
|
||||
// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations.
|
||||
// This method may return nil.
|
||||
//
|
||||
// The returned methods type is identical to
|
||||
// "google.golang.org/protobuf/runtime/protoiface".Methods.
|
||||
// Consult the protoiface package documentation for details.
|
||||
func (x *fastReflection_QueryParamsResponse) ProtoMethods() *protoiface.Methods {
|
||||
size := func(input protoiface.SizeInput) protoiface.SizeOutput {
|
||||
x := input.Message.Interface().(*QueryParamsResponse)
|
||||
if x == nil {
|
||||
return protoiface.SizeOutput{
|
||||
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
||||
Size: 0,
|
||||
}
|
||||
}
|
||||
options := runtime.SizeInputToOptions(input)
|
||||
_ = options
|
||||
var n int
|
||||
var l int
|
||||
_ = l
|
||||
if x.Params != nil {
|
||||
l = options.Size(x.Params)
|
||||
n += 1 + l + runtime.Sov(uint64(l))
|
||||
}
|
||||
if x.unknownFields != nil {
|
||||
n += len(x.unknownFields)
|
||||
}
|
||||
return protoiface.SizeOutput{
|
||||
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
||||
Size: n,
|
||||
}
|
||||
}
|
||||
|
||||
marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) {
|
||||
x := input.Message.Interface().(*QueryParamsResponse)
|
||||
if x == nil {
|
||||
return protoiface.MarshalOutput{
|
||||
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
||||
Buf: input.Buf,
|
||||
}, nil
|
||||
}
|
||||
options := runtime.MarshalInputToOptions(input)
|
||||
_ = options
|
||||
size := options.Size(x)
|
||||
dAtA := make([]byte, size)
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if x.unknownFields != nil {
|
||||
i -= len(x.unknownFields)
|
||||
copy(dAtA[i:], x.unknownFields)
|
||||
}
|
||||
if x.Params != nil {
|
||||
encoded, err := options.Marshal(x.Params)
|
||||
if err != nil {
|
||||
return protoiface.MarshalOutput{
|
||||
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
||||
Buf: input.Buf,
|
||||
}, err
|
||||
}
|
||||
i -= len(encoded)
|
||||
copy(dAtA[i:], encoded)
|
||||
i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded)))
|
||||
i--
|
||||
dAtA[i] = 0xa
|
||||
}
|
||||
if input.Buf != nil {
|
||||
input.Buf = append(input.Buf, dAtA...)
|
||||
} else {
|
||||
input.Buf = dAtA
|
||||
}
|
||||
return protoiface.MarshalOutput{
|
||||
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
||||
Buf: input.Buf,
|
||||
}, nil
|
||||
}
|
||||
unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) {
|
||||
x := input.Message.Interface().(*QueryParamsResponse)
|
||||
if x == nil {
|
||||
return protoiface.UnmarshalOutput{
|
||||
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
||||
Flags: input.Flags,
|
||||
}, nil
|
||||
}
|
||||
options := runtime.UnmarshalInputToOptions(input)
|
||||
_ = options
|
||||
dAtA := input.Buf
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
for iNdEx < l {
|
||||
preIndex := iNdEx
|
||||
var wire uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
wire |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
fieldNum := int32(wire >> 3)
|
||||
wireType := int(wire & 0x7)
|
||||
if wireType == 4 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
if wireType != 2 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Params", wireType)
|
||||
}
|
||||
var msglen int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
msglen |= int(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if msglen < 0 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
|
||||
}
|
||||
postIndex := iNdEx + msglen
|
||||
if postIndex < 0 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
|
||||
}
|
||||
if postIndex > l {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||
}
|
||||
if x.Params == nil {
|
||||
x.Params = &Params{}
|
||||
}
|
||||
if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); err != nil {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
|
||||
}
|
||||
iNdEx = postIndex
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := runtime.Skip(dAtA[iNdEx:])
|
||||
if err != nil {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
|
||||
}
|
||||
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
|
||||
}
|
||||
if (iNdEx + skippy) > l {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||
}
|
||||
if !options.DiscardUnknown {
|
||||
x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...)
|
||||
}
|
||||
iNdEx += skippy
|
||||
}
|
||||
}
|
||||
|
||||
if iNdEx > l {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||
}
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil
|
||||
}
|
||||
return &protoiface.Methods{
|
||||
NoUnkeyedLiterals: struct{}{},
|
||||
Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown,
|
||||
Size: size,
|
||||
Marshal: marshal,
|
||||
Unmarshal: unmarshal,
|
||||
Merge: nil,
|
||||
CheckInitialized: nil,
|
||||
}
|
||||
}
|
||||
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.27.0
|
||||
// protoc (unknown)
|
||||
// source: oracle/v1/query.proto
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// QueryParamsRequest is the request type for the Query/Params RPC method.
|
||||
type QueryParamsRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
}
|
||||
|
||||
func (x *QueryParamsRequest) Reset() {
|
||||
*x = QueryParamsRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_oracle_v1_query_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *QueryParamsRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*QueryParamsRequest) ProtoMessage() {}
|
||||
|
||||
// Deprecated: Use QueryParamsRequest.ProtoReflect.Descriptor instead.
|
||||
func (*QueryParamsRequest) Descriptor() ([]byte, []int) {
|
||||
return file_oracle_v1_query_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
// QueryParamsResponse is the response type for the Query/Params RPC method.
|
||||
type QueryParamsResponse struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// params defines the parameters of the module.
|
||||
Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"`
|
||||
}
|
||||
|
||||
func (x *QueryParamsResponse) Reset() {
|
||||
*x = QueryParamsResponse{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_oracle_v1_query_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *QueryParamsResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*QueryParamsResponse) ProtoMessage() {}
|
||||
|
||||
// Deprecated: Use QueryParamsResponse.ProtoReflect.Descriptor instead.
|
||||
func (*QueryParamsResponse) Descriptor() ([]byte, []int) {
|
||||
return file_oracle_v1_query_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *QueryParamsResponse) GetParams() *Params {
|
||||
if x != nil {
|
||||
return x.Params
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_oracle_v1_query_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_oracle_v1_query_proto_rawDesc = []byte{
|
||||
0x0a, 0x15, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x71, 0x75, 0x65, 0x72,
|
||||
0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e,
|
||||
0x76, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61,
|
||||
0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x1a, 0x17, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x6e, 0x65,
|
||||
0x73, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x14, 0x0a, 0x12, 0x51, 0x75, 0x65,
|
||||
0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22,
|
||||
0x40, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65,
|
||||
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x29, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73,
|
||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e,
|
||||
0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d,
|
||||
0x73, 0x32, 0x6b, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x62, 0x0a, 0x06, 0x50, 0x61,
|
||||
0x72, 0x61, 0x6d, 0x73, 0x12, 0x1d, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31,
|
||||
0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75,
|
||||
0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e,
|
||||
0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f,
|
||||
0x6e, 0x73, 0x65, 0x22, 0x19, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x12, 0x11, 0x2f, 0x6f, 0x72,
|
||||
0x61, 0x63, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x8f,
|
||||
0x01, 0x0a, 0x0d, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31,
|
||||
0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2d,
|
||||
0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e,
|
||||
0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6f, 0x72, 0x61, 0x63, 0x6c,
|
||||
0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03,
|
||||
0x4f, 0x58, 0x58, 0xaa, 0x02, 0x09, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca,
|
||||
0x02, 0x09, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x15, 0x4f, 0x72,
|
||||
0x61, 0x63, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64,
|
||||
0x61, 0x74, 0x61, 0xea, 0x02, 0x0a, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31,
|
||||
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_oracle_v1_query_proto_rawDescOnce sync.Once
|
||||
file_oracle_v1_query_proto_rawDescData = file_oracle_v1_query_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_oracle_v1_query_proto_rawDescGZIP() []byte {
|
||||
file_oracle_v1_query_proto_rawDescOnce.Do(func() {
|
||||
file_oracle_v1_query_proto_rawDescData = protoimpl.X.CompressGZIP(file_oracle_v1_query_proto_rawDescData)
|
||||
})
|
||||
return file_oracle_v1_query_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_oracle_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
||||
var file_oracle_v1_query_proto_goTypes = []interface{}{
|
||||
(*QueryParamsRequest)(nil), // 0: oracle.v1.QueryParamsRequest
|
||||
(*QueryParamsResponse)(nil), // 1: oracle.v1.QueryParamsResponse
|
||||
(*Params)(nil), // 2: oracle.v1.Params
|
||||
}
|
||||
var file_oracle_v1_query_proto_depIdxs = []int32{
|
||||
2, // 0: oracle.v1.QueryParamsResponse.params:type_name -> oracle.v1.Params
|
||||
0, // 1: oracle.v1.Query.Params:input_type -> oracle.v1.QueryParamsRequest
|
||||
1, // 2: oracle.v1.Query.Params:output_type -> oracle.v1.QueryParamsResponse
|
||||
2, // [2:3] is the sub-list for method output_type
|
||||
1, // [1:2] is the sub-list for method input_type
|
||||
1, // [1:1] is the sub-list for extension type_name
|
||||
1, // [1:1] is the sub-list for extension extendee
|
||||
0, // [0:1] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_oracle_v1_query_proto_init() }
|
||||
func file_oracle_v1_query_proto_init() {
|
||||
if File_oracle_v1_query_proto != nil {
|
||||
return
|
||||
}
|
||||
file_oracle_v1_genesis_proto_init()
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_oracle_v1_query_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*QueryParamsRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_oracle_v1_query_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*QueryParamsResponse); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_oracle_v1_query_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 2,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_oracle_v1_query_proto_goTypes,
|
||||
DependencyIndexes: file_oracle_v1_query_proto_depIdxs,
|
||||
MessageInfos: file_oracle_v1_query_proto_msgTypes,
|
||||
}.Build()
|
||||
File_oracle_v1_query_proto = out.File
|
||||
file_oracle_v1_query_proto_rawDesc = nil
|
||||
file_oracle_v1_query_proto_goTypes = nil
|
||||
file_oracle_v1_query_proto_depIdxs = nil
|
||||
}
|
@ -1,111 +0,0 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.3.0
|
||||
// - protoc (unknown)
|
||||
// source: oracle/v1/query.proto
|
||||
|
||||
package oraclev1
|
||||
|
||||
import (
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.32.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion7
|
||||
|
||||
const (
|
||||
Query_Params_FullMethodName = "/oracle.v1.Query/Params"
|
||||
)
|
||||
|
||||
// QueryClient is the client API for Query service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
type QueryClient interface {
|
||||
// Params queries all parameters of the module.
|
||||
Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error)
|
||||
}
|
||||
|
||||
type queryClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewQueryClient(cc grpc.ClientConnInterface) QueryClient {
|
||||
return &queryClient{cc}
|
||||
}
|
||||
|
||||
func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) {
|
||||
out := new(QueryParamsResponse)
|
||||
err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// QueryServer is the server API for Query service.
|
||||
// All implementations must embed UnimplementedQueryServer
|
||||
// for forward compatibility
|
||||
type QueryServer interface {
|
||||
// Params queries all parameters of the module.
|
||||
Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error)
|
||||
mustEmbedUnimplementedQueryServer()
|
||||
}
|
||||
|
||||
// UnimplementedQueryServer must be embedded to have forward compatible implementations.
|
||||
type UnimplementedQueryServer struct {
|
||||
}
|
||||
|
||||
func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Params not implemented")
|
||||
}
|
||||
func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {}
|
||||
|
||||
// UnsafeQueryServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to QueryServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeQueryServer interface {
|
||||
mustEmbedUnimplementedQueryServer()
|
||||
}
|
||||
|
||||
func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) {
|
||||
s.RegisterService(&Query_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(QueryParamsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(QueryServer).Params(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Query_Params_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// Query_ServiceDesc is the grpc.ServiceDesc for Query service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var Query_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "oracle.v1.Query",
|
||||
HandlerType: (*QueryServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "Params",
|
||||
Handler: _Query_Params_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "oracle/v1/query.proto",
|
||||
}
|
@ -1,342 +0,0 @@
|
||||
// Code generated by protoc-gen-go-cosmos-orm. DO NOT EDIT.
|
||||
|
||||
package oraclev1
|
||||
|
||||
import (
|
||||
context "context"
|
||||
ormlist "cosmossdk.io/orm/model/ormlist"
|
||||
ormtable "cosmossdk.io/orm/model/ormtable"
|
||||
ormerrors "cosmossdk.io/orm/types/ormerrors"
|
||||
)
|
||||
|
||||
type BalanceTable interface {
|
||||
Insert(ctx context.Context, balance *Balance) error
|
||||
Update(ctx context.Context, balance *Balance) error
|
||||
Save(ctx context.Context, balance *Balance) error
|
||||
Delete(ctx context.Context, balance *Balance) error
|
||||
Has(ctx context.Context, account string) (found bool, err error)
|
||||
// Get returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found.
|
||||
Get(ctx context.Context, account string) (*Balance, error)
|
||||
List(ctx context.Context, prefixKey BalanceIndexKey, opts ...ormlist.Option) (BalanceIterator, error)
|
||||
ListRange(ctx context.Context, from, to BalanceIndexKey, opts ...ormlist.Option) (BalanceIterator, error)
|
||||
DeleteBy(ctx context.Context, prefixKey BalanceIndexKey) error
|
||||
DeleteRange(ctx context.Context, from, to BalanceIndexKey) error
|
||||
|
||||
doNotImplement()
|
||||
}
|
||||
|
||||
type BalanceIterator struct {
|
||||
ormtable.Iterator
|
||||
}
|
||||
|
||||
func (i BalanceIterator) Value() (*Balance, error) {
|
||||
var balance Balance
|
||||
err := i.UnmarshalMessage(&balance)
|
||||
return &balance, err
|
||||
}
|
||||
|
||||
type BalanceIndexKey interface {
|
||||
id() uint32
|
||||
values() []interface{}
|
||||
balanceIndexKey()
|
||||
}
|
||||
|
||||
// primary key starting index..
|
||||
type BalancePrimaryKey = BalanceAccountIndexKey
|
||||
|
||||
type BalanceAccountIndexKey struct {
|
||||
vs []interface{}
|
||||
}
|
||||
|
||||
func (x BalanceAccountIndexKey) id() uint32 { return 0 }
|
||||
func (x BalanceAccountIndexKey) values() []interface{} { return x.vs }
|
||||
func (x BalanceAccountIndexKey) balanceIndexKey() {}
|
||||
|
||||
func (this BalanceAccountIndexKey) WithAccount(account string) BalanceAccountIndexKey {
|
||||
this.vs = []interface{}{account}
|
||||
return this
|
||||
}
|
||||
|
||||
type BalanceAmountIndexKey struct {
|
||||
vs []interface{}
|
||||
}
|
||||
|
||||
func (x BalanceAmountIndexKey) id() uint32 { return 1 }
|
||||
func (x BalanceAmountIndexKey) values() []interface{} { return x.vs }
|
||||
func (x BalanceAmountIndexKey) balanceIndexKey() {}
|
||||
|
||||
func (this BalanceAmountIndexKey) WithAmount(amount uint64) BalanceAmountIndexKey {
|
||||
this.vs = []interface{}{amount}
|
||||
return this
|
||||
}
|
||||
|
||||
type balanceTable struct {
|
||||
table ormtable.Table
|
||||
}
|
||||
|
||||
func (this balanceTable) Insert(ctx context.Context, balance *Balance) error {
|
||||
return this.table.Insert(ctx, balance)
|
||||
}
|
||||
|
||||
func (this balanceTable) Update(ctx context.Context, balance *Balance) error {
|
||||
return this.table.Update(ctx, balance)
|
||||
}
|
||||
|
||||
func (this balanceTable) Save(ctx context.Context, balance *Balance) error {
|
||||
return this.table.Save(ctx, balance)
|
||||
}
|
||||
|
||||
func (this balanceTable) Delete(ctx context.Context, balance *Balance) error {
|
||||
return this.table.Delete(ctx, balance)
|
||||
}
|
||||
|
||||
func (this balanceTable) Has(ctx context.Context, account string) (found bool, err error) {
|
||||
return this.table.PrimaryKey().Has(ctx, account)
|
||||
}
|
||||
|
||||
func (this balanceTable) Get(ctx context.Context, account string) (*Balance, error) {
|
||||
var balance Balance
|
||||
found, err := this.table.PrimaryKey().Get(ctx, &balance, account)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !found {
|
||||
return nil, ormerrors.NotFound
|
||||
}
|
||||
return &balance, nil
|
||||
}
|
||||
|
||||
func (this balanceTable) List(ctx context.Context, prefixKey BalanceIndexKey, opts ...ormlist.Option) (BalanceIterator, error) {
|
||||
it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...)
|
||||
return BalanceIterator{it}, err
|
||||
}
|
||||
|
||||
func (this balanceTable) ListRange(ctx context.Context, from, to BalanceIndexKey, opts ...ormlist.Option) (BalanceIterator, error) {
|
||||
it, err := this.table.GetIndexByID(from.id()).ListRange(ctx, from.values(), to.values(), opts...)
|
||||
return BalanceIterator{it}, err
|
||||
}
|
||||
|
||||
func (this balanceTable) DeleteBy(ctx context.Context, prefixKey BalanceIndexKey) error {
|
||||
return this.table.GetIndexByID(prefixKey.id()).DeleteBy(ctx, prefixKey.values()...)
|
||||
}
|
||||
|
||||
func (this balanceTable) DeleteRange(ctx context.Context, from, to BalanceIndexKey) error {
|
||||
return this.table.GetIndexByID(from.id()).DeleteRange(ctx, from.values(), to.values())
|
||||
}
|
||||
|
||||
func (this balanceTable) doNotImplement() {}
|
||||
|
||||
var _ BalanceTable = balanceTable{}
|
||||
|
||||
func NewBalanceTable(db ormtable.Schema) (BalanceTable, error) {
|
||||
table := db.GetTable(&Balance{})
|
||||
if table == nil {
|
||||
return nil, ormerrors.TableNotFound.Wrap(string((&Balance{}).ProtoReflect().Descriptor().FullName()))
|
||||
}
|
||||
return balanceTable{table}, nil
|
||||
}
|
||||
|
||||
type AccountTable interface {
|
||||
Insert(ctx context.Context, account *Account) error
|
||||
Update(ctx context.Context, account *Account) error
|
||||
Save(ctx context.Context, account *Account) error
|
||||
Delete(ctx context.Context, account *Account) error
|
||||
Has(ctx context.Context, id uint64) (found bool, err error)
|
||||
// Get returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found.
|
||||
Get(ctx context.Context, id uint64) (*Account, error)
|
||||
HasByAddressChainNetwork(ctx context.Context, address string, chain string, network string) (found bool, err error)
|
||||
// GetByAddressChainNetwork returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found.
|
||||
GetByAddressChainNetwork(ctx context.Context, address string, chain string, network string) (*Account, error)
|
||||
List(ctx context.Context, prefixKey AccountIndexKey, opts ...ormlist.Option) (AccountIterator, error)
|
||||
ListRange(ctx context.Context, from, to AccountIndexKey, opts ...ormlist.Option) (AccountIterator, error)
|
||||
DeleteBy(ctx context.Context, prefixKey AccountIndexKey) error
|
||||
DeleteRange(ctx context.Context, from, to AccountIndexKey) error
|
||||
|
||||
doNotImplement()
|
||||
}
|
||||
|
||||
type AccountIterator struct {
|
||||
ormtable.Iterator
|
||||
}
|
||||
|
||||
func (i AccountIterator) Value() (*Account, error) {
|
||||
var account Account
|
||||
err := i.UnmarshalMessage(&account)
|
||||
return &account, err
|
||||
}
|
||||
|
||||
type AccountIndexKey interface {
|
||||
id() uint32
|
||||
values() []interface{}
|
||||
accountIndexKey()
|
||||
}
|
||||
|
||||
// primary key starting index..
|
||||
type AccountPrimaryKey = AccountIdIndexKey
|
||||
|
||||
type AccountIdIndexKey struct {
|
||||
vs []interface{}
|
||||
}
|
||||
|
||||
func (x AccountIdIndexKey) id() uint32 { return 0 }
|
||||
func (x AccountIdIndexKey) values() []interface{} { return x.vs }
|
||||
func (x AccountIdIndexKey) accountIndexKey() {}
|
||||
|
||||
func (this AccountIdIndexKey) WithId(id uint64) AccountIdIndexKey {
|
||||
this.vs = []interface{}{id}
|
||||
return this
|
||||
}
|
||||
|
||||
type AccountAddressChainNetworkIndexKey struct {
|
||||
vs []interface{}
|
||||
}
|
||||
|
||||
func (x AccountAddressChainNetworkIndexKey) id() uint32 { return 1 }
|
||||
func (x AccountAddressChainNetworkIndexKey) values() []interface{} { return x.vs }
|
||||
func (x AccountAddressChainNetworkIndexKey) accountIndexKey() {}
|
||||
|
||||
func (this AccountAddressChainNetworkIndexKey) WithAddress(address string) AccountAddressChainNetworkIndexKey {
|
||||
this.vs = []interface{}{address}
|
||||
return this
|
||||
}
|
||||
|
||||
func (this AccountAddressChainNetworkIndexKey) WithAddressChain(address string, chain string) AccountAddressChainNetworkIndexKey {
|
||||
this.vs = []interface{}{address, chain}
|
||||
return this
|
||||
}
|
||||
|
||||
func (this AccountAddressChainNetworkIndexKey) WithAddressChainNetwork(address string, chain string, network string) AccountAddressChainNetworkIndexKey {
|
||||
this.vs = []interface{}{address, chain, network}
|
||||
return this
|
||||
}
|
||||
|
||||
type accountTable struct {
|
||||
table ormtable.Table
|
||||
}
|
||||
|
||||
func (this accountTable) Insert(ctx context.Context, account *Account) error {
|
||||
return this.table.Insert(ctx, account)
|
||||
}
|
||||
|
||||
func (this accountTable) Update(ctx context.Context, account *Account) error {
|
||||
return this.table.Update(ctx, account)
|
||||
}
|
||||
|
||||
func (this accountTable) Save(ctx context.Context, account *Account) error {
|
||||
return this.table.Save(ctx, account)
|
||||
}
|
||||
|
||||
func (this accountTable) Delete(ctx context.Context, account *Account) error {
|
||||
return this.table.Delete(ctx, account)
|
||||
}
|
||||
|
||||
func (this accountTable) Has(ctx context.Context, id uint64) (found bool, err error) {
|
||||
return this.table.PrimaryKey().Has(ctx, id)
|
||||
}
|
||||
|
||||
func (this accountTable) Get(ctx context.Context, id uint64) (*Account, error) {
|
||||
var account Account
|
||||
found, err := this.table.PrimaryKey().Get(ctx, &account, id)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !found {
|
||||
return nil, ormerrors.NotFound
|
||||
}
|
||||
return &account, nil
|
||||
}
|
||||
|
||||
func (this accountTable) HasByAddressChainNetwork(ctx context.Context, address string, chain string, network string) (found bool, err error) {
|
||||
return this.table.GetIndexByID(1).(ormtable.UniqueIndex).Has(ctx,
|
||||
address,
|
||||
chain,
|
||||
network,
|
||||
)
|
||||
}
|
||||
|
||||
func (this accountTable) GetByAddressChainNetwork(ctx context.Context, address string, chain string, network string) (*Account, error) {
|
||||
var account Account
|
||||
found, err := this.table.GetIndexByID(1).(ormtable.UniqueIndex).Get(ctx, &account,
|
||||
address,
|
||||
chain,
|
||||
network,
|
||||
)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !found {
|
||||
return nil, ormerrors.NotFound
|
||||
}
|
||||
return &account, nil
|
||||
}
|
||||
|
||||
func (this accountTable) List(ctx context.Context, prefixKey AccountIndexKey, opts ...ormlist.Option) (AccountIterator, error) {
|
||||
it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...)
|
||||
return AccountIterator{it}, err
|
||||
}
|
||||
|
||||
func (this accountTable) ListRange(ctx context.Context, from, to AccountIndexKey, opts ...ormlist.Option) (AccountIterator, error) {
|
||||
it, err := this.table.GetIndexByID(from.id()).ListRange(ctx, from.values(), to.values(), opts...)
|
||||
return AccountIterator{it}, err
|
||||
}
|
||||
|
||||
func (this accountTable) DeleteBy(ctx context.Context, prefixKey AccountIndexKey) error {
|
||||
return this.table.GetIndexByID(prefixKey.id()).DeleteBy(ctx, prefixKey.values()...)
|
||||
}
|
||||
|
||||
func (this accountTable) DeleteRange(ctx context.Context, from, to AccountIndexKey) error {
|
||||
return this.table.GetIndexByID(from.id()).DeleteRange(ctx, from.values(), to.values())
|
||||
}
|
||||
|
||||
func (this accountTable) doNotImplement() {}
|
||||
|
||||
var _ AccountTable = accountTable{}
|
||||
|
||||
func NewAccountTable(db ormtable.Schema) (AccountTable, error) {
|
||||
table := db.GetTable(&Account{})
|
||||
if table == nil {
|
||||
return nil, ormerrors.TableNotFound.Wrap(string((&Account{}).ProtoReflect().Descriptor().FullName()))
|
||||
}
|
||||
return accountTable{table}, nil
|
||||
}
|
||||
|
||||
type StateStore interface {
|
||||
BalanceTable() BalanceTable
|
||||
AccountTable() AccountTable
|
||||
|
||||
doNotImplement()
|
||||
}
|
||||
|
||||
type stateStore struct {
|
||||
balance BalanceTable
|
||||
account AccountTable
|
||||
}
|
||||
|
||||
func (x stateStore) BalanceTable() BalanceTable {
|
||||
return x.balance
|
||||
}
|
||||
|
||||
func (x stateStore) AccountTable() AccountTable {
|
||||
return x.account
|
||||
}
|
||||
|
||||
func (stateStore) doNotImplement() {}
|
||||
|
||||
var _ StateStore = stateStore{}
|
||||
|
||||
func NewStateStore(db ormtable.Schema) (StateStore, error) {
|
||||
balanceTable, err := NewBalanceTable(db)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
accountTable, err := NewAccountTable(db)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return stateStore{
|
||||
balanceTable,
|
||||
accountTable,
|
||||
}, nil
|
||||
}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,115 +0,0 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.3.0
|
||||
// - protoc (unknown)
|
||||
// source: oracle/v1/tx.proto
|
||||
|
||||
package oraclev1
|
||||
|
||||
import (
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.32.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion7
|
||||
|
||||
const (
|
||||
Msg_UpdateParams_FullMethodName = "/oracle.v1.Msg/UpdateParams"
|
||||
)
|
||||
|
||||
// MsgClient is the client API for Msg service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
type MsgClient interface {
|
||||
// UpdateParams defines a governance operation for updating the parameters.
|
||||
//
|
||||
// Since: cosmos-sdk 0.47
|
||||
UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error)
|
||||
}
|
||||
|
||||
type msgClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewMsgClient(cc grpc.ClientConnInterface) MsgClient {
|
||||
return &msgClient{cc}
|
||||
}
|
||||
|
||||
func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) {
|
||||
out := new(MsgUpdateParamsResponse)
|
||||
err := c.cc.Invoke(ctx, Msg_UpdateParams_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// MsgServer is the server API for Msg service.
|
||||
// All implementations must embed UnimplementedMsgServer
|
||||
// for forward compatibility
|
||||
type MsgServer interface {
|
||||
// UpdateParams defines a governance operation for updating the parameters.
|
||||
//
|
||||
// Since: cosmos-sdk 0.47
|
||||
UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error)
|
||||
mustEmbedUnimplementedMsgServer()
|
||||
}
|
||||
|
||||
// UnimplementedMsgServer must be embedded to have forward compatible implementations.
|
||||
type UnimplementedMsgServer struct {
|
||||
}
|
||||
|
||||
func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented")
|
||||
}
|
||||
func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {}
|
||||
|
||||
// UnsafeMsgServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to MsgServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeMsgServer interface {
|
||||
mustEmbedUnimplementedMsgServer()
|
||||
}
|
||||
|
||||
func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) {
|
||||
s.RegisterService(&Msg_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(MsgUpdateParams)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(MsgServer).UpdateParams(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Msg_UpdateParams_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// Msg_ServiceDesc is the grpc.ServiceDesc for Msg service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var Msg_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "oracle.v1.Msg",
|
||||
HandlerType: (*MsgServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "UpdateParams",
|
||||
Handler: _Msg_UpdateParams_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "oracle/v1/tx.proto",
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -19,9 +19,9 @@ import (
|
||||
const _ = grpc.SupportPackageIsVersion7
|
||||
|
||||
const (
|
||||
Query_Params_FullMethodName = "/vault.v1.Query/Params"
|
||||
Query_BuildTx_FullMethodName = "/vault.v1.Query/BuildTx"
|
||||
Query_Sync_FullMethodName = "/vault.v1.Query/Sync"
|
||||
Query_Params_FullMethodName = "/vault.v1.Query/Params"
|
||||
Query_Schema_FullMethodName = "/vault.v1.Query/Schema"
|
||||
Query_Sync_FullMethodName = "/vault.v1.Query/Sync"
|
||||
)
|
||||
|
||||
// QueryClient is the client API for Query service.
|
||||
@ -30,8 +30,9 @@ 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)
|
||||
// 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 +55,9 @@ 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
|
||||
}
|
||||
@ -78,8 +79,9 @@ 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)
|
||||
// Sync queries the DID document by its id. And returns the required PKL
|
||||
// information
|
||||
Sync(context.Context, *SyncRequest) (*SyncResponse, error)
|
||||
@ -93,8 +95,8 @@ 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) Sync(context.Context, *SyncRequest) (*SyncResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Sync not implemented")
|
||||
@ -130,20 +132,20 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
@ -178,8 +180,8 @@ var Query_ServiceDesc = grpc.ServiceDesc{
|
||||
Handler: _Query_Params_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "BuildTx",
|
||||
Handler: _Query_BuildTx_Handler,
|
||||
MethodName: "Schema",
|
||||
Handler: _Query_Schema_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "Sync",
|
||||
|
18
app/app.go
18
app/app.go
@ -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)
|
||||
@ -668,14 +663,6 @@ func NewChainApp(
|
||||
app.NFTKeeper,
|
||||
)
|
||||
|
||||
// Create the oracle Keeper
|
||||
app.OracleKeeper = oraclekeeper.NewKeeper(
|
||||
appCodec,
|
||||
sdkruntime.NewKVStoreService(keys[oracletypes.StoreKey]),
|
||||
logger,
|
||||
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
|
||||
)
|
||||
|
||||
// Create the globalfee keeper
|
||||
app.GlobalFeeKeeper = globalfeekeeper.NewKeeper(
|
||||
appCodec,
|
||||
@ -938,7 +925,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 +976,6 @@ func NewChainApp(
|
||||
vaulttypes.ModuleName,
|
||||
macaroontypes.ModuleName,
|
||||
servicetypes.ModuleName,
|
||||
oracletypes.ModuleName,
|
||||
)
|
||||
|
||||
app.ModuleManager.SetOrderEndBlockers(
|
||||
@ -1013,7 +998,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 +1029,6 @@ func NewChainApp(
|
||||
vaulttypes.ModuleName,
|
||||
macaroontypes.ModuleName,
|
||||
servicetypes.ModuleName,
|
||||
oracletypes.ModuleName,
|
||||
}
|
||||
app.ModuleManager.SetOrderInitGenesis(genesisModuleOrder...)
|
||||
app.ModuleManager.SetOrderExportGenesis(genesisModuleOrder...)
|
||||
@ -1508,7 +1491,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/router"
|
||||
)
|
||||
|
||||
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("/", router.Home)
|
||||
e.GET("/allocate", router.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)
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
BIN
cmd/hway/bun.lockb
Executable file
BIN
cmd/hway/bun.lockb
Executable file
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()
|
||||
},
|
||||
}
|
||||
}
|
@ -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/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.UseSession)
|
||||
routes.RegisterProxyViews(s)
|
||||
routes.RegisterProxyAPI(s)
|
||||
workers.Serve(s)
|
||||
}
|
||||
|
@ -1 +0,0 @@
|
||||
package handlers
|
@ -1 +0,0 @@
|
||||
package handlers
|
@ -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/router"
|
||||
)
|
||||
|
||||
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("/", router.Home)
|
||||
s.GET("/login", router.Login)
|
||||
s.GET("/register", router.Register)
|
||||
s.GET("/profile", router.Profile)
|
||||
s.GET("/authorize", router.Authorize)
|
||||
return s
|
||||
}
|
||||
|
||||
func (s *Server) Start() {
|
||||
if err := s.Echo.Start(":1323"); err != http.ErrServerClosed {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
@ -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)
|
19
cmd/motr/main.go
Normal file
19
cmd/motr/main.go
Normal file
@ -0,0 +1,19 @@
|
||||
//go:build js && wasm
|
||||
// +build js,wasm
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/labstack/echo/v4"
|
||||
"github.com/onsonr/sonr/cmd/motr/fetch"
|
||||
"github.com/onsonr/sonr/internal/ctx"
|
||||
"github.com/onsonr/sonr/workers/routes"
|
||||
)
|
||||
|
||||
func main() {
|
||||
e := echo.New()
|
||||
e.Use(ctx.UseSession)
|
||||
routes.RegisterClientViews(e)
|
||||
routes.RegisterClientAPI(e)
|
||||
fetch.Serve(e)
|
||||
}
|
@ -1,43 +0,0 @@
|
||||
package state
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
|
||||
"github.com/go-webauthn/webauthn/protocol"
|
||||
"github.com/labstack/echo/v4"
|
||||
)
|
||||
|
||||
func CheckSubjectIsValid(e echo.Context) error {
|
||||
credentialID := e.FormValue("credentialID")
|
||||
return e.JSON(200, credentialID)
|
||||
}
|
||||
|
||||
func HandleCredentialAssertion(e echo.Context) error {
|
||||
return e.JSON(200, "HandleCredentialAssertion")
|
||||
}
|
||||
|
||||
func HandleCredentialCreation(e echo.Context) error {
|
||||
// Get the serialized credential data from the form
|
||||
credentialDataJSON := e.FormValue("credentialData")
|
||||
|
||||
// Deserialize the JSON into a temporary struct
|
||||
var ccr protocol.CredentialCreationResponse
|
||||
err := json.Unmarshal([]byte(credentialDataJSON), &ccr)
|
||||
if err != nil {
|
||||
return e.JSON(500, err.Error())
|
||||
}
|
||||
//
|
||||
// // Parse the CredentialCreationResponse
|
||||
// parsedData, err := ccr.Parse()
|
||||
// if err != nil {
|
||||
// return e.JSON(500, err.Error())
|
||||
// }
|
||||
//
|
||||
// // Create the Credential
|
||||
// // credential := orm.NewCredential(parsedData, e.Request().Host, "")
|
||||
//
|
||||
// // Set additional fields
|
||||
// credential.Controller = "" // Set this to the appropriate controller value
|
||||
return e.JSON(200, fmt.Sprintf("REGISTER: %s", string(ccr.ID)))
|
||||
}
|
@ -1 +0,0 @@
|
||||
package state
|
@ -1 +0,0 @@
|
||||
package state
|
@ -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,3 +0,0 @@
|
||||
FROM scratch
|
||||
ENTRYPOINT ["/hway"]
|
||||
COPY hway /
|
@ -1,3 +0,0 @@
|
||||
FROM scratch
|
||||
ENTRYPOINT ["/sonrd"]
|
||||
COPY sonrd /
|
70
devbox.json
70
devbox.json
@ -1,17 +1,6 @@
|
||||
{
|
||||
"$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",
|
||||
"mprocs@latest",
|
||||
"skate@latest",
|
||||
"templ@latest",
|
||||
"cloudflared@latest",
|
||||
"process-compose@latest"
|
||||
],
|
||||
"packages": ["go@1.22", "bun@latest", "ipfs@latest", "templ@latest"],
|
||||
"env": {
|
||||
"GOPATH": "$HOME/go",
|
||||
"PATH": "./build:$HOME/go/bin:$PATH",
|
||||
@ -31,51 +20,18 @@
|
||||
},
|
||||
"shell": {
|
||||
"scripts": {
|
||||
"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"
|
||||
],
|
||||
"gen:templ": [
|
||||
"make templ"
|
||||
],
|
||||
"start": [
|
||||
"process-compose up -f ./deploy/process-compose.yaml"
|
||||
],
|
||||
"stop": [
|
||||
"process-compose down -f ./deploy/process-compose.yaml"
|
||||
],
|
||||
"start:testnet": [
|
||||
"make sh-testnet"
|
||||
],
|
||||
"start:hway": [
|
||||
"make nebula",
|
||||
"make hway",
|
||||
"./build/hway start"
|
||||
]
|
||||
"build:docker": ["make local-image"],
|
||||
"build:hway": ["make hway-build"],
|
||||
"build:nebula": ["make nebula-build"],
|
||||
"build:motr": ["make motr-build"],
|
||||
"build:sonrd": ["make motr-build", "make build"],
|
||||
"build": ["make motr-build", "make build", "make hway-build"],
|
||||
"gen:proto": ["rm -rf ./pkg/nebula/node_modules", "make proto-gen"],
|
||||
"gen:pkl": ["make gen-pkl"],
|
||||
"gen:templ": ["make gen-templ"],
|
||||
"start": ["process-compose up -f ./deploy/process-compose.yaml"],
|
||||
"stop": ["process-compose down -f ./deploy/process-compose.yaml"],
|
||||
"start:testnet": ["make sh-testnet"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
192
devbox.lock
192
devbox.lock
@ -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",
|
||||
@ -193,156 +145,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"
|
||||
},
|
||||
"mprocs@latest": {
|
||||
"last_modified": "2024-09-10T15:01:03Z",
|
||||
"resolved": "github:NixOS/nixpkgs/5ed627539ac84809c78b2dd6d26a5cebeb5ae269#mprocs",
|
||||
"source": "devbox-search",
|
||||
"version": "0.7.1",
|
||||
"systems": {
|
||||
"aarch64-darwin": {
|
||||
"outputs": [
|
||||
{
|
||||
"name": "out",
|
||||
"path": "/nix/store/sri1rv6phxhcvgwknd3zv98km6s1740b-mprocs-0.7.1",
|
||||
"default": true
|
||||
}
|
||||
],
|
||||
"store_path": "/nix/store/sri1rv6phxhcvgwknd3zv98km6s1740b-mprocs-0.7.1"
|
||||
},
|
||||
"aarch64-linux": {
|
||||
"outputs": [
|
||||
{
|
||||
"name": "out",
|
||||
"path": "/nix/store/7q84qjs24xd9jf2wvn7f39gvxsn5n33q-mprocs-0.7.1",
|
||||
"default": true
|
||||
}
|
||||
],
|
||||
"store_path": "/nix/store/7q84qjs24xd9jf2wvn7f39gvxsn5n33q-mprocs-0.7.1"
|
||||
},
|
||||
"x86_64-darwin": {
|
||||
"outputs": [
|
||||
{
|
||||
"name": "out",
|
||||
"path": "/nix/store/47j50bgr6mxlvdjddh0li810wkld34qb-mprocs-0.7.1",
|
||||
"default": true
|
||||
}
|
||||
],
|
||||
"store_path": "/nix/store/47j50bgr6mxlvdjddh0li810wkld34qb-mprocs-0.7.1"
|
||||
},
|
||||
"x86_64-linux": {
|
||||
"outputs": [
|
||||
{
|
||||
"name": "out",
|
||||
"path": "/nix/store/6vrvg4jhv2yg8y326dmrxsz3yddkqgzq-mprocs-0.7.1",
|
||||
"default": true
|
||||
}
|
||||
],
|
||||
"store_path": "/nix/store/6vrvg4jhv2yg8y326dmrxsz3yddkqgzq-mprocs-0.7.1"
|
||||
}
|
||||
}
|
||||
},
|
||||
"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",
|
||||
|
@ -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
|
3
go.mod
3
go.mod
@ -70,7 +70,6 @@ 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/segmentio/ksuid v1.0.4
|
||||
@ -82,6 +81,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 +232,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
|
||||
|
2
go.sum
2
go.sum
@ -2048,6 +2048,8 @@ github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8
|
||||
github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=
|
||||
github.com/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,51 +0,0 @@
|
||||
package auth
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
)
|
||||
|
||||
const (
|
||||
OriginMacroonCaveat MacroonCaveat = "origin"
|
||||
ScopesMacroonCaveat MacroonCaveat = "scopes"
|
||||
SubjectMacroonCaveat MacroonCaveat = "subject"
|
||||
ExpMacroonCaveat MacroonCaveat = "exp"
|
||||
TokenMacroonCaveat MacroonCaveat = "token"
|
||||
)
|
||||
|
||||
type MacroonCaveat string
|
||||
|
||||
func (c MacroonCaveat) Equal(other string) bool {
|
||||
return string(c) == other
|
||||
}
|
||||
|
||||
func (c MacroonCaveat) String() string {
|
||||
return string(c)
|
||||
}
|
||||
|
||||
func (c MacroonCaveat) Verify(value string) error {
|
||||
switch c {
|
||||
case OriginMacroonCaveat:
|
||||
return nil
|
||||
case ScopesMacroonCaveat:
|
||||
return nil
|
||||
case SubjectMacroonCaveat:
|
||||
return nil
|
||||
case ExpMacroonCaveat:
|
||||
// Check if the expiration time is still valid
|
||||
exp, err := time.Parse(time.RFC3339, value)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if time.Now().After(exp) {
|
||||
return fmt.Errorf("expired")
|
||||
}
|
||||
return nil
|
||||
case TokenMacroonCaveat:
|
||||
return nil
|
||||
default:
|
||||
return fmt.Errorf("unknown caveat: %s", c)
|
||||
}
|
||||
}
|
||||
|
||||
var MacroonCaveats = []MacroonCaveat{OriginMacroonCaveat, ScopesMacroonCaveat, SubjectMacroonCaveat, ExpMacroonCaveat, TokenMacroonCaveat}
|
44
internal/ctx/channel.go
Normal file
44
internal/ctx/channel.go
Normal file
@ -0,0 +1,44 @@
|
||||
//go:build js && wasm
|
||||
|
||||
package ctx
|
||||
|
||||
import (
|
||||
"syscall/js"
|
||||
|
||||
"github.com/labstack/echo/v4"
|
||||
)
|
||||
|
||||
type BroadcastContext struct {
|
||||
echo.Context
|
||||
Channel js.Value
|
||||
}
|
||||
|
||||
func (c *BroadcastContext) BroadcastMessage(message string) {
|
||||
c.Channel.Call("postMessage", message)
|
||||
}
|
||||
|
||||
type JSHandler func(this js.Value, args []js.Value) interface{}
|
||||
|
||||
func UseBroadcastChannel(channelName string, handler JSHandler) echo.MiddlewareFunc {
|
||||
var channel js.Value
|
||||
|
||||
return func(next echo.HandlerFunc) echo.HandlerFunc {
|
||||
return func(c echo.Context) error {
|
||||
if channel.IsUndefined() {
|
||||
channel = js.Global().Get("BroadcastChannel").New(channelName)
|
||||
channel.Call("addEventListener", "message", handler)
|
||||
}
|
||||
|
||||
cc := &BroadcastContext{
|
||||
Context: c,
|
||||
Channel: channel,
|
||||
}
|
||||
return next(cc)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func PostBroadcastMessage(c echo.Context, message string) {
|
||||
cc := c.(*BroadcastContext)
|
||||
cc.BroadcastMessage(message)
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package session
|
||||
package ctx
|
||||
|
||||
import (
|
||||
"net/http"
|
68
internal/ctx/headers.go
Normal file
68
internal/ctx/headers.go
Normal file
@ -0,0 +1,68 @@
|
||||
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"`
|
||||
}
|
||||
|
||||
// ╭───────────────────────────────────────────────────────────╮
|
||||
// │ Response Headers │
|
||||
// ╰───────────────────────────────────────────────────────────╯
|
||||
|
||||
type ResponseHeaders struct {
|
||||
// HTMX Specific
|
||||
HXLocation *string `header:"HX-Location"`
|
||||
HXPushURL *string `header:"HX-Push-Url"`
|
||||
HXRedirect *string `header:"HX-Redirect"`
|
||||
HXRefresh *string `header:"HX-Refresh"`
|
||||
HXReplaceURL *string `header:"HX-Replace-Url"`
|
||||
HXReswap *string `header:"HX-Reswap"`
|
||||
HXRetarget *string `header:"HX-Retarget"`
|
||||
HXReselect *string `header:"HX-Reselect"`
|
||||
HXTrigger *string `header:"HX-Trigger"`
|
||||
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"`
|
||||
}
|
@ -1,12 +1,59 @@
|
||||
package auth
|
||||
package ctx
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/labstack/echo/v4"
|
||||
"gopkg.in/macaroon.v2"
|
||||
)
|
||||
|
||||
const (
|
||||
OriginMacroonCaveat MacroonCaveat = "origin"
|
||||
ScopesMacroonCaveat MacroonCaveat = "scopes"
|
||||
SubjectMacroonCaveat MacroonCaveat = "subject"
|
||||
ExpMacroonCaveat MacroonCaveat = "exp"
|
||||
TokenMacroonCaveat MacroonCaveat = "token"
|
||||
)
|
||||
|
||||
var MacroonCaveats = []MacroonCaveat{OriginMacroonCaveat, ScopesMacroonCaveat, SubjectMacroonCaveat, ExpMacroonCaveat, TokenMacroonCaveat}
|
||||
|
||||
type MacroonCaveat string
|
||||
|
||||
func (c MacroonCaveat) Equal(other string) bool {
|
||||
return string(c) == other
|
||||
}
|
||||
|
||||
func (c MacroonCaveat) String() string {
|
||||
return string(c)
|
||||
}
|
||||
|
||||
func (c MacroonCaveat) Verify(value string) error {
|
||||
switch c {
|
||||
case OriginMacroonCaveat:
|
||||
return nil
|
||||
case ScopesMacroonCaveat:
|
||||
return nil
|
||||
case SubjectMacroonCaveat:
|
||||
return nil
|
||||
case ExpMacroonCaveat:
|
||||
// Check if the expiration time is still valid
|
||||
exp, err := time.Parse(time.RFC3339, value)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if time.Now().After(exp) {
|
||||
return fmt.Errorf("expired")
|
||||
}
|
||||
return nil
|
||||
case TokenMacroonCaveat:
|
||||
return nil
|
||||
default:
|
||||
return fmt.Errorf("unknown caveat: %s", c)
|
||||
}
|
||||
}
|
||||
|
||||
func MacaroonMiddleware(secretKeyStr string, location string) echo.MiddlewareFunc {
|
||||
secretKey := []byte(secretKeyStr)
|
||||
return func(next echo.HandlerFunc) echo.HandlerFunc {
|
25
internal/ctx/render.go
Normal file
25
internal/ctx/render.go
Normal file
@ -0,0 +1,25 @@
|
||||
package ctx
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
|
||||
"github.com/a-h/templ"
|
||||
"github.com/labstack/echo/v4"
|
||||
)
|
||||
|
||||
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
|
||||
}
|
@ -1,10 +1,8 @@
|
||||
package session
|
||||
package ctx
|
||||
|
||||
import (
|
||||
"github.com/labstack/echo/v4"
|
||||
"github.com/segmentio/ksuid"
|
||||
|
||||
"github.com/onsonr/sonr/internal/headers"
|
||||
)
|
||||
|
||||
// GetSession returns the current Session
|
||||
@ -16,7 +14,7 @@ func GetSession(c echo.Context) *Session {
|
||||
func UseSession(next echo.HandlerFunc) echo.HandlerFunc {
|
||||
return func(c echo.Context) error {
|
||||
sc := initSession(c)
|
||||
headers := new(headers.RequestHeaders)
|
||||
headers := new(RequestHeaders)
|
||||
err := sc.Bind(headers)
|
||||
if err != nil {
|
||||
return err
|
34
internal/dwn/embed.go
Normal file
34
internal/dwn/embed.go
Normal file
@ -0,0 +1,34 @@
|
||||
package dwn
|
||||
|
||||
import (
|
||||
_ "embed"
|
||||
|
||||
"github.com/ipfs/boxo/files"
|
||||
"github.com/onsonr/sonr/internal/dwn/gen"
|
||||
"github.com/onsonr/sonr/nebula/components/index"
|
||||
)
|
||||
|
||||
//go:embed app.wasm
|
||||
var dwnWasmData []byte
|
||||
|
||||
//go:embed sw.js
|
||||
var swJSData []byte
|
||||
|
||||
var (
|
||||
dwnWasmFile = files.NewBytesFile(dwnWasmData)
|
||||
swJSFile = files.NewBytesFile(swJSData)
|
||||
)
|
||||
|
||||
// NewVaultDirectory creates a new directory with the default files
|
||||
func NewVaultDirectory(cnfg *gen.Config) (files.Node, error) {
|
||||
idxFile, err := index.BuildFile(cnfg)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
fileMap := map[string]files.Node{
|
||||
"sw.js": swJSFile,
|
||||
"app.wasm": dwnWasmFile,
|
||||
"index.html": idxFile,
|
||||
}
|
||||
return files.NewMapDirectory(fileMap), nil
|
||||
}
|
14
internal/dwn/gen/Config.pkl.go
Normal file
14
internal/dwn/gen/Config.pkl.go
Normal file
@ -0,0 +1,14 @@
|
||||
// Code generated from Pkl module `dwngen`. DO NOT EDIT.
|
||||
package gen
|
||||
|
||||
type Config struct {
|
||||
Ipfs *IPFS `pkl:"ipfs" json:"ipfs,omitempty"`
|
||||
|
||||
Sonr *Sonr `pkl:"sonr" json:"sonr,omitempty"`
|
||||
|
||||
Motr *Motr `pkl:"motr" json:"motr,omitempty"`
|
||||
|
||||
Schema *Schema `pkl:"schema" json:"schema,omitempty"`
|
||||
|
||||
ProxyUrl string `pkl:"proxyUrl" json:"proxyUrl,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
|
||||
}
|
8
internal/dwn/gen/IPFS.pkl.go
Normal file
8
internal/dwn/gen/IPFS.pkl.go
Normal file
@ -0,0 +1,8 @@
|
||||
// Code generated from Pkl module `dwngen`. DO NOT EDIT.
|
||||
package gen
|
||||
|
||||
type IPFS struct {
|
||||
ApiUrl string `pkl:"apiUrl" json:"apiUrl,omitempty"`
|
||||
|
||||
GatewayUrl string `pkl:"gatewayUrl" json:"gatewayUrl,omitempty"`
|
||||
}
|
10
internal/dwn/gen/Motr.pkl.go
Normal file
10
internal/dwn/gen/Motr.pkl.go
Normal file
@ -0,0 +1,10 @@
|
||||
// Code generated from Pkl module `dwngen`. DO NOT EDIT.
|
||||
package gen
|
||||
|
||||
type Motr struct {
|
||||
Keyshare string `pkl:"keyshare" json:"keyshare,omitempty"`
|
||||
|
||||
Address string `pkl:"address" json:"address,omitempty"`
|
||||
|
||||
Origin string `pkl:"origin" json:"origin,omitempty"`
|
||||
}
|
22
internal/dwn/gen/Schema.pkl.go
Normal file
22
internal/dwn/gen/Schema.pkl.go
Normal file
@ -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"`
|
||||
}
|
14
internal/dwn/gen/Sonr.pkl.go
Normal file
14
internal/dwn/gen/Sonr.pkl.go
Normal file
@ -0,0 +1,14 @@
|
||||
// Code generated from Pkl module `dwngen`. DO NOT EDIT.
|
||||
package gen
|
||||
|
||||
type Sonr struct {
|
||||
ApiUrl string `pkl:"apiUrl" json:"apiUrl,omitempty"`
|
||||
|
||||
GrpcUrl string `pkl:"grpcUrl" json:"grpcUrl,omitempty"`
|
||||
|
||||
RpcUrl string `pkl:"rpcUrl" json:"rpcUrl,omitempty"`
|
||||
|
||||
WebSocketUrl string `pkl:"webSocketUrl" json:"webSocketUrl,omitempty"`
|
||||
|
||||
ChainId string `pkl:"chainId" json:"chainId,omitempty"`
|
||||
}
|
13
internal/dwn/gen/init.pkl.go
Normal file
13
internal/dwn/gen/init.pkl.go
Normal file
@ -0,0 +1,13 @@
|
||||
// Code generated from Pkl module `dwngen`. DO NOT EDIT.
|
||||
package gen
|
||||
|
||||
import "github.com/apple/pkl-go/pkl"
|
||||
|
||||
func init() {
|
||||
pkl.RegisterMapping("dwngen", Dwngen{})
|
||||
pkl.RegisterMapping("dwngen#Config", Config{})
|
||||
pkl.RegisterMapping("dwngen#IPFS", IPFS{})
|
||||
pkl.RegisterMapping("dwngen#Sonr", Sonr{})
|
||||
pkl.RegisterMapping("dwngen#Motr", Motr{})
|
||||
pkl.RegisterMapping("dwngen#Schema", Schema{})
|
||||
}
|
@ -14,3 +14,9 @@ self.addEventListener("install", (event) => {
|
||||
self.addEventListener("activate", (event) => {
|
||||
event.waitUntil(clients.claim());
|
||||
});
|
||||
|
||||
self.addEventListener("canmakepayment", function (e) {
|
||||
e.respondWith(new Promise(function (resolve, reject) {
|
||||
resolve(true);
|
||||
}));
|
||||
});
|
@ -1,31 +0,0 @@
|
||||
package 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,30 +0,0 @@
|
||||
package headers
|
||||
|
||||
type ResponseHeaders struct {
|
||||
// HTMX Specific
|
||||
HXLocation *string `header:"HX-Location"`
|
||||
HXPushURL *string `header:"HX-Push-Url"`
|
||||
HXRedirect *string `header:"HX-Redirect"`
|
||||
HXRefresh *string `header:"HX-Refresh"`
|
||||
HXReplaceURL *string `header:"HX-Replace-Url"`
|
||||
HXReswap *string `header:"HX-Reswap"`
|
||||
HXRetarget *string `header:"HX-Retarget"`
|
||||
HXReselect *string `header:"HX-Reselect"`
|
||||
HXTrigger *string `header:"HX-Trigger"`
|
||||
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"`
|
||||
}
|
@ -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 {
|
94
internal/orm/models/marketing.go
Normal file
94
internal/orm/models/marketing.go
Normal file
@ -0,0 +1,94 @@
|
||||
package models
|
||||
|
||||
type Button struct {
|
||||
Text string
|
||||
Href string
|
||||
}
|
||||
|
||||
type Feature struct {
|
||||
Title string
|
||||
Desc string
|
||||
Icon *string
|
||||
Image *Image
|
||||
}
|
||||
|
||||
type Image struct {
|
||||
Src string
|
||||
Width string
|
||||
Height string
|
||||
}
|
||||
|
||||
type Stat struct {
|
||||
Value string
|
||||
Denom string
|
||||
Label string
|
||||
}
|
||||
|
||||
type Technology struct {
|
||||
Title string
|
||||
Desc string
|
||||
Icon *string
|
||||
Image *Image
|
||||
}
|
||||
|
||||
type Testimonial struct {
|
||||
FullName string
|
||||
Username string
|
||||
Avatar string
|
||||
Quote string
|
||||
}
|
||||
|
||||
// ╭───────────────────────────────────────────────────────────╮
|
||||
// │ HomePage Models │
|
||||
// ╰───────────────────────────────────────────────────────────╯
|
||||
|
||||
type Hero struct {
|
||||
TitleFirst string
|
||||
TitleEmphasis string
|
||||
TitleSecond string
|
||||
Subtitle string
|
||||
PrimaryButton *Button
|
||||
SecondaryButton *Button
|
||||
Image *Image
|
||||
Stats []*Stat
|
||||
}
|
||||
|
||||
type Highlights struct {
|
||||
Heading string
|
||||
Subtitle string
|
||||
Features []*Feature
|
||||
}
|
||||
|
||||
type Mission struct {
|
||||
Eyebrow string
|
||||
Heading string
|
||||
Subtitle string
|
||||
Experience *Feature
|
||||
Compliance *Feature
|
||||
Interoperability *Feature
|
||||
Standards []*Feature // Display 6 Standards applied by the Sonr Network
|
||||
}
|
||||
|
||||
type Architecture struct {
|
||||
Heading string
|
||||
Subtitle string
|
||||
Primary *Technology
|
||||
Secondary *Technology
|
||||
Tertiary *Technology
|
||||
Quaternary *Technology
|
||||
Quinary *Technology
|
||||
}
|
||||
|
||||
type Lowlights struct {
|
||||
Heading string
|
||||
Quotes []*Testimonial
|
||||
}
|
||||
|
||||
type CallToAction struct {
|
||||
Logo *Image
|
||||
Heading string
|
||||
Subtitle string
|
||||
Primary *Button
|
||||
Secondary *Button
|
||||
Partners []*Image
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user