From 1cf08522a51dcca9b44242e3a3903a4d96069e46 Mon Sep 17 00:00:00 2001
From: jaeseung-bae <119839167+jaeseung-bae@users.noreply.github.com>
Date: Tue, 7 May 2024 17:02:45 +0900
Subject: [PATCH 01/10] ci: add v0.49.x for backport mergify (#1356)
* ci: add backport mergify ci for v0.49.x
* chore: update changelog
---
.mergify.yml | 8 ++++++++
CHANGELOG.md | 1 +
2 files changed, 9 insertions(+)
diff --git a/.mergify.yml b/.mergify.yml
index 159f6e9d07..4bbb32d0f0 100644
--- a/.mergify.yml
+++ b/.mergify.yml
@@ -16,6 +16,14 @@ pull_request_rules:
commit_message_template: |
{{ title }} (#{{ number }})
{{ body }}
+ - name: backport patches to v0.49.x branch
+ conditions:
+ - base=main
+ - label=backport/v0.49.x
+ actions:
+ backport:
+ branches:
+ - release/v0.49.x
- name: backport patches to v0.48.x branch
conditions:
- base=main
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a77b61fa19..9a7698b343 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -94,6 +94,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (ci) [\#1078](https://github.com/Finschia/finschia-sdk/pull/1078) fix tag comments in github actions workflow docker.yml
* (repo) [\#1157](https://github.com/Finschia/finschia-sdk/pull/1157) setup CODEOWNERS and backport action
* (ci) [\#1160](https://github.com/Finschia/finschia-sdk/pull/1160) remove autopr ci
+* (repo) [\#1356](https://github.com/Finschia/finschia-sdk/pull/1356) add v0.49.x for backport action
### Document Updates
* (docs) [\#1059](https://github.com/Finschia/finschia-sdk/pull/1059) create ERRORS.md for x/module
From 1c272c99f254e80575476b635fc80475194db59a Mon Sep 17 00:00:00 2001
From: Jaeseung Lee <41176085+tkxkd0159@users.noreply.github.com>
Date: Tue, 7 May 2024 21:26:19 +0900
Subject: [PATCH 02/10] feat: add role-based access control for bridge (#1358)
* add submitting role proposal feature
* feat: addVote
* feat: role proposal confirmation logic
* add gRPC for RBAC
* fix checking trustLevel condition
* validate role metadata during initialization
* add invariants for metadata
* delete expired proposal at begin blocker
* add memStore and halting feature
* remove redundant gRPC queries
* fix endblock logic
* add Params test
* add dummy guardian for testing
* remove redundant invariants
* set bridge switch at missing parts
* add gov authority
* add guardian invariant
* add single member query
* return error if the address has no role
* append genesis validation
* add CLI
* return all registered members if there is no query string
* add unit tests for RBAC
* merge `halt` with `resume` as `set-bridge-status`
* Add CHANGELOG
* add ERRORS docs
* apply 0tech review
* enhance bridge switch unit test
* maintain bridge status metadata based on permanent states
* change panic msg for unimplemented features
* check duplicate seq in genesis
* bridge inactive counter must always be initialization
* bridge is always inactive if there is no guardian
* start fbridge module after auth/bank
* remove redundant invariant checking
---
CHANGELOG.md | 3 +-
client/docs/config.json | 9 +-
client/docs/swagger-ui/swagger.yaml | 992 ++++++++----
docs/core/proto-docs.md | 520 +++++--
proto/lbm/fbridge/v1/event.proto | 16 +
proto/lbm/fbridge/v1/fbridge.proto | 69 +-
proto/lbm/fbridge/v1/genesis.proto | 16 +
proto/lbm/fbridge/v1/query.proto | 96 +-
proto/lbm/fbridge/v1/tx.proto | 26 +-
simapp/app.go | 6 +-
x/ERRORS.md | 12 +
x/fbridge/client/cli/query.go | 234 ++-
x/fbridge/client/cli/tx.go | 130 +-
x/fbridge/keeper/abci.go | 65 +
x/fbridge/keeper/auth.go | 331 ++++
x/fbridge/keeper/auth_test.go | 89 ++
x/fbridge/keeper/genesis.go | 58 +
x/fbridge/keeper/grpc_query.go | 137 +-
x/fbridge/keeper/keeper.go | 122 +-
x/fbridge/keeper/msg_server.go | 87 +-
x/fbridge/keeper/params.go | 24 +
x/fbridge/keeper/transfer_test.go | 7 +-
x/fbridge/module/module.go | 24 +-
x/fbridge/testutil/setup.go | 18 +-
x/fbridge/types/codec.go | 6 +-
x/fbridge/types/errors.go | 9 +
x/fbridge/types/event.pb.go | 468 +++++-
x/fbridge/types/fbridge.go | 39 +
x/fbridge/types/fbridge.pb.go | 1145 ++++++++++++--
x/fbridge/types/genesis.go | 88 +-
x/fbridge/types/genesis.pb.go | 589 +++++++-
x/fbridge/types/keys.go | 88 +-
x/fbridge/types/msgs.go | 19 +-
x/fbridge/types/params.go | 64 +
x/fbridge/types/params_test.go | 62 +
x/fbridge/types/query.pb.go | 2161 +++++++++++++++++++--------
x/fbridge/types/query.pb.gw.go | 402 ++++-
x/fbridge/types/tx.pb.go | 579 ++-----
38 files changed, 6932 insertions(+), 1878 deletions(-)
create mode 100644 x/fbridge/keeper/abci.go
create mode 100644 x/fbridge/keeper/auth.go
create mode 100644 x/fbridge/keeper/auth_test.go
create mode 100644 x/fbridge/keeper/params.go
create mode 100644 x/fbridge/types/errors.go
create mode 100644 x/fbridge/types/fbridge.go
create mode 100644 x/fbridge/types/params_test.go
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9a7698b343..146a25d1a8 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -40,12 +40,13 @@ Ref: https://keepachangelog.com/en/1.0.0/
### Features
* (consensus) [\#1178](https://github.com/Finschia/finschia-sdk/pull/1178) change the consensus from Ostracon to Tendermint v0.34.24
-* (x/fswap) [\#1336](https://github.com/Finschia/finschia-sdk/pull/1336) Initialize fswap module
+* (x/fswap) [\#1336](https://github.com/Finschia/finschia-sdk/pull/1336) Initialize fswap module
* (x/fswap) [\#1339](https://github.com/Finschia/finschia-sdk/pull/1339) Implement fswap module's genesis
* (x/fbridge) [\#1340](https://github.com/Finschia/finschia-sdk/pull/1340) Initialize fbridge module
* (x/fbridge) [\#1347](https://github.com/Finschia/finschia-sdk/pull/1347) Implement bridge transfer feature (sending side)
* (x/fbridge) [\#1351](https://github.com/Finschia/finschia-sdk/pull/1351) Map a sequence to block number for every bridge request (sending side)
* (x/fswap) [\#1345](https://github.com/Finschia/finschia-sdk/pull/1345) Implement fswap's basic functionality(MsgSwap, MsgSwapAll, Query, Proposal)
+* (x/fbridge) [\#1350](https://github.com/Finschia/finschia-sdk/pull/1350) Add Role-based Access Control
### Improvements
* (docs) [\#1120](https://github.com/Finschia/finschia-sdk/pull/1120) Update links in x/foundation README.md
diff --git a/client/docs/config.json b/client/docs/config.json
index 4a1968c6ee..6670e56370 100644
--- a/client/docs/config.json
+++ b/client/docs/config.json
@@ -171,11 +171,12 @@
"rename": {
"Params": "FBridgeParams",
"Commitments": "FBridgeCommitments",
- "Guardians": "FBridgeGuardians",
- "Operators": "FBridgeOperators",
- "Judges": "FBridgeJudges",
+ "Members": "FBridgeMembers",
+ "Member": "FBridgeMember",
"Proposals": "FBridgeProposals",
- "Proposal": "FBridgeProposal"
+ "Proposal": "FBridgeProposal",
+ "Votes": "FBridgeVotes",
+ "Vote": "FBridgeVote"
}
}
}
diff --git a/client/docs/swagger-ui/swagger.yaml b/client/docs/swagger-ui/swagger.yaml
index 30b1c66412..de9fab3eff 100644
--- a/client/docs/swagger-ui/swagger.yaml
+++ b/client/docs/swagger-ui/swagger.yaml
@@ -29799,17 +29799,17 @@ paths:
format: byte
tags:
- Service
- /lbm/fbridge/v1/guardians:
+ /lbm/fbridge/v1/members:
get:
- summary: Guardians queries a list of Guardians registered on the bridge
- operationId: FBridgeGuardians
+ summary: Members queries the members of spcific group registered on the bridge
+ operationId: FBridgeMembers
responses:
'200':
description: A successful response.
schema:
type: object
properties:
- guardians:
+ members:
type: array
items:
type: string
@@ -29835,60 +29835,26 @@ paths:
value:
type: string
format: byte
+ parameters:
+ - name: role
+ description: 'the role name (guardian, operator, judge).'
+ in: query
+ required: false
+ type: string
tags:
- Query
- /lbm/fbridge/v1/judges:
+ '/lbm/fbridge/v1/members/{address}':
get:
- summary: Judges queries a list of Judges registered on the bridge
- operationId: FBridgeJudges
+ summary: Member queries the role of a specific member
+ operationId: FBridgeMember
responses:
'200':
description: A successful response.
schema:
type: object
properties:
- judges:
- type: array
- items:
- type: string
- default:
- description: An unexpected error response
- schema:
- type: object
- properties:
- error:
- type: string
- code:
- type: integer
- format: int32
- message:
+ role:
type: string
- details:
- type: array
- items:
- type: object
- properties:
- type_url:
- type: string
- value:
- type: string
- format: byte
- tags:
- - Query
- /lbm/fbridge/v1/operators:
- get:
- summary: Operators queries a list of Operators registered on the bridge
- operationId: FBridgeOperators
- responses:
- '200':
- description: A successful response.
- schema:
- type: object
- properties:
- operators:
- type: array
- items:
- type: string
default:
description: An unexpected error response
schema:
@@ -29911,6 +29877,11 @@ paths:
value:
type: string
format: byte
+ parameters:
+ - name: address
+ in: path
+ required: true
+ type: string
tags:
- Query
/lbm/fbridge/v1/params:
@@ -29996,6 +29967,371 @@ paths:
format: byte
tags:
- Query
+ /lbm/fbridge/v1/proposals:
+ get:
+ summary: Proposals queries a list of SuggestRole Proposals
+ operationId: FBridgeProposals
+ responses:
+ '200':
+ description: A successful response.
+ schema:
+ type: object
+ properties:
+ proposals:
+ type: array
+ items:
+ type: object
+ properties:
+ id:
+ type: string
+ format: uint64
+ proposer:
+ type: string
+ title: the proposer address
+ target:
+ type: string
+ title: the address to update the role
+ role:
+ title: >-
+ the role to be updated
+
+ - unspecified : 0, used to remove the address from a
+ group
+
+ - guardian : 1
+
+ - operator : 2
+
+ - judge : 3
+ type: string
+ enum:
+ - UNSPECIFIED
+ - GUARDIAN
+ - OPERATOR
+ - JUDGE
+ default: UNSPECIFIED
+ description: >-
+ Role defines the role of the operator, guardian, and
+ judge.
+ expired_at:
+ type: string
+ format: date-time
+ title: >-
+ the unix timestamp the proposal will be expired (unix
+ timestamp)
+ pagination:
+ description: pagination defines an pagination for the response.
+ type: object
+ properties:
+ next_key:
+ type: string
+ format: byte
+ title: |-
+ next_key is the key to be passed to PageRequest.key to
+ query the next page most efficiently
+ total:
+ type: string
+ format: uint64
+ title: >-
+ total is total number of results available if
+ PageRequest.count_total
+
+ was set, its value is undefined otherwise
+ default:
+ description: An unexpected error response
+ schema:
+ type: object
+ properties:
+ error:
+ type: string
+ code:
+ type: integer
+ format: int32
+ message:
+ type: string
+ details:
+ type: array
+ items:
+ type: object
+ properties:
+ type_url:
+ type: string
+ value:
+ type: string
+ format: byte
+ parameters:
+ - name: pagination.key
+ description: |-
+ key is a value returned in PageResponse.next_key to begin
+ querying the next page most efficiently. Only one of offset or key
+ should be set.
+ in: query
+ required: false
+ type: string
+ format: byte
+ - name: pagination.offset
+ description: >-
+ offset is a numeric offset that can be used when key is unavailable.
+
+ It is less efficient than using key. Only one of offset or key
+ should
+
+ be set.
+ in: query
+ required: false
+ type: string
+ format: uint64
+ - name: pagination.limit
+ description: >-
+ limit is the total number of results to be returned in the result
+ page.
+
+ If left empty it will default to a value to be set by each app.
+ in: query
+ required: false
+ type: string
+ format: uint64
+ - name: pagination.count_total
+ description: >-
+ count_total is set to true to indicate that the result set should
+ include
+
+ a count of the total number of items available for pagination in
+ UIs.
+
+ count_total is only respected when offset is used. It is ignored
+ when key
+
+ is set.
+ in: query
+ required: false
+ type: boolean
+ format: boolean
+ - name: pagination.reverse
+ description: >-
+ reverse is set to true if results are to be returned in the
+ descending order.
+
+
+ Since: cosmos-sdk 0.43
+ in: query
+ required: false
+ type: boolean
+ format: boolean
+ tags:
+ - Query
+ '/lbm/fbridge/v1/proposals/{proposal_id}':
+ get:
+ summary: Proposal queries a SuggestRole Proposal
+ operationId: FBridgeProposal
+ responses:
+ '200':
+ description: A successful response.
+ schema:
+ type: object
+ properties:
+ proposal:
+ type: object
+ properties:
+ id:
+ type: string
+ format: uint64
+ proposer:
+ type: string
+ title: the proposer address
+ target:
+ type: string
+ title: the address to update the role
+ role:
+ title: |-
+ the role to be updated
+ - unspecified : 0, used to remove the address from a group
+ - guardian : 1
+ - operator : 2
+ - judge : 3
+ type: string
+ enum:
+ - UNSPECIFIED
+ - GUARDIAN
+ - OPERATOR
+ - JUDGE
+ default: UNSPECIFIED
+ description: >-
+ Role defines the role of the operator, guardian, and
+ judge.
+ expired_at:
+ type: string
+ format: date-time
+ title: >-
+ the unix timestamp the proposal will be expired (unix
+ timestamp)
+ default:
+ description: An unexpected error response
+ schema:
+ type: object
+ properties:
+ error:
+ type: string
+ code:
+ type: integer
+ format: int32
+ message:
+ type: string
+ details:
+ type: array
+ items:
+ type: object
+ properties:
+ type_url:
+ type: string
+ value:
+ type: string
+ format: byte
+ parameters:
+ - name: proposal_id
+ description: the proposal id
+ in: path
+ required: true
+ type: string
+ format: uint64
+ tags:
+ - Query
+ '/lbm/fbridge/v1/proposals/{proposal_id}/votes':
+ get:
+ summary: Votes queries votes of a given proposal.
+ operationId: FBridgeVotes
+ responses:
+ '200':
+ description: A successful response.
+ schema:
+ type: object
+ properties:
+ votes:
+ type: array
+ items:
+ type: object
+ properties:
+ proposal_id:
+ type: string
+ format: uint64
+ voter:
+ type: string
+ option:
+ type: string
+ enum:
+ - VOTE_OPTION_UNSPECIFIED
+ - VOTE_OPTION_YES
+ - VOTE_OPTION_NO
+ default: VOTE_OPTION_UNSPECIFIED
+ description: >-
+ VoteOption enumerates the valid vote options for a given
+ role proposal.
+
+ - VOTE_OPTION_UNSPECIFIED: VOTE_OPTION_UNSPECIFIED defines a no-op vote option.
+ - VOTE_OPTION_YES: VOTE_OPTION_YES defines a yes vote option.
+ - VOTE_OPTION_NO: VOTE_OPTION_NO defines a no vote option.
+ description: Vote defines a vote on a role proposal.
+ description: votes defined the queried votes.
+ default:
+ description: An unexpected error response
+ schema:
+ type: object
+ properties:
+ error:
+ type: string
+ code:
+ type: integer
+ format: int32
+ message:
+ type: string
+ details:
+ type: array
+ items:
+ type: object
+ properties:
+ type_url:
+ type: string
+ value:
+ type: string
+ format: byte
+ parameters:
+ - name: proposal_id
+ description: proposal_id defines the unique id of the proposal.
+ in: path
+ required: true
+ type: string
+ format: uint64
+ tags:
+ - Query
+ '/lbm/fbridge/v1/proposals/{proposal_id}/votes/{voter}':
+ get:
+ summary: 'Vote queries voted information based on proposalID, voterAddr.'
+ operationId: FBridgeVote
+ responses:
+ '200':
+ description: A successful response.
+ schema:
+ type: object
+ properties:
+ vote:
+ type: object
+ properties:
+ proposal_id:
+ type: string
+ format: uint64
+ voter:
+ type: string
+ option:
+ type: string
+ enum:
+ - VOTE_OPTION_UNSPECIFIED
+ - VOTE_OPTION_YES
+ - VOTE_OPTION_NO
+ default: VOTE_OPTION_UNSPECIFIED
+ description: >-
+ VoteOption enumerates the valid vote options for a given
+ role proposal.
+
+ - VOTE_OPTION_UNSPECIFIED: VOTE_OPTION_UNSPECIFIED defines a no-op vote option.
+ - VOTE_OPTION_YES: VOTE_OPTION_YES defines a yes vote option.
+ - VOTE_OPTION_NO: VOTE_OPTION_NO defines a no vote option.
+ description: Vote defines a vote on a role proposal.
+ default:
+ description: An unexpected error response
+ schema:
+ type: object
+ properties:
+ error:
+ type: string
+ code:
+ type: integer
+ format: int32
+ message:
+ type: string
+ details:
+ type: array
+ items:
+ type: object
+ properties:
+ type_url:
+ type: string
+ value:
+ type: string
+ format: byte
+ parameters:
+ - name: proposal_id
+ description: proposal_id defines the unique id of the proposal.
+ in: path
+ required: true
+ type: string
+ format: uint64
+ - name: voter
+ description: voter defines the oter address for the proposals.
+ in: path
+ required: true
+ type: string
+ tags:
+ - Query
'/lbm/fbridge/v1/receiving/commitments/{seq}':
get:
summary: Commitments queries commitments of a specific sequence number
@@ -30258,287 +30594,76 @@ paths:
format: int32
message:
type: string
- details:
- type: array
- items:
- type: object
- properties:
- type_url:
- type: string
- value:
- type: string
- format: byte
- parameters:
- - name: operator
- description: the address of the operator
- in: path
- required: true
- type: string
- tags:
- - Query
- '/lbm/fbridge/v1/receiving/provision/{seq}':
- get:
- summary: ConfirmedProvision queries a particular sequence of confirmed provisions
- operationId: ConfirmedProvision
- responses:
- '200':
- description: A successful response.
- schema:
- type: object
- properties:
- data:
- type: object
- properties:
- seq:
- type: string
- format: uint64
- title: the sequence number of the bridge request
- amount:
- type: string
- title: the amount of token to be claimed
- sender:
- type: string
- title: the sender address on the source chain
- receiver:
- type: string
- title: the recipient address on the destination chain
- description: Provision is a struct that represents a provision internally.
- status:
- type: object
- properties:
- timelock_end:
- type: string
- format: uint64
- title: >-
- the unix timestamp the provision will be able to be
- claimed (unix timestamp)
- confirm_counts:
- type: integer
- format: int32
- title: >-
- a value that tells how many operators have submitted this
- provision
- is_claimed:
- type: boolean
- format: boolean
- title: whether the provision has been claimed
- description: >-
- ProvisionStatus is a struct that represents the status of a
- provision.
-
- To optimize computational cost, we have collected frequently
- changing values from provision.
- default:
- description: An unexpected error response
- schema:
- type: object
- properties:
- error:
- type: string
- code:
- type: integer
- format: int32
- message:
- type: string
- details:
- type: array
- items:
- type: object
- properties:
- type_url:
- type: string
- value:
- type: string
- format: byte
- parameters:
- - name: seq
- description: the sequence number of the bridge request
- in: path
- required: true
- type: string
- format: uint64
- tags:
- - Query
- /lbm/fbridge/v1/role/proposals:
- get:
- summary: Proposals queries a list of SuggestRole Proposals
- operationId: FBridgeProposals
- responses:
- '200':
- description: A successful response.
- schema:
- type: object
- properties:
- proposals:
- type: array
- items:
- type: object
- properties:
- id:
- type: string
- format: uint64
- proposer:
- type: string
- title: the proposer address
- target:
- type: string
- title: the address to update the role
- role:
- title: >-
- the role to be updated
-
- - unspecified : 0, used to remove the address from a
- group
-
- - guardian : 1
-
- - operator : 2
-
- - judge : 3
- type: string
- enum:
- - UNSPECIFIED
- - GUARDIAN
- - OPERATOR
- - JUDGE
- default: UNSPECIFIED
- description: >-
- Role defines the role of the operator, guardian, and
- judge.
- expired_at:
- type: string
- format: uint64
- title: >-
- the unix timestamp the proposal will be expired (unix
- timestamp)
- default:
- description: An unexpected error response
- schema:
- type: object
- properties:
- error:
- type: string
- code:
- type: integer
- format: int32
- message:
- type: string
- details:
- type: array
- items:
- type: object
- properties:
- type_url:
- type: string
- value:
- type: string
- format: byte
- parameters:
- - name: pagination.key
- description: |-
- key is a value returned in PageResponse.next_key to begin
- querying the next page most efficiently. Only one of offset or key
- should be set.
- in: query
- required: false
- type: string
- format: byte
- - name: pagination.offset
- description: >-
- offset is a numeric offset that can be used when key is unavailable.
-
- It is less efficient than using key. Only one of offset or key
- should
-
- be set.
- in: query
- required: false
- type: string
- format: uint64
- - name: pagination.limit
- description: >-
- limit is the total number of results to be returned in the result
- page.
-
- If left empty it will default to a value to be set by each app.
- in: query
- required: false
- type: string
- format: uint64
- - name: pagination.count_total
- description: >-
- count_total is set to true to indicate that the result set should
- include
-
- a count of the total number of items available for pagination in
- UIs.
-
- count_total is only respected when offset is used. It is ignored
- when key
-
- is set.
- in: query
- required: false
- type: boolean
- format: boolean
- - name: pagination.reverse
- description: >-
- reverse is set to true if results are to be returned in the
- descending order.
-
-
- Since: cosmos-sdk 0.43
- in: query
- required: false
- type: boolean
- format: boolean
+ details:
+ type: array
+ items:
+ type: object
+ properties:
+ type_url:
+ type: string
+ value:
+ type: string
+ format: byte
+ parameters:
+ - name: operator
+ description: the address of the operator
+ in: path
+ required: true
+ type: string
tags:
- Query
- '/lbm/fbridge/v1/role/proposals/{proposal_id}':
+ '/lbm/fbridge/v1/receiving/provision/{seq}':
get:
- summary: Proposal queries a SuggestRole Proposal
- operationId: FBridgeProposal
+ summary: ConfirmedProvision queries a particular sequence of confirmed provisions
+ operationId: ConfirmedProvision
responses:
'200':
description: A successful response.
schema:
type: object
properties:
- proposal:
+ data:
type: object
properties:
- id:
+ seq:
type: string
format: uint64
- proposer:
+ title: the sequence number of the bridge request
+ amount:
type: string
- title: the proposer address
- target:
+ title: the amount of token to be claimed
+ sender:
type: string
- title: the address to update the role
- role:
- title: |-
- the role to be updated
- - unspecified : 0, used to remove the address from a group
- - guardian : 1
- - operator : 2
- - judge : 3
+ title: the sender address on the source chain
+ receiver:
type: string
- enum:
- - UNSPECIFIED
- - GUARDIAN
- - OPERATOR
- - JUDGE
- default: UNSPECIFIED
- description: >-
- Role defines the role of the operator, guardian, and
- judge.
- expired_at:
+ title: the recipient address on the destination chain
+ description: Provision is a struct that represents a provision internally.
+ status:
+ type: object
+ properties:
+ timelock_end:
type: string
format: uint64
title: >-
- the unix timestamp the proposal will be expired (unix
- timestamp)
+ the unix timestamp the provision will be able to be
+ claimed (unix timestamp)
+ confirm_counts:
+ type: integer
+ format: int32
+ title: >-
+ a value that tells how many operators have submitted this
+ provision
+ is_claimed:
+ type: boolean
+ format: boolean
+ title: whether the provision has been claimed
+ description: >-
+ ProvisionStatus is a struct that represents the status of a
+ provision.
+
+ To optimize computational cost, we have collected frequently
+ changing values from provision.
default:
description: An unexpected error response
schema:
@@ -30562,11 +30687,12 @@ paths:
type: string
format: byte
parameters:
- - name: proposal_id
- description: the proposal id
+ - name: seq
+ description: the sequence number of the bridge request
in: path
required: true
type: string
+ format: uint64
tags:
- Query
/lbm/fbridge/v1/sending/blocknums:
@@ -30657,6 +30783,65 @@ paths:
format: byte
tags:
- Query
+ /lbm/fbridge/v1/status:
+ get:
+ summary: BridgeStatus queries the status of the bridge
+ operationId: BridgeStatus
+ responses:
+ '200':
+ description: A successful response.
+ schema:
+ type: object
+ properties:
+ status:
+ type: string
+ enum:
+ - BRIDGE_STATUS_UNSPECIFIED
+ - BRIDGE_STATUS_ACTIVE
+ - BRIDGE_STATUS_INACTIVE
+ default: BRIDGE_STATUS_UNSPECIFIED
+ description: |2-
+ - BRIDGE_STATUS_UNSPECIFIED: BRIDGE_STATUS_UNSPECIFIED defines an unspecified bridge status.
+ - BRIDGE_STATUS_ACTIVE: BRIDGE_STATUS_ACTIVE defines an active bridge status.
+ - BRIDGE_STATUS_INACTIVE: BRIDGE_STATUS_INACTIVE defines an inactive bridge status.
+ metadata:
+ type: object
+ properties:
+ inactive:
+ type: string
+ format: uint64
+ title: the number of inactived bridge switch
+ active:
+ type: string
+ format: uint64
+ title: the number of activated bridge switch
+ description: >-
+ BridgeStatusMetadata defines the metadata of the bridge
+ status.
+ default:
+ description: An unexpected error response
+ schema:
+ type: object
+ properties:
+ error:
+ type: string
+ code:
+ type: integer
+ format: int32
+ message:
+ type: string
+ details:
+ type: array
+ items:
+ type: object
+ properties:
+ type_url:
+ type: string
+ value:
+ type: string
+ format: byte
+ tags:
+ - Query
definitions:
cosmos.auth.v1beta1.Params:
type: object
@@ -50202,6 +50387,29 @@ definitions:
minimum_gas_price:
type: string
description: ConfigResponse defines the response structure for the Config gRPC query.
+ lbm.fbridge.v1.BridgeStatus:
+ type: string
+ enum:
+ - BRIDGE_STATUS_UNSPECIFIED
+ - BRIDGE_STATUS_ACTIVE
+ - BRIDGE_STATUS_INACTIVE
+ default: BRIDGE_STATUS_UNSPECIFIED
+ description: |2-
+ - BRIDGE_STATUS_UNSPECIFIED: BRIDGE_STATUS_UNSPECIFIED defines an unspecified bridge status.
+ - BRIDGE_STATUS_ACTIVE: BRIDGE_STATUS_ACTIVE defines an active bridge status.
+ - BRIDGE_STATUS_INACTIVE: BRIDGE_STATUS_INACTIVE defines an inactive bridge status.
+ lbm.fbridge.v1.BridgeStatusMetadata:
+ type: object
+ properties:
+ inactive:
+ type: string
+ format: uint64
+ title: the number of inactived bridge switch
+ active:
+ type: string
+ format: uint64
+ title: the number of activated bridge switch
+ description: BridgeStatusMetadata defines the metadata of the bridge status.
lbm.fbridge.v1.Fraction:
type: object
properties:
@@ -50294,6 +50502,32 @@ definitions:
To optimize computational cost, we have collected frequently changing
values from provision.
+ lbm.fbridge.v1.QueryBridgeStatusResponse:
+ type: object
+ properties:
+ status:
+ type: string
+ enum:
+ - BRIDGE_STATUS_UNSPECIFIED
+ - BRIDGE_STATUS_ACTIVE
+ - BRIDGE_STATUS_INACTIVE
+ default: BRIDGE_STATUS_UNSPECIFIED
+ description: |2-
+ - BRIDGE_STATUS_UNSPECIFIED: BRIDGE_STATUS_UNSPECIFIED defines an unspecified bridge status.
+ - BRIDGE_STATUS_ACTIVE: BRIDGE_STATUS_ACTIVE defines an active bridge status.
+ - BRIDGE_STATUS_INACTIVE: BRIDGE_STATUS_INACTIVE defines an inactive bridge status.
+ metadata:
+ type: object
+ properties:
+ inactive:
+ type: string
+ format: uint64
+ title: the number of inactived bridge switch
+ active:
+ type: string
+ format: uint64
+ title: the number of activated bridge switch
+ description: BridgeStatusMetadata defines the metadata of the bridge status.
lbm.fbridge.v1.QueryCommitmentsResponse:
type: object
properties:
@@ -50357,17 +50591,15 @@ definitions:
seq:
type: string
format: uint64
- lbm.fbridge.v1.QueryGuardiansResponse:
+ lbm.fbridge.v1.QueryMemberResponse:
type: object
properties:
- guardians:
- type: array
- items:
- type: string
- lbm.fbridge.v1.QueryJudgesResponse:
+ role:
+ type: string
+ lbm.fbridge.v1.QueryMembersResponse:
type: object
properties:
- judges:
+ members:
type: array
items:
type: string
@@ -50385,13 +50617,6 @@ definitions:
seq:
type: string
format: uint64
- lbm.fbridge.v1.QueryOperatorsResponse:
- type: object
- properties:
- operators:
- type: array
- items:
- type: string
lbm.fbridge.v1.QueryParamsResponse:
type: object
properties:
@@ -50468,7 +50693,7 @@ definitions:
description: 'Role defines the role of the operator, guardian, and judge.'
expired_at:
type: string
- format: uint64
+ format: date-time
title: the unix timestamp the proposal will be expired (unix timestamp)
lbm.fbridge.v1.QueryProposalsResponse:
type: object
@@ -50504,8 +50729,26 @@ definitions:
description: 'Role defines the role of the operator, guardian, and judge.'
expired_at:
type: string
- format: uint64
+ format: date-time
title: the unix timestamp the proposal will be expired (unix timestamp)
+ pagination:
+ description: pagination defines an pagination for the response.
+ type: object
+ properties:
+ next_key:
+ type: string
+ format: byte
+ title: |-
+ next_key is the key to be passed to PageRequest.key to
+ query the next page most efficiently
+ total:
+ type: string
+ format: uint64
+ title: >-
+ total is total number of results available if
+ PageRequest.count_total
+
+ was set, its value is undefined otherwise
lbm.fbridge.v1.QuerySeqToBlocknumsResponse:
type: object
properties:
@@ -50558,6 +50801,61 @@ definitions:
To optimize computational cost, we have collected frequently changing
values from provision.
+ lbm.fbridge.v1.QueryVoteResponse:
+ type: object
+ properties:
+ vote:
+ type: object
+ properties:
+ proposal_id:
+ type: string
+ format: uint64
+ voter:
+ type: string
+ option:
+ type: string
+ enum:
+ - VOTE_OPTION_UNSPECIFIED
+ - VOTE_OPTION_YES
+ - VOTE_OPTION_NO
+ default: VOTE_OPTION_UNSPECIFIED
+ description: >-
+ VoteOption enumerates the valid vote options for a given role
+ proposal.
+
+ - VOTE_OPTION_UNSPECIFIED: VOTE_OPTION_UNSPECIFIED defines a no-op vote option.
+ - VOTE_OPTION_YES: VOTE_OPTION_YES defines a yes vote option.
+ - VOTE_OPTION_NO: VOTE_OPTION_NO defines a no vote option.
+ description: Vote defines a vote on a role proposal.
+ lbm.fbridge.v1.QueryVotesResponse:
+ type: object
+ properties:
+ votes:
+ type: array
+ items:
+ type: object
+ properties:
+ proposal_id:
+ type: string
+ format: uint64
+ voter:
+ type: string
+ option:
+ type: string
+ enum:
+ - VOTE_OPTION_UNSPECIFIED
+ - VOTE_OPTION_YES
+ - VOTE_OPTION_NO
+ default: VOTE_OPTION_UNSPECIFIED
+ description: >-
+ VoteOption enumerates the valid vote options for a given role
+ proposal.
+
+ - VOTE_OPTION_UNSPECIFIED: VOTE_OPTION_UNSPECIFIED defines a no-op vote option.
+ - VOTE_OPTION_YES: VOTE_OPTION_YES defines a yes vote option.
+ - VOTE_OPTION_NO: VOTE_OPTION_NO defines a no vote option.
+ description: Vote defines a vote on a role proposal.
+ description: votes defined the queried votes.
lbm.fbridge.v1.Role:
type: string
enum:
@@ -50596,5 +50894,41 @@ definitions:
description: 'Role defines the role of the operator, guardian, and judge.'
expired_at:
type: string
- format: uint64
+ format: date-time
title: the unix timestamp the proposal will be expired (unix timestamp)
+ lbm.fbridge.v1.Vote:
+ type: object
+ properties:
+ proposal_id:
+ type: string
+ format: uint64
+ voter:
+ type: string
+ option:
+ type: string
+ enum:
+ - VOTE_OPTION_UNSPECIFIED
+ - VOTE_OPTION_YES
+ - VOTE_OPTION_NO
+ default: VOTE_OPTION_UNSPECIFIED
+ description: >-
+ VoteOption enumerates the valid vote options for a given role
+ proposal.
+
+ - VOTE_OPTION_UNSPECIFIED: VOTE_OPTION_UNSPECIFIED defines a no-op vote option.
+ - VOTE_OPTION_YES: VOTE_OPTION_YES defines a yes vote option.
+ - VOTE_OPTION_NO: VOTE_OPTION_NO defines a no vote option.
+ description: Vote defines a vote on a role proposal.
+ lbm.fbridge.v1.VoteOption:
+ type: string
+ enum:
+ - VOTE_OPTION_UNSPECIFIED
+ - VOTE_OPTION_YES
+ - VOTE_OPTION_NO
+ default: VOTE_OPTION_UNSPECIFIED
+ description: |-
+ VoteOption enumerates the valid vote options for a given role proposal.
+
+ - VOTE_OPTION_UNSPECIFIED: VOTE_OPTION_UNSPECIFIED defines a no-op vote option.
+ - VOTE_OPTION_YES: VOTE_OPTION_YES defines a yes vote option.
+ - VOTE_OPTION_NO: VOTE_OPTION_NO defines a no vote option.
diff --git a/docs/core/proto-docs.md b/docs/core/proto-docs.md
index 56d2cf5fd1..379b2d65ea 100644
--- a/docs/core/proto-docs.md
+++ b/docs/core/proto-docs.md
@@ -754,23 +754,32 @@
- [Msg](#lbm.collection.v1.Msg)
-- [lbm/fbridge/v1/event.proto](#lbm/fbridge/v1/event.proto)
- - [EventClaim](#lbm.fbridge.v1.EventClaim)
- - [EventConfirmProvision](#lbm.fbridge.v1.EventConfirmProvision)
- - [EventProvision](#lbm.fbridge.v1.EventProvision)
- - [EventTransfer](#lbm.fbridge.v1.EventTransfer)
-
- [lbm/fbridge/v1/fbridge.proto](#lbm/fbridge/v1/fbridge.proto)
+ - [BridgeStatusMetadata](#lbm.fbridge.v1.BridgeStatusMetadata)
- [Fraction](#lbm.fbridge.v1.Fraction)
- [Params](#lbm.fbridge.v1.Params)
- [ProvisionData](#lbm.fbridge.v1.ProvisionData)
- [ProvisionStatus](#lbm.fbridge.v1.ProvisionStatus)
+ - [RoleMetadata](#lbm.fbridge.v1.RoleMetadata)
+ - [RolePair](#lbm.fbridge.v1.RolePair)
- [RoleProposal](#lbm.fbridge.v1.RoleProposal)
+ - [Vote](#lbm.fbridge.v1.Vote)
+ - [BridgeStatus](#lbm.fbridge.v1.BridgeStatus)
- [Role](#lbm.fbridge.v1.Role)
+ - [VoteOption](#lbm.fbridge.v1.VoteOption)
+
+- [lbm/fbridge/v1/event.proto](#lbm/fbridge/v1/event.proto)
+ - [EventAddVoteForRole](#lbm.fbridge.v1.EventAddVoteForRole)
+ - [EventClaim](#lbm.fbridge.v1.EventClaim)
+ - [EventConfirmProvision](#lbm.fbridge.v1.EventConfirmProvision)
+ - [EventProvision](#lbm.fbridge.v1.EventProvision)
+ - [EventSuggestRole](#lbm.fbridge.v1.EventSuggestRole)
+ - [EventTransfer](#lbm.fbridge.v1.EventTransfer)
- [lbm/fbridge/v1/genesis.proto](#lbm/fbridge/v1/genesis.proto)
- [BlockSeqInfo](#lbm.fbridge.v1.BlockSeqInfo)
+ - [BridgeSwitch](#lbm.fbridge.v1.BridgeSwitch)
- [Commitment](#lbm.fbridge.v1.Commitment)
- [ConfirmedProvision](#lbm.fbridge.v1.ConfirmedProvision)
- [GenesisState](#lbm.fbridge.v1.GenesisState)
@@ -780,6 +789,8 @@
- [SendingState](#lbm.fbridge.v1.SendingState)
- [lbm/fbridge/v1/query.proto](#lbm/fbridge/v1/query.proto)
+ - [QueryBridgeStatusRequest](#lbm.fbridge.v1.QueryBridgeStatusRequest)
+ - [QueryBridgeStatusResponse](#lbm.fbridge.v1.QueryBridgeStatusResponse)
- [QueryCommitmentsRequest](#lbm.fbridge.v1.QueryCommitmentsRequest)
- [QueryCommitmentsResponse](#lbm.fbridge.v1.QueryCommitmentsResponse)
- [QueryConfirmedProvisionRequest](#lbm.fbridge.v1.QueryConfirmedProvisionRequest)
@@ -788,16 +799,14 @@
- [QueryGreatestConsecutiveConfirmedSeqResponse](#lbm.fbridge.v1.QueryGreatestConsecutiveConfirmedSeqResponse)
- [QueryGreatestSeqByOperatorRequest](#lbm.fbridge.v1.QueryGreatestSeqByOperatorRequest)
- [QueryGreatestSeqByOperatorResponse](#lbm.fbridge.v1.QueryGreatestSeqByOperatorResponse)
- - [QueryGuardiansRequest](#lbm.fbridge.v1.QueryGuardiansRequest)
- - [QueryGuardiansResponse](#lbm.fbridge.v1.QueryGuardiansResponse)
- - [QueryJudgesRequest](#lbm.fbridge.v1.QueryJudgesRequest)
- - [QueryJudgesResponse](#lbm.fbridge.v1.QueryJudgesResponse)
+ - [QueryMemberRequest](#lbm.fbridge.v1.QueryMemberRequest)
+ - [QueryMemberResponse](#lbm.fbridge.v1.QueryMemberResponse)
+ - [QueryMembersRequest](#lbm.fbridge.v1.QueryMembersRequest)
+ - [QueryMembersResponse](#lbm.fbridge.v1.QueryMembersResponse)
- [QueryNeededSubmissionSeqsRequest](#lbm.fbridge.v1.QueryNeededSubmissionSeqsRequest)
- [QueryNeededSubmissionSeqsResponse](#lbm.fbridge.v1.QueryNeededSubmissionSeqsResponse)
- [QueryNextSeqSendRequest](#lbm.fbridge.v1.QueryNextSeqSendRequest)
- [QueryNextSeqSendResponse](#lbm.fbridge.v1.QueryNextSeqSendResponse)
- - [QueryOperatorsRequest](#lbm.fbridge.v1.QueryOperatorsRequest)
- - [QueryOperatorsResponse](#lbm.fbridge.v1.QueryOperatorsResponse)
- [QueryParamsRequest](#lbm.fbridge.v1.QueryParamsRequest)
- [QueryParamsResponse](#lbm.fbridge.v1.QueryParamsResponse)
- [QueryProposalRequest](#lbm.fbridge.v1.QueryProposalRequest)
@@ -808,6 +817,10 @@
- [QuerySeqToBlocknumsResponse](#lbm.fbridge.v1.QuerySeqToBlocknumsResponse)
- [QuerySubmittedProvisionRequest](#lbm.fbridge.v1.QuerySubmittedProvisionRequest)
- [QuerySubmittedProvisionResponse](#lbm.fbridge.v1.QuerySubmittedProvisionResponse)
+ - [QueryVoteRequest](#lbm.fbridge.v1.QueryVoteRequest)
+ - [QueryVoteResponse](#lbm.fbridge.v1.QueryVoteResponse)
+ - [QueryVotesRequest](#lbm.fbridge.v1.QueryVotesRequest)
+ - [QueryVotesResponse](#lbm.fbridge.v1.QueryVotesResponse)
- [Query](#lbm.fbridge.v1.Query)
@@ -818,8 +831,6 @@
- [MsgClaimBatch](#lbm.fbridge.v1.MsgClaimBatch)
- [MsgClaimBatchResponse](#lbm.fbridge.v1.MsgClaimBatchResponse)
- [MsgClaimResponse](#lbm.fbridge.v1.MsgClaimResponse)
- - [MsgHalt](#lbm.fbridge.v1.MsgHalt)
- - [MsgHaltResponse](#lbm.fbridge.v1.MsgHaltResponse)
- [MsgHoldTransfer](#lbm.fbridge.v1.MsgHoldTransfer)
- [MsgHoldTransferResponse](#lbm.fbridge.v1.MsgHoldTransferResponse)
- [MsgProvision](#lbm.fbridge.v1.MsgProvision)
@@ -828,8 +839,8 @@
- [MsgReleaseTransferResponse](#lbm.fbridge.v1.MsgReleaseTransferResponse)
- [MsgRemoveProvision](#lbm.fbridge.v1.MsgRemoveProvision)
- [MsgRemoveProvisionResponse](#lbm.fbridge.v1.MsgRemoveProvisionResponse)
- - [MsgResume](#lbm.fbridge.v1.MsgResume)
- - [MsgResumeResponse](#lbm.fbridge.v1.MsgResumeResponse)
+ - [MsgSetBridgeStatus](#lbm.fbridge.v1.MsgSetBridgeStatus)
+ - [MsgSetBridgeStatusResponse](#lbm.fbridge.v1.MsgSetBridgeStatusResponse)
- [MsgSuggestRole](#lbm.fbridge.v1.MsgSuggestRole)
- [MsgSuggestRoleResponse](#lbm.fbridge.v1.MsgSuggestRoleResponse)
- [MsgTransfer](#lbm.fbridge.v1.MsgTransfer)
@@ -11385,77 +11396,164 @@ Msg defines the collection Msg service.
-
+
Top
-## lbm/fbridge/v1/event.proto
+## lbm/fbridge/v1/fbridge.proto
-
+
-### EventClaim
+### BridgeStatusMetadata
+BridgeStatusMetadata defines the metadata of the bridge status.
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| `inactive` | [uint64](#uint64) | | the number of inactived bridge switch |
+| `active` | [uint64](#uint64) | | the number of activated bridge switch |
+
+
+
+
+
+
+
+
+### Fraction
+Fraction defines the protobuf message type for tmmath.Fraction that only
+supports positive values.
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| `numerator` | [uint64](#uint64) | | |
+| `denominator` | [uint64](#uint64) | | |
+
+
+
+
+
+
+
+
+### Params
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| `operator_trust_level` | [Fraction](#lbm.fbridge.v1.Fraction) | | ratio of how many operators' confirmations are needed to be valid. |
+| `guardian_trust_level` | [Fraction](#lbm.fbridge.v1.Fraction) | | ratio of how many guardians' confirmations are needed to be valid. |
+| `judge_trust_level` | [Fraction](#lbm.fbridge.v1.Fraction) | | ratio of how many judges' confirmations are needed to be valid. |
+| `timelock_period` | [uint64](#uint64) | | default timelock period for each provision (unix timestamp) |
+| `proposal_period` | [uint64](#uint64) | | default period of the proposal to update the role |
+
+
+
+
+
+
+
+
+### ProvisionData
+Provision is a struct that represents a provision internally.
+
+
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `seq` | [uint64](#uint64) | | the sequence number of the bridge request |
+| `amount` | [string](#string) | | the amount of token to be claimed |
| `sender` | [string](#string) | | the sender address on the source chain |
| `receiver` | [string](#string) | | the recipient address on the destination chain |
-| `amount` | [string](#string) | | the amount of token to be claimed |
-
+
+
+### ProvisionStatus
+ProvisionStatus is a struct that represents the status of a provision.
+To optimize computational cost, we have collected frequently changing values from provision.
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| `timelock_end` | [uint64](#uint64) | | the unix timestamp the provision will be able to be claimed (unix timestamp) |
+| `confirm_counts` | [int32](#int32) | | a value that tells how many operators have submitted this provision |
+| `is_claimed` | [bool](#bool) | | whether the provision has been claimed |
+
-### EventConfirmProvision
+
+
+
+### RoleMetadata
+RoleMetadata defines the metadata of the role.
+
+
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
-| `seq` | [uint64](#uint64) | | the sequence number of the bridge request |
+| `guardian` | [uint64](#uint64) | | the number of registered guardians |
+| `operator` | [uint64](#uint64) | | the number of the operators |
+| `judge` | [uint64](#uint64) | | the number of the judges |
-
+
-### EventProvision
+### RolePair
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
-| `seq` | [uint64](#uint64) | | the sequence number of the bridge request |
-| `sender` | [string](#string) | | the sender address on the source chain |
-| `receiver` | [string](#string) | | the recipient address on the destination chain |
-| `amount` | [string](#string) | | the amount of token to be claimed |
-| `operator` | [string](#string) | | the address of the operator |
+| `address` | [string](#string) | | |
+| `role` | [Role](#lbm.fbridge.v1.Role) | | |
-
+
-### EventTransfer
+### RoleProposal
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
-| `seq` | [uint64](#uint64) | | the sequence number of the bridge request |
-| `sender` | [string](#string) | | the sender address on the source chain |
-| `receiver` | [string](#string) | | the recipient address on the destination chain |
-| `amount` | [string](#string) | | the amount of token to be transferred |
+| `id` | [uint64](#uint64) | | |
+| `proposer` | [string](#string) | | the proposer address |
+| `target` | [string](#string) | | the address to update the role |
+| `role` | [Role](#lbm.fbridge.v1.Role) | | the role to be updated - unspecified : 0, used to remove the address from a group - guardian : 1 - operator : 2 - judge : 3 |
+| `expired_at` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | the unix timestamp the proposal will be expired (unix timestamp) |
+
+
+
+
+
+
+
+
+### Vote
+Vote defines a vote on a role proposal.
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| `proposal_id` | [uint64](#uint64) | | |
+| `voter` | [string](#string) | | |
+| `option` | [VoteOption](#lbm.fbridge.v1.VoteOption) | | |
@@ -11463,6 +11561,46 @@ Msg defines the collection Msg service.
+
+
+
+### BridgeStatus
+
+
+| Name | Number | Description |
+| ---- | ------ | ----------- |
+| BRIDGE_STATUS_UNSPECIFIED | 0 | BRIDGE_STATUS_UNSPECIFIED defines an unspecified bridge status. |
+| BRIDGE_STATUS_ACTIVE | 1 | BRIDGE_STATUS_ACTIVE defines an active bridge status. |
+| BRIDGE_STATUS_INACTIVE | 2 | BRIDGE_STATUS_INACTIVE defines an inactive bridge status. |
+
+
+
+
+
+### Role
+Role defines the role of the operator, guardian, and judge.
+
+| Name | Number | Description |
+| ---- | ------ | ----------- |
+| UNSPECIFIED | 0 | |
+| GUARDIAN | 1 | |
+| OPERATOR | 2 | |
+| JUDGE | 3 | |
+
+
+
+
+
+### VoteOption
+VoteOption enumerates the valid vote options for a given role proposal.
+
+| Name | Number | Description |
+| ---- | ------ | ----------- |
+| VOTE_OPTION_UNSPECIFIED | 0 | VOTE_OPTION_UNSPECIFIED defines a no-op vote option. |
+| VOTE_OPTION_YES | 1 | VOTE_OPTION_YES defines a yes vote option. |
+| VOTE_OPTION_NO | 2 | VOTE_OPTION_NO defines a no vote option. |
+
+
@@ -11471,119 +11609,116 @@ Msg defines the collection Msg service.
-
+
Top
-## lbm/fbridge/v1/fbridge.proto
+## lbm/fbridge/v1/event.proto
-
+
+
+### EventAddVoteForRole
-### Fraction
-Fraction defines the protobuf message type for tmmath.Fraction that only
-supports positive values.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
-| `numerator` | [uint64](#uint64) | | |
-| `denominator` | [uint64](#uint64) | | |
+| `voter` | [string](#string) | | the voter address |
+| `proposal_id` | [uint64](#uint64) | | the role proposal id |
+| `option` | [VoteOption](#lbm.fbridge.v1.VoteOption) | | the vote option |
-
+
-### Params
+### EventClaim
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
-| `operator_trust_level` | [Fraction](#lbm.fbridge.v1.Fraction) | | ratio of how many operators' confirmations are needed to be valid. |
-| `guardian_trust_level` | [Fraction](#lbm.fbridge.v1.Fraction) | | ratio of how many guardians' confirmations are needed to be valid. |
-| `judge_trust_level` | [Fraction](#lbm.fbridge.v1.Fraction) | | ratio of how many judges' confirmations are needed to be valid. |
-| `timelock_period` | [uint64](#uint64) | | default timelock period for each provision (unix timestamp) |
-| `proposal_period` | [uint64](#uint64) | | default period of the proposal to update the role |
+| `seq` | [uint64](#uint64) | | the sequence number of the bridge request |
+| `sender` | [string](#string) | | the sender address on the source chain |
+| `receiver` | [string](#string) | | the recipient address on the destination chain |
+| `amount` | [string](#string) | | the amount of token to be claimed |
-
+
+
+### EventConfirmProvision
-### ProvisionData
-Provision is a struct that represents a provision internally.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `seq` | [uint64](#uint64) | | the sequence number of the bridge request |
-| `amount` | [string](#string) | | the amount of token to be claimed |
-| `sender` | [string](#string) | | the sender address on the source chain |
-| `receiver` | [string](#string) | | the recipient address on the destination chain |
-
+
+
+### EventProvision
-### ProvisionStatus
-ProvisionStatus is a struct that represents the status of a provision.
-To optimize computational cost, we have collected frequently changing values from provision.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
-| `timelock_end` | [uint64](#uint64) | | the unix timestamp the provision will be able to be claimed (unix timestamp) |
-| `confirm_counts` | [int32](#int32) | | a value that tells how many operators have submitted this provision |
-| `is_claimed` | [bool](#bool) | | whether the provision has been claimed |
+| `seq` | [uint64](#uint64) | | the sequence number of the bridge request |
+| `sender` | [string](#string) | | the sender address on the source chain |
+| `receiver` | [string](#string) | | the recipient address on the destination chain |
+| `amount` | [string](#string) | | the amount of token to be claimed |
+| `operator` | [string](#string) | | the address of the operator |
-
+
-### RoleProposal
+### EventSuggestRole
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
-| `id` | [uint64](#uint64) | | |
-| `proposer` | [string](#string) | | the proposer address |
-| `target` | [string](#string) | | the address to update the role |
-| `role` | [Role](#lbm.fbridge.v1.Role) | | the role to be updated - unspecified : 0, used to remove the address from a group - guardian : 1 - operator : 2 - judge : 3 |
-| `expired_at` | [uint64](#uint64) | | the unix timestamp the proposal will be expired (unix timestamp) |
+| `proposal` | [RoleProposal](#lbm.fbridge.v1.RoleProposal) | | |
-
+
-
+### EventTransfer
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| `seq` | [uint64](#uint64) | | the sequence number of the bridge request |
+| `sender` | [string](#string) | | the sender address on the source chain |
+| `receiver` | [string](#string) | | the recipient address on the destination chain |
+| `amount` | [string](#string) | | the amount of token to be transferred |
-### Role
-Role defines the role of the operator, guardian, and judge.
-| Name | Number | Description |
-| ---- | ------ | ----------- |
-| UNSPECIFIED | 0 | |
-| GUARDIAN | 1 | |
-| OPERATOR | 2 | |
-| JUDGE | 3 | |
+
+
+
@@ -11615,6 +11750,22 @@ Role defines the role of the operator, guardian, and judge.
+
+
+### BridgeSwitch
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| `guardian` | [string](#string) | | the guardian address |
+| `status` | [BridgeStatus](#lbm.fbridge.v1.BridgeStatus) | | |
+
+
+
+
+
+
### Commitment
@@ -11659,6 +11810,11 @@ GenesisState defines the fbridge module's genesis state.
| `params` | [Params](#lbm.fbridge.v1.Params) | | params defines all the parameters of the module. |
| `sending_state` | [SendingState](#lbm.fbridge.v1.SendingState) | | sending_state defines status saved when sending tokens to a counterpart chain |
| `receiving_state` | [ReceivingState](#lbm.fbridge.v1.ReceivingState) | | receiving_state defines status saved when receiving tokens from a counterpart chain |
+| `next_role_proposal_id` | [uint64](#uint64) | | next_role_proposal_id is the next role proposal ID to be used. |
+| `role_proposals` | [RoleProposal](#lbm.fbridge.v1.RoleProposal) | repeated | role_proposals defines all the role proposals present at genesis. |
+| `votes` | [Vote](#lbm.fbridge.v1.Vote) | repeated | votes defines all the votes present for role proposals at genesis. |
+| `roles` | [RolePair](#lbm.fbridge.v1.RolePair) | repeated | roles defines all addresses assigned roles at genesis. |
+| `bridge_switches` | [BridgeSwitch](#lbm.fbridge.v1.BridgeSwitch) | repeated | bridge_switches defines the status of whether each guardian has allowed the bridge to operate. |
@@ -11751,6 +11907,32 @@ GenesisState defines the fbridge module's genesis state.
+
+
+### QueryBridgeStatusRequest
+
+
+
+
+
+
+
+
+
+### QueryBridgeStatusResponse
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| `status` | [BridgeStatus](#lbm.fbridge.v1.BridgeStatus) | | |
+| `metadata` | [BridgeStatusMetadata](#lbm.fbridge.v1.BridgeStatusMetadata) | | |
+
+
+
+
+
+
### QueryCommitmentsRequest
@@ -11867,50 +12049,60 @@ GenesisState defines the fbridge module's genesis state.
-
+
+
+### QueryMemberRequest
-### QueryGuardiansRequest
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| `address` | [string](#string) | | |
-
-### QueryGuardiansResponse
+
+
+### QueryMemberResponse
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
-| `guardians` | [string](#string) | repeated | |
+| `role` | [string](#string) | | |
+
+
-
+### QueryMembersRequest
-### QueryJudgesRequest
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| `role` | [string](#string) | | the role name (guardian, operator, judge) |
-
-### QueryJudgesResponse
+
+
+### QueryMembersResponse
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
-| `judges` | [string](#string) | repeated | |
+| `members` | [string](#string) | repeated | |
@@ -11973,31 +12165,6 @@ GenesisState defines the fbridge module's genesis state.
-
-
-### QueryOperatorsRequest
-
-
-
-
-
-
-
-
-
-### QueryOperatorsResponse
-
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| `operators` | [string](#string) | repeated | |
-
-
-
-
-
-
### QueryParamsRequest
@@ -12031,7 +12198,7 @@ GenesisState defines the fbridge module's genesis state.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
-| `proposal_id` | [string](#string) | | the proposal id |
+| `proposal_id` | [uint64](#uint64) | | the proposal id |
@@ -12077,6 +12244,7 @@ GenesisState defines the fbridge module's genesis state.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `proposals` | [RoleProposal](#lbm.fbridge.v1.RoleProposal) | repeated | |
+| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines an pagination for the response. |
@@ -12144,6 +12312,67 @@ GenesisState defines the fbridge module's genesis state.
+
+
+
+### QueryVoteRequest
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| `proposal_id` | [uint64](#uint64) | | proposal_id defines the unique id of the proposal. |
+| `voter` | [string](#string) | | voter defines the oter address for the proposals. |
+
+
+
+
+
+
+
+
+### QueryVoteResponse
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| `vote` | [Vote](#lbm.fbridge.v1.Vote) | | vote defined the queried vote. |
+
+
+
+
+
+
+
+
+### QueryVotesRequest
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| `proposal_id` | [uint64](#uint64) | | proposal_id defines the unique id of the proposal. |
+
+
+
+
+
+
+
+
+### QueryVotesResponse
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| `votes` | [Vote](#lbm.fbridge.v1.Vote) | repeated | votes defined the queried votes. |
+
+
+
+
+
@@ -12167,11 +12396,13 @@ GenesisState defines the fbridge module's genesis state.
| `ConfirmedProvision` | [QueryConfirmedProvisionRequest](#lbm.fbridge.v1.QueryConfirmedProvisionRequest) | [QueryConfirmedProvisionResponse](#lbm.fbridge.v1.QueryConfirmedProvisionResponse) | ConfirmedProvision queries a particular sequence of confirmed provisions | GET|/lbm/fbridge/v1/receiving/provision/{seq}|
| `NeededSubmissionSeqs` | [QueryNeededSubmissionSeqsRequest](#lbm.fbridge.v1.QueryNeededSubmissionSeqsRequest) | [QueryNeededSubmissionSeqsResponse](#lbm.fbridge.v1.QueryNeededSubmissionSeqsResponse) | NeededSubmissionSeqs queries a list of sequence numbers that need to be submitted by a particular operator The search scope is [greatest_consecutive_seq_by_operator, min(greatest_consecutive_seq_by_operator + range, greatest_seq_by_operator)] greatest_consecutive_seq_by_operator can be replaced with greatest_consecutive_seq if the operator is newly added | GET|/lbm/fbridge/v1/receiving/operators/{operator}/needed_submission_seqs|
| `Commitments` | [QueryCommitmentsRequest](#lbm.fbridge.v1.QueryCommitmentsRequest) | [QueryCommitmentsResponse](#lbm.fbridge.v1.QueryCommitmentsResponse) | Commitments queries commitments of a specific sequence number | GET|/lbm/fbridge/v1/receiving/commitments/{seq}|
-| `Guardians` | [QueryGuardiansRequest](#lbm.fbridge.v1.QueryGuardiansRequest) | [QueryGuardiansResponse](#lbm.fbridge.v1.QueryGuardiansResponse) | Guardians queries a list of Guardians registered on the bridge | GET|/lbm/fbridge/v1/guardians|
-| `Operators` | [QueryOperatorsRequest](#lbm.fbridge.v1.QueryOperatorsRequest) | [QueryOperatorsResponse](#lbm.fbridge.v1.QueryOperatorsResponse) | Operators queries a list of Operators registered on the bridge | GET|/lbm/fbridge/v1/operators|
-| `Judges` | [QueryJudgesRequest](#lbm.fbridge.v1.QueryJudgesRequest) | [QueryJudgesResponse](#lbm.fbridge.v1.QueryJudgesResponse) | Judges queries a list of Judges registered on the bridge | GET|/lbm/fbridge/v1/judges|
-| `Proposals` | [QueryProposalsRequest](#lbm.fbridge.v1.QueryProposalsRequest) | [QueryProposalsResponse](#lbm.fbridge.v1.QueryProposalsResponse) | Proposals queries a list of SuggestRole Proposals | GET|/lbm/fbridge/v1/role/proposals|
-| `Proposal` | [QueryProposalRequest](#lbm.fbridge.v1.QueryProposalRequest) | [QueryProposalResponse](#lbm.fbridge.v1.QueryProposalResponse) | Proposal queries a SuggestRole Proposal | GET|/lbm/fbridge/v1/role/proposals/{proposal_id}|
+| `Members` | [QueryMembersRequest](#lbm.fbridge.v1.QueryMembersRequest) | [QueryMembersResponse](#lbm.fbridge.v1.QueryMembersResponse) | Members queries the members of spcific group registered on the bridge | GET|/lbm/fbridge/v1/members|
+| `Member` | [QueryMemberRequest](#lbm.fbridge.v1.QueryMemberRequest) | [QueryMemberResponse](#lbm.fbridge.v1.QueryMemberResponse) | Member queries the role of a specific member | GET|/lbm/fbridge/v1/members/{address}|
+| `Proposals` | [QueryProposalsRequest](#lbm.fbridge.v1.QueryProposalsRequest) | [QueryProposalsResponse](#lbm.fbridge.v1.QueryProposalsResponse) | Proposals queries a list of SuggestRole Proposals | GET|/lbm/fbridge/v1/proposals|
+| `Proposal` | [QueryProposalRequest](#lbm.fbridge.v1.QueryProposalRequest) | [QueryProposalResponse](#lbm.fbridge.v1.QueryProposalResponse) | Proposal queries a SuggestRole Proposal | GET|/lbm/fbridge/v1/proposals/{proposal_id}|
+| `Vote` | [QueryVoteRequest](#lbm.fbridge.v1.QueryVoteRequest) | [QueryVoteResponse](#lbm.fbridge.v1.QueryVoteResponse) | Vote queries voted information based on proposalID, voterAddr. | GET|/lbm/fbridge/v1/proposals/{proposal_id}/votes/{voter}|
+| `Votes` | [QueryVotesRequest](#lbm.fbridge.v1.QueryVotesRequest) | [QueryVotesResponse](#lbm.fbridge.v1.QueryVotesResponse) | Votes queries votes of a given proposal. | GET|/lbm/fbridge/v1/proposals/{proposal_id}/votes|
+| `BridgeStatus` | [QueryBridgeStatusRequest](#lbm.fbridge.v1.QueryBridgeStatusRequest) | [QueryBridgeStatusResponse](#lbm.fbridge.v1.QueryBridgeStatusResponse) | BridgeStatus queries the status of the bridge | GET|/lbm/fbridge/v1/status|
@@ -12194,7 +12425,7 @@ GenesisState defines the fbridge module's genesis state.
| ----- | ---- | ----- | ----------- |
| `from` | [string](#string) | | the guardian address |
| `proposal_id` | [uint64](#uint64) | | the proposal ID |
-| `option` | [bool](#bool) | | the vote option - yes : true - no : false |
+| `option` | [VoteOption](#lbm.fbridge.v1.VoteOption) | | the vote option |
@@ -12263,31 +12494,6 @@ MsgClaimBatch is input values required for claiming multiple claimable provision
-
-
-### MsgHalt
-MsgHalt is input values required for halting the bridge module
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| `guardian` | [string](#string) | | the guardian address |
-
-
-
-
-
-
-
-
-### MsgHaltResponse
-
-
-
-
-
-
-
### MsgHoldTransfer
@@ -12395,24 +12601,25 @@ MsgRemoveProvision is input values required for removing a specific confirmed pr
-
+
-### MsgResume
-MsgResume is input values required for resuming the bridge module
+### MsgSetBridgeStatus
+MsgSetBridgeStatus is input values required for setting the status of the bridge module
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
-| `from` | [string](#string) | | the guardian address |
+| `guardian` | [string](#string) | | the guardian address |
+| `status` | [BridgeStatus](#lbm.fbridge.v1.BridgeStatus) | | |
-
+
-### MsgResumeResponse
+### MsgSetBridgeStatusResponse
@@ -12496,8 +12703,7 @@ MsgTransfer is input values required for bridge transfer
| `Claim` | [MsgClaim](#lbm.fbridge.v1.MsgClaim) | [MsgClaimResponse](#lbm.fbridge.v1.MsgClaimResponse) | Claim processes the claiming of a provision with a specific sequence number | |
| `SuggestRole` | [MsgSuggestRole](#lbm.fbridge.v1.MsgSuggestRole) | [MsgSuggestRoleResponse](#lbm.fbridge.v1.MsgSuggestRoleResponse) | SuggestRole suggests updating the role of an address in the bridge module. The role can be one of the following: guardian, operator, judge. The proposal will be passed only with the consent of +2/3 Guardian members. | |
| `AddVoteForRole` | [MsgAddVoteForRole](#lbm.fbridge.v1.MsgAddVoteForRole) | [MsgAddVoteForRoleResponse](#lbm.fbridge.v1.MsgAddVoteForRoleResponse) | AddVoteForRole adds a vote for a role change proposal. | |
-| `Halt` | [MsgHalt](#lbm.fbridge.v1.MsgHalt) | [MsgHaltResponse](#lbm.fbridge.v1.MsgHaltResponse) | Halt the bridge module. | |
-| `Resume` | [MsgResume](#lbm.fbridge.v1.MsgResume) | [MsgResumeResponse](#lbm.fbridge.v1.MsgResumeResponse) | Resume the bridge module. | |
+| `SetBridgeStatus` | [MsgSetBridgeStatus](#lbm.fbridge.v1.MsgSetBridgeStatus) | [MsgSetBridgeStatusResponse](#lbm.fbridge.v1.MsgSetBridgeStatusResponse) | SetBridgeStatus operates a switch to halt/resume the bridge module. If the ratio of inactive bridge switches exceed TrustLevel, the bridge module halts. | |
diff --git a/proto/lbm/fbridge/v1/event.proto b/proto/lbm/fbridge/v1/event.proto
index e7594d4dc8..324a2db2a2 100644
--- a/proto/lbm/fbridge/v1/event.proto
+++ b/proto/lbm/fbridge/v1/event.proto
@@ -3,6 +3,9 @@ package lbm.fbridge.v1;
option go_package = "github.com/Finschia/finschia-sdk/x/fbridge/types";
+import "gogoproto/gogo.proto";
+import "lbm/fbridge/v1/fbridge.proto";
+
message EventTransfer {
// the sequence number of the bridge request
uint64 seq = 1;
@@ -14,6 +17,19 @@ message EventTransfer {
string amount = 4;
}
+message EventSuggestRole {
+ RoleProposal proposal = 1 [(gogoproto.nullable) = false];
+}
+
+message EventAddVoteForRole {
+ // the voter address
+ string voter = 1;
+ // the role proposal id
+ uint64 proposal_id = 2;
+ // the vote option
+ VoteOption option = 3;
+}
+
message EventProvision {
// the sequence number of the bridge request
uint64 seq = 1;
diff --git a/proto/lbm/fbridge/v1/fbridge.proto b/proto/lbm/fbridge/v1/fbridge.proto
index fccbf79a22..c3c4d5b6c7 100644
--- a/proto/lbm/fbridge/v1/fbridge.proto
+++ b/proto/lbm/fbridge/v1/fbridge.proto
@@ -3,6 +3,7 @@ package lbm.fbridge.v1;
option go_package = "github.com/Finschia/finschia-sdk/x/fbridge/types";
+import "google/protobuf/timestamp.proto";
import "gogoproto/gogo.proto";
message Params {
@@ -51,10 +52,17 @@ message Fraction {
// Role defines the role of the operator, guardian, and judge.
enum Role {
- UNSPECIFIED = 0;
- GUARDIAN = 1;
- OPERATOR = 2;
- JUDGE = 3;
+ option (gogoproto.goproto_enum_prefix) = false;
+
+ UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "RoleEmpty"];
+ GUARDIAN = 1 [(gogoproto.enumvalue_customname) = "RoleGuardian"];
+ OPERATOR = 2 [(gogoproto.enumvalue_customname) = "RoleOperator"];
+ JUDGE = 3 [(gogoproto.enumvalue_customname) = "RoleJudge"];
+}
+
+message RolePair {
+ string address = 1;
+ Role role = 2;
}
message RoleProposal {
@@ -71,5 +79,56 @@ message RoleProposal {
Role role = 4;
// the unix timestamp the proposal will be expired (unix timestamp)
- uint64 expired_at = 5;
+ google.protobuf.Timestamp expired_at = 5 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
+}
+
+// VoteOption enumerates the valid vote options for a given role proposal.
+enum VoteOption {
+ option (gogoproto.goproto_enum_prefix) = false;
+
+ // VOTE_OPTION_UNSPECIFIED defines a no-op vote option.
+ VOTE_OPTION_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "OptionEmpty"];
+ // VOTE_OPTION_YES defines a yes vote option.
+ VOTE_OPTION_YES = 1 [(gogoproto.enumvalue_customname) = "OptionYes"];
+ // VOTE_OPTION_NO defines a no vote option.
+ VOTE_OPTION_NO = 2 [(gogoproto.enumvalue_customname) = "OptionNo"];
+}
+
+// Vote defines a vote on a role proposal.
+message Vote {
+ option (gogoproto.equal) = false;
+
+ uint64 proposal_id = 1;
+ string voter = 2;
+ VoteOption option = 3;
+}
+
+// RoleMetadata defines the metadata of the role.
+message RoleMetadata {
+ // the number of registered guardians
+ uint64 guardian = 1;
+ // the number of the operators
+ uint64 operator = 2;
+ // the number of the judges
+ uint64 judge = 3;
+}
+
+enum BridgeStatus {
+ option (gogoproto.goproto_enum_prefix) = false;
+
+ // BRIDGE_STATUS_UNSPECIFIED defines an unspecified bridge status.
+ BRIDGE_STATUS_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "StatusEmpty"];
+
+ // BRIDGE_STATUS_ACTIVE defines an active bridge status.
+ BRIDGE_STATUS_ACTIVE = 1 [(gogoproto.enumvalue_customname) = "StatusActive"];
+ // BRIDGE_STATUS_INACTIVE defines an inactive bridge status.
+ BRIDGE_STATUS_INACTIVE = 2 [(gogoproto.enumvalue_customname) = "StatusInactive"];
+}
+
+// BridgeStatusMetadata defines the metadata of the bridge status.
+message BridgeStatusMetadata {
+ // the number of inactived bridge switch
+ uint64 inactive = 1;
+ // the number of activated bridge switch
+ uint64 active = 2;
}
diff --git a/proto/lbm/fbridge/v1/genesis.proto b/proto/lbm/fbridge/v1/genesis.proto
index 35775047b2..57d5260328 100644
--- a/proto/lbm/fbridge/v1/genesis.proto
+++ b/proto/lbm/fbridge/v1/genesis.proto
@@ -14,6 +14,16 @@ message GenesisState {
SendingState sending_state = 2 [(gogoproto.nullable) = false];
// receiving_state defines status saved when receiving tokens from a counterpart chain
ReceivingState receiving_state = 3 [(gogoproto.nullable) = false];
+ // next_role_proposal_id is the next role proposal ID to be used.
+ uint64 next_role_proposal_id = 4;
+ // role_proposals defines all the role proposals present at genesis.
+ repeated RoleProposal role_proposals = 5 [(gogoproto.nullable) = false];
+ // votes defines all the votes present for role proposals at genesis.
+ repeated Vote votes = 6 [(gogoproto.nullable) = false];
+ // roles defines all addresses assigned roles at genesis.
+ repeated RolePair roles = 7 [(gogoproto.nullable) = false];
+ // bridge_switches defines the status of whether each guardian has allowed the bridge to operate.
+ repeated BridgeSwitch bridge_switches = 8 [(gogoproto.nullable) = false];
}
message SendingState {
@@ -79,3 +89,9 @@ message ConfirmedProvision {
// commitment is the hash value of a provision
string commitment = 2;
}
+
+message BridgeSwitch {
+ // the guardian address
+ string guardian = 1;
+ BridgeStatus status = 2;
+}
diff --git a/proto/lbm/fbridge/v1/query.proto b/proto/lbm/fbridge/v1/query.proto
index 120039df88..b59d513956 100644
--- a/proto/lbm/fbridge/v1/query.proto
+++ b/proto/lbm/fbridge/v1/query.proto
@@ -58,29 +58,39 @@ service Query {
option (google.api.http).get = "/lbm/fbridge/v1/receiving/commitments/{seq}";
}
- // Guardians queries a list of Guardians registered on the bridge
- rpc Guardians(QueryGuardiansRequest) returns (QueryGuardiansResponse) {
- option (google.api.http).get = "/lbm/fbridge/v1/guardians";
+ // Members queries the members of spcific group registered on the bridge
+ rpc Members(QueryMembersRequest) returns (QueryMembersResponse) {
+ option (google.api.http).get = "/lbm/fbridge/v1/members";
}
- // Operators queries a list of Operators registered on the bridge
- rpc Operators(QueryOperatorsRequest) returns (QueryOperatorsResponse) {
- option (google.api.http).get = "/lbm/fbridge/v1/operators";
- }
-
- // Judges queries a list of Judges registered on the bridge
- rpc Judges(QueryJudgesRequest) returns (QueryJudgesResponse) {
- option (google.api.http).get = "/lbm/fbridge/v1/judges";
+ // Member queries the role of a specific member
+ rpc Member(QueryMemberRequest) returns (QueryMemberResponse) {
+ option (google.api.http).get = "/lbm/fbridge/v1/members/{address}";
}
// Proposals queries a list of SuggestRole Proposals
rpc Proposals(QueryProposalsRequest) returns (QueryProposalsResponse) {
- option (google.api.http).get = "/lbm/fbridge/v1/role/proposals";
+ option (google.api.http).get = "/lbm/fbridge/v1/proposals";
}
// Proposal queries a SuggestRole Proposal
rpc Proposal(QueryProposalRequest) returns (QueryProposalResponse) {
- option (google.api.http).get = "/lbm/fbridge/v1/role/proposals/{proposal_id}";
+ option (google.api.http).get = "/lbm/fbridge/v1/proposals/{proposal_id}";
+ }
+
+ // Vote queries voted information based on proposalID, voterAddr.
+ rpc Vote(QueryVoteRequest) returns (QueryVoteResponse) {
+ option (google.api.http).get = "/lbm/fbridge/v1/proposals/{proposal_id}/votes/{voter}";
+ }
+
+ // Votes queries votes of a given proposal.
+ rpc Votes(QueryVotesRequest) returns (QueryVotesResponse) {
+ option (google.api.http).get = "/lbm/fbridge/v1/proposals/{proposal_id}/votes";
+ }
+
+ // BridgeStatus queries the status of the bridge
+ rpc BridgeStatus(QueryBridgeStatusRequest) returns (QueryBridgeStatusResponse) {
+ option (google.api.http).get = "/lbm/fbridge/v1/status";
}
}
@@ -162,22 +172,21 @@ message QueryCommitmentsResponse {
repeated string commitments = 1;
}
-message QueryGuardiansRequest {}
-
-message QueryGuardiansResponse {
- repeated string guardians = 1;
+message QueryMembersRequest {
+ // the role name (guardian, operator, judge)
+ string role = 1;
}
-message QueryOperatorsRequest {}
-
-message QueryOperatorsResponse {
- repeated string operators = 1;
+message QueryMembersResponse {
+ repeated string members = 1;
}
-message QueryJudgesRequest {}
+message QueryMemberRequest {
+ string address = 1;
+}
-message QueryJudgesResponse {
- repeated string judges = 1;
+message QueryMemberResponse {
+ string role = 1;
}
message QueryProposalsRequest {
@@ -186,14 +195,47 @@ message QueryProposalsRequest {
}
message QueryProposalsResponse {
- repeated RoleProposal proposals = 1;
+ repeated RoleProposal proposals = 1 [(gogoproto.nullable) = false];
+
+ // pagination defines an pagination for the response.
+ cosmos.base.query.v1beta1.PageResponse pagination = 2;
}
message QueryProposalRequest {
// the proposal id
- string proposal_id = 1;
+ uint64 proposal_id = 1;
}
message QueryProposalResponse {
- RoleProposal proposal = 1;
+ RoleProposal proposal = 1 [(gogoproto.nullable) = false];
+}
+
+message QueryVoteRequest {
+ // proposal_id defines the unique id of the proposal.
+ uint64 proposal_id = 1;
+
+ // voter defines the oter address for the proposals.
+ string voter = 2;
+}
+
+message QueryVoteResponse {
+ // vote defined the queried vote.
+ Vote vote = 1 [(gogoproto.nullable) = false];
+}
+
+message QueryVotesRequest {
+ // proposal_id defines the unique id of the proposal.
+ uint64 proposal_id = 1;
+}
+
+message QueryVotesResponse {
+ // votes defined the queried votes.
+ repeated Vote votes = 1 [(gogoproto.nullable) = false];
+}
+
+message QueryBridgeStatusRequest {}
+
+message QueryBridgeStatusResponse {
+ BridgeStatus status = 1;
+ BridgeStatusMetadata metadata = 2 [(gogoproto.nullable) = false];
}
diff --git a/proto/lbm/fbridge/v1/tx.proto b/proto/lbm/fbridge/v1/tx.proto
index 8b114a8645..e1186ec588 100644
--- a/proto/lbm/fbridge/v1/tx.proto
+++ b/proto/lbm/fbridge/v1/tx.proto
@@ -36,11 +36,9 @@ service Msg {
// AddVoteForRole adds a vote for a role change proposal.
rpc AddVoteForRole(MsgAddVoteForRole) returns (MsgAddVoteForRoleResponse);
- // Halt the bridge module.
- rpc Halt(MsgHalt) returns (MsgHaltResponse);
-
- // Resume the bridge module.
- rpc Resume(MsgResume) returns (MsgResumeResponse);
+ // SetBridgeStatus operates a switch to halt/resume the bridge module.
+ // If the ratio of inactive bridge switches exceed TrustLevel, the bridge module halts.
+ rpc SetBridgeStatus(MsgSetBridgeStatus) returns (MsgSetBridgeStatusResponse);
}
// MsgTransfer is input values required for bridge transfer
@@ -145,25 +143,17 @@ message MsgAddVoteForRole {
// the proposal ID
uint64 proposal_id = 2;
// the vote option
- // - yes : true
- // - no : false
- bool option = 3;
+ VoteOption option = 3;
}
message MsgAddVoteForRoleResponse {}
-// MsgHalt is input values required for halting the bridge module
-message MsgHalt {
+// MsgSetBridgeStatus is input values required for setting the status of the bridge module
+message MsgSetBridgeStatus {
// the guardian address
string guardian = 1;
-}
-
-message MsgHaltResponse {}
-// MsgResume is input values required for resuming the bridge module
-message MsgResume {
- // the guardian address
- string from = 1;
+ BridgeStatus status = 2;
}
-message MsgResumeResponse {}
+message MsgSetBridgeStatusResponse {}
diff --git a/simapp/app.go b/simapp/app.go
index 7bb68f2e01..9b064b19b2 100644
--- a/simapp/app.go
+++ b/simapp/app.go
@@ -271,7 +271,7 @@ func NewSimApp(
tkeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey)
// NOTE: The testingkey is just mounted for testing purposes. Actual applications should
// not include this key.
- memKeys := sdk.NewMemoryStoreKeys(capabilitytypes.MemStoreKey, "testingkey")
+ memKeys := sdk.NewMemoryStoreKeys(capabilitytypes.MemStoreKey, fbridgetypes.MemStoreKey, "testingkey")
// configure state listening capabilities using AppOptions
// we are doing nothing with the returned streamingServices and waitGroup in this case
@@ -373,7 +373,7 @@ func NewSimApp(
// If evidence needs to be handled for the app, set routes in router here and seal
app.EvidenceKeeper = *evidenceKeeper
- app.FbridgeKeeper = fbridgekeeper.NewKeeper(appCodec, keys[fbridgetypes.StoreKey], app.AccountKeeper, app.BankKeeper, "stake", authtypes.NewModuleAddress(govtypes.ModuleName).String())
+ app.FbridgeKeeper = fbridgekeeper.NewKeeper(appCodec, keys[fbridgetypes.StoreKey], memKeys[fbridgetypes.MemStoreKey], app.AccountKeeper, app.BankKeeper, "stake", fbridgetypes.DefaultAuthority().String())
/**** Module Options ****/
@@ -471,6 +471,7 @@ func NewSimApp(
capabilitytypes.ModuleName,
authtypes.ModuleName,
banktypes.ModuleName,
+ fbridgetypes.ModuleName,
distrtypes.ModuleName,
stakingtypes.ModuleName,
slashingtypes.ModuleName,
@@ -488,7 +489,6 @@ func NewSimApp(
token.ModuleName,
collection.ModuleName,
fswaptypes.ModuleName,
- fbridgetypes.ModuleName,
)
// Uncomment if you want to set a custom migration order here.
diff --git a/x/ERRORS.md b/x/ERRORS.md
index dcf56afb65..d8dc1ea25e 100644
--- a/x/ERRORS.md
+++ b/x/ERRORS.md
@@ -7,6 +7,7 @@
* [Crisis](#crisis)
* [Distribution](#distribution)
* [Evidence](#evidence)
+ * [Fbridge](#fbridge)
* [Feegrant](#feegrant)
* [Foundation](#foundation)
* [Fswap](#fswap)
@@ -151,6 +152,17 @@
>You can also find detailed information in the following Errors.go files:
* [evidence/types/errors.go](evidence/types/errors.go)
+## Fbridge
+
+|Error Name|Codespace|Code|Description|
+|:-|:-|:-|:-|
+|ErrUnknownProposal|fbridge|2|unknown proposal|
+|ErrUnknownVote|fbridge|3|unknown vote|
+|ErrInactiveBridge|fbridge|4|the bridge has halted|
+
+>You can also find detailed information in the following Errors.go files:
+ * [fbridge/types/errors.go](fbridge/types/errors.go)
+
## Feegrant
|Error Name|Codespace|Code|Description|
diff --git a/x/fbridge/client/cli/query.go b/x/fbridge/client/cli/query.go
index 4878af22e7..19708afb6e 100644
--- a/x/fbridge/client/cli/query.go
+++ b/x/fbridge/client/cli/query.go
@@ -2,6 +2,7 @@ package cli
import (
"fmt"
+ "strconv"
"github.com/spf13/cobra"
@@ -23,13 +24,45 @@ func NewQueryCmd() *cobra.Command {
}
cmd.AddCommand(
+ NewQueryParamsCmd(),
NewQueryNextSeqSendCmd(),
NewQuerySeqToBlocknumsCmd(),
+ NewQueryMembersCmd(),
+ NewQueryMemberCmd(),
+ NewQueryProposalsCmd(),
+ NewQueryProposalCmd(),
+ NewQueryVotesCmd(),
+ NewQueryVoteCmd(),
+ NewQueryBridgeStatusCmd(),
)
return cmd
}
+func NewQueryParamsCmd() *cobra.Command {
+ cmd := &cobra.Command{
+ Use: "params",
+ Short: "Query the current fbridge module parameters",
+ Args: cobra.NoArgs,
+ RunE: func(cmd *cobra.Command, args []string) error {
+ clientCtx, err := client.GetClientQueryContext(cmd)
+ if err != nil {
+ return err
+ }
+ qc := types.NewQueryClient(clientCtx)
+ res, err := qc.Params(cmd.Context(), &types.QueryParamsRequest{})
+ if err != nil {
+ return err
+ }
+
+ return clientCtx.PrintProto(res)
+ },
+ }
+
+ flags.AddQueryFlagsToCmd(cmd)
+ return cmd
+}
+
func NewQueryNextSeqSendCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "sending-next-seq",
@@ -59,7 +92,7 @@ func NewQuerySeqToBlocknumsCmd() *cobra.Command {
Use: "seq-to-blocknums",
Short: "Query the block number for given sequence numbers",
Args: cobra.NoArgs,
- Example: fmt.Sprintf("%s query %s sending seq-to-blocknums --sequences=1,2,3", version.AppName, types.ModuleName),
+ Example: fmt.Sprintf("%s query %s seq-to-blocknums --sequences=1,2,3", version.AppName, types.ModuleName),
RunE: func(cmd *cobra.Command, args []string) error {
clientCtx, err := client.GetClientQueryContext(cmd)
if err != nil {
@@ -90,3 +123,202 @@ func NewQuerySeqToBlocknumsCmd() *cobra.Command {
flags.AddQueryFlagsToCmd(cmd)
return cmd
}
+
+func NewQueryMembersCmd() *cobra.Command {
+ cmd := &cobra.Command{
+ Use: "members [role]",
+ Short: "Query the members of spcific group registered on the bridge (guardian|operator|judge)",
+ Args: cobra.ExactArgs(1),
+ Example: fmt.Sprintf("%s query %s members guardian", version.AppName, types.ModuleName),
+ RunE: func(cmd *cobra.Command, args []string) error {
+ clientCtx, err := client.GetClientQueryContext(cmd)
+ if err != nil {
+ return err
+ }
+ qc := types.NewQueryClient(clientCtx)
+
+ res, err := qc.Members(cmd.Context(), &types.QueryMembersRequest{Role: args[0]})
+ if err != nil {
+ return err
+ }
+
+ return clientCtx.PrintProto(res)
+ },
+ }
+
+ flags.AddQueryFlagsToCmd(cmd)
+ return cmd
+}
+
+func NewQueryMemberCmd() *cobra.Command {
+ cmd := &cobra.Command{
+ Use: "member [address]",
+ Short: "Query the roles of a specific member registered on the bridge",
+ Args: cobra.ExactArgs(1),
+ Example: fmt.Sprintf("%s query %s member link1...", version.AppName, types.ModuleName),
+ RunE: func(cmd *cobra.Command, args []string) error {
+ clientCtx, err := client.GetClientQueryContext(cmd)
+ if err != nil {
+ return err
+ }
+ qc := types.NewQueryClient(clientCtx)
+
+ res, err := qc.Member(cmd.Context(), &types.QueryMemberRequest{Address: args[0]})
+ if err != nil {
+ return err
+ }
+
+ return clientCtx.PrintProto(res)
+ },
+ }
+
+ flags.AddQueryFlagsToCmd(cmd)
+ return cmd
+}
+
+func NewQueryProposalsCmd() *cobra.Command {
+ cmd := &cobra.Command{
+ Use: "proposals",
+ Short: "Query all role proposals",
+ Args: cobra.NoArgs,
+ Example: fmt.Sprintf("%s query %s proposals", version.AppName, types.ModuleName),
+ RunE: func(cmd *cobra.Command, args []string) error {
+ clientCtx, err := client.GetClientQueryContext(cmd)
+ if err != nil {
+ return err
+ }
+ qc := types.NewQueryClient(clientCtx)
+ pageReq, err := client.ReadPageRequest(cmd.Flags())
+ if err != nil {
+ return err
+ }
+
+ res, err := qc.Proposals(cmd.Context(), &types.QueryProposalsRequest{Pagination: pageReq})
+ if err != nil {
+ return err
+ }
+
+ return clientCtx.PrintProto(res)
+ },
+ }
+
+ flags.AddQueryFlagsToCmd(cmd)
+ flags.AddPaginationFlagsToCmd(cmd, "all proposals")
+ return cmd
+}
+
+func NewQueryProposalCmd() *cobra.Command {
+ cmd := &cobra.Command{
+ Use: "proposal [proposal_id]",
+ Short: "Query a specific role proposal",
+ Args: cobra.ExactArgs(1),
+ Example: fmt.Sprintf("%s query %s proposal 1", version.AppName, types.ModuleName),
+ RunE: func(cmd *cobra.Command, args []string) error {
+ clientCtx, err := client.GetClientQueryContext(cmd)
+ if err != nil {
+ return err
+ }
+ qc := types.NewQueryClient(clientCtx)
+
+ id, err := strconv.ParseUint(args[0], 10, 64)
+ if err != nil {
+ return err
+ }
+
+ res, err := qc.Proposal(cmd.Context(), &types.QueryProposalRequest{ProposalId: id})
+ if err != nil {
+ return err
+ }
+
+ return clientCtx.PrintProto(res)
+ },
+ }
+
+ flags.AddQueryFlagsToCmd(cmd)
+ return cmd
+}
+
+func NewQueryVotesCmd() *cobra.Command {
+ cmd := &cobra.Command{
+ Use: "votes [proposal_id]",
+ Short: "Query all votes for a specific role proposal",
+ Args: cobra.ExactArgs(1),
+ Example: fmt.Sprintf("%s query %s votes 1", version.AppName, types.ModuleName),
+ RunE: func(cmd *cobra.Command, args []string) error {
+ clientCtx, err := client.GetClientQueryContext(cmd)
+ if err != nil {
+ return err
+ }
+ qc := types.NewQueryClient(clientCtx)
+
+ id, err := strconv.ParseUint(args[0], 10, 64)
+ if err != nil {
+ return err
+ }
+
+ res, err := qc.Votes(cmd.Context(), &types.QueryVotesRequest{ProposalId: id})
+ if err != nil {
+ return err
+ }
+
+ return clientCtx.PrintProto(res)
+ },
+ }
+
+ flags.AddQueryFlagsToCmd(cmd)
+ return cmd
+}
+
+func NewQueryVoteCmd() *cobra.Command {
+ cmd := &cobra.Command{
+ Use: "vote [proposal_id] [voter]",
+ Short: "Query a specific vote for a role proposal",
+ Args: cobra.ExactArgs(2),
+ Example: fmt.Sprintf("%s query %s vote 1 link1...", version.AppName, types.ModuleName),
+ RunE: func(cmd *cobra.Command, args []string) error {
+ clientCtx, err := client.GetClientQueryContext(cmd)
+ if err != nil {
+ return err
+ }
+ qc := types.NewQueryClient(clientCtx)
+
+ id, err := strconv.ParseUint(args[0], 10, 64)
+ if err != nil {
+ return err
+ }
+
+ res, err := qc.Vote(cmd.Context(), &types.QueryVoteRequest{ProposalId: id, Voter: args[1]})
+ if err != nil {
+ return err
+ }
+
+ return clientCtx.PrintProto(res)
+ },
+ }
+
+ flags.AddQueryFlagsToCmd(cmd)
+ return cmd
+}
+
+func NewQueryBridgeStatusCmd() *cobra.Command {
+ cmd := &cobra.Command{
+ Use: "status",
+ Short: "Query the current status of the bridge",
+ Args: cobra.NoArgs,
+ RunE: func(cmd *cobra.Command, args []string) error {
+ clientCtx, err := client.GetClientQueryContext(cmd)
+ if err != nil {
+ return err
+ }
+ qc := types.NewQueryClient(clientCtx)
+ res, err := qc.BridgeStatus(cmd.Context(), &types.QueryBridgeStatusRequest{})
+ if err != nil {
+ return err
+ }
+ return clientCtx.PrintProto(res)
+ },
+ }
+
+ flags.AddQueryFlagsToCmd(cmd)
+ return cmd
+}
diff --git a/x/fbridge/client/cli/tx.go b/x/fbridge/client/cli/tx.go
index 8aa3b892bb..887e5bf586 100644
--- a/x/fbridge/client/cli/tx.go
+++ b/x/fbridge/client/cli/tx.go
@@ -1,6 +1,9 @@
package cli
import (
+ "fmt"
+ "strconv"
+
"github.com/spf13/cobra"
"github.com/Finschia/finschia-sdk/client"
@@ -8,6 +11,7 @@ import (
"github.com/Finschia/finschia-sdk/client/tx"
sdk "github.com/Finschia/finschia-sdk/types"
sdkerrors "github.com/Finschia/finschia-sdk/types/errors"
+ "github.com/Finschia/finschia-sdk/version"
"github.com/Finschia/finschia-sdk/x/fbridge/types"
)
@@ -23,6 +27,9 @@ func NewTxCmd() *cobra.Command {
TxCmd.AddCommand(
NewTransferTxCmd(),
+ NewSuggestRoleTxCmd(),
+ NewAddVoteForRoleTxCmd(),
+ NewSetBridgeStatusTxCmd(),
)
return TxCmd
@@ -30,9 +37,10 @@ func NewTxCmd() *cobra.Command {
func NewTransferTxCmd() *cobra.Command {
cmd := &cobra.Command{
- Use: "transfer [to_address] [amount]",
- Short: `Transfer token from current chain to counterparty chain`,
- Args: cobra.ExactArgs(2),
+ Use: "transfer [to_address] [amount]",
+ Short: `Transfer token from current chain to counterparty chain`,
+ Example: fmt.Sprintf("%s tx %s transfer link1... 1000cony --from mykey", version.AppName, types.ModuleName),
+ Args: cobra.ExactArgs(2),
RunE: func(cmd *cobra.Command, args []string) error {
clientCtx, err := client.GetClientTxContext(cmd)
if err != nil {
@@ -65,3 +73,119 @@ func NewTransferTxCmd() *cobra.Command {
return cmd
}
+
+func NewSuggestRoleTxCmd() *cobra.Command {
+ cmd := &cobra.Command{
+ Use: "suggest-role [target_address] [role]",
+ Short: `Suggest a role to a specific address (unspecified|guardian|operator|judge)`,
+ Args: cobra.ExactArgs(2),
+ Example: fmt.Sprintf("%s tx %s suggest-role link1... guardian --from guardiankey", version.AppName, types.ModuleName),
+ RunE: func(cmd *cobra.Command, args []string) error {
+ clientCtx, err := client.GetClientTxContext(cmd)
+ if err != nil {
+ return err
+ }
+ from := clientCtx.GetFromAddress().String()
+ if _, err := sdk.AccAddressFromBech32(from); err != nil {
+ return sdkerrors.ErrInvalidAddress.Wrapf("invalid address: %s", from)
+ }
+ target := args[0]
+ role, found := types.QueryParamToRole[args[1]]
+ if !found {
+ return sdkerrors.ErrInvalidRequest.Wrapf("invalid role: %s", args[1])
+ }
+
+ msg := types.MsgSuggestRole{
+ From: from,
+ Target: target,
+ Role: role,
+ }
+
+ return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), &msg)
+ },
+ }
+
+ flags.AddTxFlagsToCmd(cmd)
+
+ return cmd
+}
+
+func NewAddVoteForRoleTxCmd() *cobra.Command {
+ cmd := &cobra.Command{
+ Use: "add-vote-for-role [proposal_id] [option]",
+ Short: `Vote for a role proposal (yes|no)`,
+ Args: cobra.ExactArgs(2),
+ Example: fmt.Sprintf("%s tx %s add-vote-for-role 1 yes --from guardiankey", version.AppName, types.ModuleName),
+ RunE: func(cmd *cobra.Command, args []string) error {
+ clientCtx, err := client.GetClientTxContext(cmd)
+ if err != nil {
+ return err
+ }
+ from := clientCtx.GetFromAddress().String()
+ if _, err := sdk.AccAddressFromBech32(from); err != nil {
+ return sdkerrors.ErrInvalidAddress.Wrapf("invalid address: %s", from)
+ }
+ proposalID, err := strconv.ParseUint(args[0], 10, 64)
+ if err != nil {
+ return sdkerrors.ErrInvalidRequest.Wrapf("invalid proposal ID: %s", args[0])
+ }
+
+ voteOpts := map[string]types.VoteOption{
+ "yes": types.OptionYes,
+ "no": types.OptionNo,
+ }
+ option, found := voteOpts[args[1]]
+ if !found {
+ return sdkerrors.ErrInvalidRequest.Wrapf("invalid vote option: %s", args[1])
+ }
+
+ msg := types.MsgAddVoteForRole{
+ From: from,
+ ProposalId: proposalID,
+ Option: option,
+ }
+
+ return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), &msg)
+ },
+ }
+
+ flags.AddTxFlagsToCmd(cmd)
+
+ return cmd
+}
+
+func NewSetBridgeStatusTxCmd() *cobra.Command {
+ cmd := &cobra.Command{
+ Use: "set-bridge-status [status]",
+ Short: `Set sender's bridge switch for halting/resuming the bridge module. Each guardian has their own switch. (halt|resume)`,
+ Args: cobra.ExactArgs(1),
+ Example: fmt.Sprintf("%s tx %s set-bridge-status halt --from guardiankey\n"+
+ "%s tx %s set-bridge-status resume --from guardiankey\n", version.AppName, types.ModuleName, version.AppName, types.ModuleName),
+ RunE: func(cmd *cobra.Command, args []string) error {
+ clientCtx, err := client.GetClientTxContext(cmd)
+ if err != nil {
+ return err
+ }
+ from := clientCtx.GetFromAddress().String()
+ if _, err := sdk.AccAddressFromBech32(from); err != nil {
+ return sdkerrors.ErrInvalidAddress.Wrapf("invalid address: %s", from)
+ }
+
+ conv := map[string]types.BridgeStatus{
+ "halt": types.StatusInactive,
+ "resume": types.StatusActive,
+ }
+
+ msg := types.MsgSetBridgeStatus{
+ Guardian: from,
+ Status: conv[args[0]],
+ }
+
+ return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), &msg)
+ },
+ }
+
+ flags.AddTxFlagsToCmd(cmd)
+
+ return cmd
+}
diff --git a/x/fbridge/keeper/abci.go b/x/fbridge/keeper/abci.go
new file mode 100644
index 0000000000..28b5333b1f
--- /dev/null
+++ b/x/fbridge/keeper/abci.go
@@ -0,0 +1,65 @@
+package keeper
+
+import (
+ "fmt"
+
+ sdk "github.com/Finschia/finschia-sdk/types"
+ "github.com/Finschia/finschia-sdk/x/fbridge/types"
+)
+
+func (k Keeper) BeginBlocker(ctx sdk.Context) {
+ k.InitMemStore(ctx)
+
+ proposals := k.GetRoleProposals(ctx)
+ for _, proposal := range proposals {
+ if ctx.BlockTime().After(proposal.ExpiredAt) {
+ k.deleteRoleProposal(ctx, proposal.Id)
+ }
+ }
+}
+
+func (k Keeper) EndBlocker(ctx sdk.Context) {
+ guardianTrustLevel := k.GetParams(ctx).GuardianTrustLevel
+ proposals := k.GetRoleProposals(ctx)
+ for _, proposal := range proposals {
+ votes := k.GetProposalVotes(ctx, proposal.Id)
+
+ var voteYes uint64 = 0
+ for _, vote := range votes {
+ if vote.Option == types.OptionYes {
+ voteYes++
+ }
+ }
+
+ if types.CheckTrustLevelThreshold(k.GetRoleMetadata(ctx).Guardian, voteYes, guardianTrustLevel) || proposal.Proposer == k.GetAuthority() {
+ if err := k.updateRole(ctx, proposal.Role, sdk.MustAccAddressFromBech32(proposal.Target)); err != nil {
+ panic(err)
+ }
+
+ k.deleteRoleProposal(ctx, proposal.Id)
+ }
+ }
+}
+
+// RegisterInvariants registers the fbridge module invariants
+func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper) {
+ ir.RegisterRoute(types.ModuleName, "guardian-invariant", GuardianInvariant(k))
+}
+
+func GuardianInvariant(k Keeper) sdk.Invariant {
+ return func(ctx sdk.Context) (string, bool) {
+ numGuardian := 0
+ for _, p := range k.GetRolePairs(ctx) {
+ if p.Role == types.RoleGuardian {
+ numGuardian++
+ }
+ }
+
+ numBridgeSw := len(k.GetBridgeSwitches(ctx))
+ broken := numGuardian != numBridgeSw
+ return sdk.FormatInvariant(
+ types.ModuleName, "guardian-invariant",
+ fmt.Sprintf("number of guardians(%d) != number of bridge switches(%d)", numGuardian, numBridgeSw),
+ ), broken
+ }
+}
diff --git a/x/fbridge/keeper/auth.go b/x/fbridge/keeper/auth.go
new file mode 100644
index 0000000000..86070efe83
--- /dev/null
+++ b/x/fbridge/keeper/auth.go
@@ -0,0 +1,331 @@
+package keeper
+
+import (
+ "encoding/binary"
+ "fmt"
+ "time"
+
+ sdk "github.com/Finschia/finschia-sdk/types"
+ sdkerrors "github.com/Finschia/finschia-sdk/types/errors"
+ "github.com/Finschia/finschia-sdk/x/fbridge/types"
+)
+
+func (k Keeper) RegisterRoleProposal(ctx sdk.Context, proposer, target sdk.AccAddress, role types.Role) (types.RoleProposal, error) {
+ if k.GetRoleMetadata(ctx).Guardian > 0 {
+ if k.GetRole(ctx, proposer) != types.RoleGuardian {
+ return types.RoleProposal{}, sdkerrors.ErrUnauthorized.Wrapf("only guardian can execute this action")
+ }
+ } else {
+ if proposer.String() != k.authority {
+ return types.RoleProposal{}, sdkerrors.ErrUnauthorized.Wrapf("only %s can execute this action", k.authority)
+ }
+ }
+
+ if k.GetRole(ctx, target) == role {
+ return types.RoleProposal{}, sdkerrors.ErrUnauthorized.Wrap("target already has same role")
+ }
+
+ proposalID := k.GetNextProposalID(ctx)
+ proposal := types.RoleProposal{
+ Id: proposalID,
+ Proposer: proposer.String(),
+ Target: target.String(),
+ Role: role,
+ ExpiredAt: ctx.BlockTime().Add(time.Duration(k.GetParams(ctx).ProposalPeriod)).UTC(),
+ }
+
+ k.setRoleProposal(ctx, proposal)
+ k.setNextProposalID(ctx, proposalID+1)
+
+ return proposal, nil
+}
+
+func (k Keeper) addVote(ctx sdk.Context, proposalID uint64, voter sdk.AccAddress, option types.VoteOption) error {
+ if k.GetRole(ctx, voter) != types.RoleGuardian {
+ return sdkerrors.ErrUnauthorized.Wrap("only guardian can execute this action")
+ }
+
+ _, found := k.GetRoleProposal(ctx, proposalID)
+ if !found {
+ return types.ErrUnknownProposal.Wrapf("#%d not found", proposalID)
+ }
+
+ if err := types.IsValidVoteOption(option); err != nil {
+ return sdkerrors.ErrInvalidRequest.Wrap(err.Error())
+ }
+
+ k.setVote(ctx, proposalID, voter, option)
+
+ return nil
+}
+
+func (k Keeper) updateRole(ctx sdk.Context, role types.Role, addr sdk.AccAddress) error {
+ previousRole := k.GetRole(ctx, addr)
+ if previousRole == role {
+ return sdkerrors.ErrInvalidRequest.Wrap("target already has same role")
+ }
+
+ roleMeta := k.GetRoleMetadata(ctx)
+ nInactive := k.GetBridgeInactiveCounter(ctx)
+
+ switch previousRole {
+ case types.RoleGuardian:
+ roleMeta.Guardian--
+
+ bs, err := k.GetBridgeSwitch(ctx, addr)
+ if err != nil {
+ return err
+ }
+
+ if bs.Status == types.StatusInactive {
+ nInactive--
+ }
+
+ k.deleteBridgeSwitch(ctx, addr)
+
+ case types.RoleOperator:
+ roleMeta.Operator--
+ case types.RoleJudge:
+ roleMeta.Judge--
+ }
+
+ if role == types.RoleEmpty {
+ k.deleteRole(ctx, addr)
+ return nil
+ } else {
+ if err := k.setRole(ctx, role, addr); err != nil {
+ return err
+ }
+ }
+
+ switch role {
+ case types.RoleGuardian:
+ roleMeta.Guardian++
+ if err := k.setBridgeSwitch(ctx, addr, types.StatusActive); err != nil {
+ panic(err)
+ }
+ case types.RoleOperator:
+ roleMeta.Operator++
+ case types.RoleJudge:
+ roleMeta.Judge++
+ }
+
+ k.setRoleMetadata(ctx, roleMeta)
+ k.setBridgeInactiveCounter(ctx, nInactive)
+
+ return nil
+}
+
+func (k Keeper) updateBridgeSwitch(ctx sdk.Context, guardian sdk.AccAddress, status types.BridgeStatus) error {
+ if sw, err := k.GetBridgeSwitch(ctx, guardian); err == nil && sw.Status == status {
+ return sdkerrors.ErrInvalidRequest.Wrapf("%s already set %s", guardian, status)
+ } else if err != nil {
+ return err
+ }
+
+ nInactive := k.GetBridgeInactiveCounter(ctx)
+ switch status {
+ case types.StatusActive:
+ nInactive--
+ case types.StatusInactive:
+ nInactive++
+ default:
+ return sdkerrors.ErrInvalidRequest.Wrapf("unknown bridge status: %d", status)
+ }
+ k.setBridgeInactiveCounter(ctx, nInactive)
+
+ if err := k.setBridgeSwitch(ctx, guardian, status); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (k Keeper) setNextProposalID(ctx sdk.Context, seq uint64) {
+ store := ctx.KVStore(k.storeKey)
+ bz := make([]byte, 8)
+ binary.BigEndian.PutUint64(bz, seq)
+ store.Set(types.KeyNextProposalID, bz)
+}
+
+func (k Keeper) GetNextProposalID(ctx sdk.Context) uint64 {
+ store := ctx.KVStore(k.storeKey)
+ bz := store.Get(types.KeyNextProposalID)
+ if bz == nil {
+ panic("next role proposal ID must be set at genesis")
+ }
+
+ return binary.BigEndian.Uint64(bz)
+}
+
+func (k Keeper) setRoleProposal(ctx sdk.Context, proposal types.RoleProposal) {
+ store := ctx.KVStore(k.storeKey)
+ bz := k.cdc.MustMarshal(&proposal)
+ store.Set(types.ProposalKey(proposal.Id), bz)
+}
+
+func (k Keeper) GetRoleProposal(ctx sdk.Context, id uint64) (proposal types.RoleProposal, found bool) {
+ store := ctx.KVStore(k.storeKey)
+ bz := store.Get(types.ProposalKey(id))
+ if bz == nil {
+ return proposal, false
+ }
+
+ k.cdc.MustUnmarshal(bz, &proposal)
+ return proposal, true
+}
+
+func (k Keeper) deleteRoleProposal(ctx sdk.Context, id uint64) {
+ store := ctx.KVStore(k.storeKey)
+ if _, found := k.GetRoleProposal(ctx, id); !found {
+ panic(fmt.Sprintf("role proposal #%d not found", id))
+ }
+ store.Delete(types.ProposalKey(id))
+}
+
+// IterateProposals iterates over the all the role proposals and performs a callback function
+func (k Keeper) IterateProposals(ctx sdk.Context, cb func(proposal types.RoleProposal) (stop bool)) {
+ store := ctx.KVStore(k.storeKey)
+
+ iterator := sdk.KVStorePrefixIterator(store, types.KeyProposalPrefix)
+ defer iterator.Close()
+
+ for ; iterator.Valid(); iterator.Next() {
+ var proposal types.RoleProposal
+ k.cdc.MustUnmarshal(iterator.Value(), &proposal)
+ if cb(proposal) {
+ break
+ }
+ }
+}
+
+// GetRoleProposals returns all the role proposals from store
+func (k Keeper) GetRoleProposals(ctx sdk.Context) (proposals []types.RoleProposal) {
+ k.IterateProposals(ctx, func(proposal types.RoleProposal) bool {
+ proposals = append(proposals, proposal)
+ return false
+ })
+ return
+}
+
+func (k Keeper) setVote(ctx sdk.Context, proposalID uint64, voter sdk.AccAddress, option types.VoteOption) {
+ store := ctx.KVStore(k.storeKey)
+ bz := make([]byte, 4)
+ binary.BigEndian.PutUint32(bz, uint32(option))
+ store.Set(types.VoterVoteKey(proposalID, voter), bz)
+}
+
+func (k Keeper) GetVote(ctx sdk.Context, proposalID uint64, voter sdk.AccAddress) (types.VoteOption, error) {
+ store := ctx.KVStore(k.storeKey)
+ bz := store.Get(types.VoterVoteKey(proposalID, voter))
+ if bz == nil {
+ return types.OptionEmpty, types.ErrUnknownVote
+ }
+
+ return types.VoteOption(binary.BigEndian.Uint32(bz)), nil
+}
+
+func (k Keeper) GetProposalVotes(ctx sdk.Context, proposalID uint64) []types.Vote {
+ store := ctx.KVStore(k.storeKey)
+
+ votes := make([]types.Vote, 0)
+ iterator := sdk.KVStorePrefixIterator(store, types.VotesKey(proposalID))
+ defer iterator.Close()
+ for ; iterator.Valid(); iterator.Next() {
+ _, voter := types.SplitVoterVoteKey(iterator.Key())
+ v := types.Vote{
+ ProposalId: proposalID,
+ Voter: voter.String(),
+ Option: types.VoteOption(binary.BigEndian.Uint32(iterator.Value())),
+ }
+ votes = append(votes, v)
+ }
+
+ return votes
+}
+
+func (k Keeper) setRole(ctx sdk.Context, role types.Role, addr sdk.AccAddress) error {
+ if err := types.IsValidRole(role); err != nil {
+ return sdkerrors.ErrInvalidRequest.Wrap(err.Error())
+ }
+
+ store := ctx.KVStore(k.storeKey)
+ bz := make([]byte, 4)
+ binary.BigEndian.PutUint32(bz, uint32(role))
+ store.Set(types.RoleKey(addr), bz)
+
+ return nil
+}
+
+func (k Keeper) GetRole(ctx sdk.Context, addr sdk.AccAddress) types.Role {
+ store := ctx.KVStore(k.storeKey)
+ bz := store.Get(types.RoleKey(addr))
+ if bz == nil {
+ return types.RoleEmpty
+ }
+
+ return types.Role(binary.BigEndian.Uint32(bz))
+}
+
+func (k Keeper) GetRolePairs(ctx sdk.Context) []types.RolePair {
+ store := ctx.KVStore(k.storeKey)
+ pairs := make([]types.RolePair, 0)
+ iterator := sdk.KVStorePrefixIterator(store, types.KeyRolePrefix)
+ defer iterator.Close()
+ for ; iterator.Valid(); iterator.Next() {
+ assignee := types.SplitRoleKey(iterator.Key())
+ pairs = append(pairs, types.RolePair{Address: assignee.String(), Role: types.Role(binary.BigEndian.Uint32(iterator.Value()))})
+ }
+
+ return pairs
+}
+
+func (k Keeper) deleteRole(ctx sdk.Context, addr sdk.AccAddress) {
+ store := ctx.KVStore(k.storeKey)
+ store.Delete(types.RoleKey(addr))
+}
+
+func (k Keeper) setBridgeSwitch(ctx sdk.Context, guardian sdk.AccAddress, status types.BridgeStatus) error {
+ if err := types.IsValidBridgeStatus(status); err != nil {
+ return sdkerrors.ErrInvalidRequest.Wrap(err.Error())
+ }
+
+ store := ctx.KVStore(k.storeKey)
+ bz := make([]byte, 4)
+ binary.BigEndian.PutUint32(bz, uint32(status))
+ store.Set(types.BridgeSwitchKey(guardian), bz)
+ return nil
+}
+
+func (k Keeper) deleteBridgeSwitch(ctx sdk.Context, guardian sdk.AccAddress) {
+ store := ctx.KVStore(k.storeKey)
+ store.Delete(types.BridgeSwitchKey(guardian))
+}
+
+func (k Keeper) GetBridgeSwitch(ctx sdk.Context, guardian sdk.AccAddress) (types.BridgeSwitch, error) {
+ if k.GetRole(ctx, guardian) != types.RoleGuardian {
+ return types.BridgeSwitch{}, sdkerrors.ErrUnauthorized.Wrap("only guardian has bridge switch")
+ }
+
+ store := ctx.KVStore(k.storeKey)
+ bz := store.Get(types.BridgeSwitchKey(guardian))
+ if bz == nil {
+ panic("bridge switch must be set at genesis")
+ }
+
+ return types.BridgeSwitch{Guardian: guardian.String(), Status: types.BridgeStatus(binary.BigEndian.Uint32(bz))}, nil
+}
+
+func (k Keeper) GetBridgeSwitches(ctx sdk.Context) []types.BridgeSwitch {
+ store := ctx.KVStore(k.storeKey)
+
+ bws := make([]types.BridgeSwitch, 0)
+ iterator := sdk.KVStorePrefixIterator(store, types.KeyBridgeSwitchPrefix)
+ defer iterator.Close()
+ for ; iterator.Valid(); iterator.Next() {
+ addr := types.SplitBridgeSwitchKey(iterator.Key())
+ bws = append(bws, types.BridgeSwitch{Guardian: addr.String(), Status: types.BridgeStatus(binary.BigEndian.Uint32(iterator.Value()))})
+ }
+
+ return bws
+}
diff --git a/x/fbridge/keeper/auth_test.go b/x/fbridge/keeper/auth_test.go
new file mode 100644
index 0000000000..fb773014e3
--- /dev/null
+++ b/x/fbridge/keeper/auth_test.go
@@ -0,0 +1,89 @@
+package keeper
+
+import (
+ "testing"
+
+ "github.com/stretchr/testify/require"
+
+ "github.com/Finschia/finschia-sdk/x/fbridge/testutil"
+ "github.com/Finschia/finschia-sdk/x/fbridge/types"
+)
+
+func TestAssignRole(t *testing.T) {
+ key, memKey, ctx, encCfg, authKeeper, bankKeeper, addrs := testutil.PrepareFbridgeTest(t, 3)
+ auth := types.DefaultAuthority()
+ k := NewKeeper(encCfg.Codec, key, memKey, authKeeper, bankKeeper, "stake", auth.String())
+ err := k.InitGenesis(ctx, types.DefaultGenesisState())
+ require.NoError(t, err)
+
+ // 1. Bridge authority assigns an address to a guardian role
+ p, err := k.RegisterRoleProposal(ctx, addrs[0], addrs[1], types.RoleGuardian)
+ require.Error(t, err, "role proposal must not be passed without authority")
+ require.Equal(t, types.RoleProposal{}, p)
+ p, err = k.RegisterRoleProposal(ctx, auth, addrs[0], types.RoleGuardian)
+ require.NoError(t, err)
+ require.EqualValues(t, 1, p.Id)
+ err = k.updateRole(ctx, types.RoleGuardian, addrs[0])
+ require.NoError(t, err)
+ require.Equal(t, types.RoleGuardian, k.GetRole(ctx, addrs[0]))
+ require.Equal(t, types.RoleMetadata{Guardian: 1, Operator: 0, Judge: 0}, k.GetRoleMetadata(ctx))
+
+ // 2. Guardian assigns an address to a guardian role
+ _, err = k.RegisterRoleProposal(ctx, auth, addrs[1], types.RoleGuardian)
+ require.Error(t, err, "role proposal must be passed with guardian role after guardian group is formed")
+ p, err = k.RegisterRoleProposal(ctx, addrs[0], addrs[1], types.RoleGuardian)
+ require.NoError(t, err, "role proposal must be passed with guardian role")
+ require.EqualValues(t, 2, p.Id)
+ err = k.addVote(ctx, p.Id, addrs[0], types.OptionYes)
+ require.NoError(t, err)
+ opt, err := k.GetVote(ctx, p.Id, addrs[0])
+ require.NoError(t, err)
+ require.Equal(t, types.OptionYes, opt)
+ err = k.updateRole(ctx, types.RoleGuardian, addrs[1])
+ require.NoError(t, err)
+ require.Equal(t, types.RoleMetadata{Guardian: 2, Operator: 0, Judge: 0}, k.GetRoleMetadata(ctx))
+ sws := k.GetBridgeSwitches(ctx)
+ require.Len(t, sws, 2)
+ for _, sw := range sws {
+ require.Equal(t, types.StatusActive, sw.Status)
+ }
+
+ // 3. Guardian assigns an address to an operator role
+ err = k.updateRole(ctx, types.RoleOperator, addrs[1])
+ require.NoError(t, err)
+ require.Equal(t, types.RoleMetadata{Guardian: 1, Operator: 1, Judge: 0}, k.GetRoleMetadata(ctx))
+
+ // 4. Guardian assigns an address to a same role
+ err = k.updateRole(ctx, types.RoleOperator, addrs[1])
+ require.Error(t, err, "role must not be updated to the same role")
+}
+
+func TestBridgeHaltAndResume(t *testing.T) {
+ key, memKey, ctx, encCfg, authKeeper, bankKeeper, addrs := testutil.PrepareFbridgeTest(t, 3)
+ auth := types.DefaultAuthority()
+ k := NewKeeper(encCfg.Codec, key, memKey, authKeeper, bankKeeper, "stake", auth.String())
+ err := k.InitGenesis(ctx, types.DefaultGenesisState())
+ require.NoError(t, err)
+ for _, addr := range addrs {
+ err = k.updateRole(ctx, types.RoleGuardian, addr)
+ require.NoError(t, err)
+ }
+
+ require.Equal(t, types.StatusActive, k.GetBridgeStatus(ctx), "bridge status must be active (3/3)")
+ require.Equal(t, types.BridgeStatusMetadata{Active: 3, Inactive: 0}, k.GetBridgeStatusMetadata(ctx))
+
+ err = k.updateBridgeSwitch(ctx, addrs[0], types.StatusInactive)
+ require.NoError(t, err)
+ require.Equal(t, types.StatusActive, k.GetBridgeStatus(ctx), "bridge status must be active (2/3)")
+ require.Equal(t, types.BridgeStatusMetadata{Active: 2, Inactive: 1}, k.GetBridgeStatusMetadata(ctx))
+
+ err = k.updateBridgeSwitch(ctx, addrs[1], types.StatusInactive)
+ require.NoError(t, err)
+ require.Equal(t, types.StatusInactive, k.GetBridgeStatus(ctx), "bridge status must be inactive (1/3)")
+ require.Equal(t, types.BridgeStatusMetadata{Active: 1, Inactive: 2}, k.GetBridgeStatusMetadata(ctx))
+
+ err = k.updateBridgeSwitch(ctx, addrs[0], types.StatusActive)
+ require.NoError(t, err)
+ require.Equal(t, types.StatusActive, k.GetBridgeStatus(ctx), "bridge status must be active (2/3)")
+ require.Equal(t, types.BridgeStatusMetadata{Active: 2, Inactive: 1}, k.GetBridgeStatusMetadata(ctx))
+}
diff --git a/x/fbridge/keeper/genesis.go b/x/fbridge/keeper/genesis.go
index 9312e18a97..486f35ea68 100644
--- a/x/fbridge/keeper/genesis.go
+++ b/x/fbridge/keeper/genesis.go
@@ -8,20 +8,53 @@ import (
)
func (k Keeper) InitGenesis(ctx sdk.Context, gs *types.GenesisState) error {
+ k.SetParams(ctx, gs.Params)
k.setNextSequence(ctx, gs.SendingState.NextSeq)
for _, info := range gs.SendingState.SeqToBlocknum {
k.setSeqToBlocknum(ctx, info.Seq, info.Blocknum)
}
+ for _, pair := range gs.Roles {
+ if err := k.setRole(ctx, pair.Role, sdk.MustAccAddressFromBech32(pair.Address)); err != nil {
+ panic(err)
+ }
+ }
+
+ for _, sw := range gs.BridgeSwitches {
+ if err := k.setBridgeSwitch(ctx, sdk.MustAccAddressFromBech32(sw.Guardian), sw.Status); err != nil {
+ panic(err)
+ }
+ }
+
+ k.setNextProposalID(ctx, gs.NextRoleProposalId)
+ for _, proposal := range gs.RoleProposals {
+ k.setRoleProposal(ctx, proposal)
+ }
+
+ for _, vote := range gs.Votes {
+ k.setVote(ctx, vote.ProposalId, sdk.MustAccAddressFromBech32(vote.Voter), vote.Option)
+ }
+
+ // TODO: we initialize the appropriate genesis parameters whenever the feature is added
+
+ k.InitMemStore(ctx)
+
return nil
}
func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState {
return &types.GenesisState{
+ Params: k.GetParams(ctx),
SendingState: types.SendingState{
NextSeq: k.GetNextSequence(ctx),
SeqToBlocknum: k.getAllSeqToBlocknums(ctx),
},
+ ReceivingState: types.ReceivingState{},
+ NextRoleProposalId: k.GetNextProposalID(ctx),
+ RoleProposals: k.GetRoleProposals(ctx),
+ Votes: k.GetAllVotes(ctx),
+ Roles: k.GetRolePairs(ctx),
+ BridgeSwitches: k.GetBridgeSwitches(ctx),
}
}
@@ -40,3 +73,28 @@ func (k Keeper) getAllSeqToBlocknums(ctx sdk.Context) []types.BlockSeqInfo {
return infos
}
+
+// IterateVotes iterates over the all the votes for role proposals and performs a callback function
+func (k Keeper) IterateVotes(ctx sdk.Context, cb func(proposal types.Vote) (stop bool)) {
+ store := ctx.KVStore(k.storeKey)
+
+ iterator := sdk.KVStorePrefixIterator(store, types.KeyProposalVotePrefix)
+ defer iterator.Close()
+ for ; iterator.Valid(); iterator.Next() {
+ id, voter := types.SplitVoterVoteKey(iterator.Key())
+ opt := types.VoteOption(binary.BigEndian.Uint32(iterator.Value()))
+ v := types.Vote{ProposalId: id, Voter: voter.String(), Option: opt}
+ if cb(v) {
+ break
+ }
+ }
+}
+
+// GetAllVotes returns all the votes from the store
+func (k Keeper) GetAllVotes(ctx sdk.Context) (votes []types.Vote) {
+ k.IterateVotes(ctx, func(vote types.Vote) bool {
+ votes = append(votes, vote)
+ return false
+ })
+ return
+}
diff --git a/x/fbridge/keeper/grpc_query.go b/x/fbridge/keeper/grpc_query.go
index e2460064c2..7c7046a535 100644
--- a/x/fbridge/keeper/grpc_query.go
+++ b/x/fbridge/keeper/grpc_query.go
@@ -7,14 +7,24 @@ import (
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
+ "github.com/Finschia/finschia-sdk/store/prefix"
sdk "github.com/Finschia/finschia-sdk/types"
+ sdkerrors "github.com/Finschia/finschia-sdk/types/errors"
+ "github.com/Finschia/finschia-sdk/types/query"
"github.com/Finschia/finschia-sdk/x/fbridge/types"
)
var _ types.QueryServer = Keeper{}
-func (k Keeper) Params(ctx context.Context, request *types.QueryParamsRequest) (*types.QueryParamsResponse, error) {
- panic("implement me")
+func (k Keeper) Params(goCtx context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) {
+ if req == nil {
+ return nil, status.Error(codes.InvalidArgument, "empty request")
+ }
+
+ ctx := sdk.UnwrapSDKContext(goCtx)
+ params := k.GetParams(ctx)
+
+ return &types.QueryParamsResponse{Params: params}, nil
}
func (k Keeper) NextSeqSend(goCtx context.Context, req *types.QueryNextSeqSendRequest) (*types.QueryNextSeqSendResponse, error) {
@@ -53,45 +63,136 @@ func (k Keeper) SeqToBlocknums(goCtx context.Context, req *types.QuerySeqToBlock
}
func (k Keeper) GreatestSeqByOperator(ctx context.Context, request *types.QueryGreatestSeqByOperatorRequest) (*types.QueryGreatestSeqByOperatorResponse, error) {
- panic("implement me")
+ panic(sdkerrors.ErrNotSupported)
}
func (k Keeper) GreatestConsecutiveConfirmedSeq(ctx context.Context, request *types.QueryGreatestConsecutiveConfirmedSeqRequest) (*types.QueryGreatestConsecutiveConfirmedSeqResponse, error) {
- panic("implement me")
+ panic(sdkerrors.ErrNotSupported)
}
func (k Keeper) SubmittedProvision(ctx context.Context, request *types.QuerySubmittedProvisionRequest) (*types.QuerySubmittedProvisionResponse, error) {
- panic("implement me")
+ panic(sdkerrors.ErrNotSupported)
}
func (k Keeper) ConfirmedProvision(ctx context.Context, request *types.QueryConfirmedProvisionRequest) (*types.QueryConfirmedProvisionResponse, error) {
- panic("implement me")
+ panic(sdkerrors.ErrNotSupported)
}
func (k Keeper) NeededSubmissionSeqs(ctx context.Context, request *types.QueryNeededSubmissionSeqsRequest) (*types.QueryNeededSubmissionSeqsResponse, error) {
- panic("implement me")
+ panic(sdkerrors.ErrNotSupported)
}
func (k Keeper) Commitments(ctx context.Context, request *types.QueryCommitmentsRequest) (*types.QueryCommitmentsResponse, error) {
- panic("implement me")
+ panic(sdkerrors.ErrNotSupported)
+}
+
+func (k Keeper) Members(goCtx context.Context, req *types.QueryMembersRequest) (*types.QueryMembersResponse, error) {
+ if req == nil {
+ return nil, status.Error(codes.InvalidArgument, "empty request")
+ }
+
+ ctx := sdk.UnwrapSDKContext(goCtx)
+ roles := k.GetRolePairs(ctx)
+ members := make([]string, 0)
+
+ if req.Role == "" {
+ for _, pair := range roles {
+ members = append(members, pair.Address)
+ }
+ } else {
+ role, found := types.QueryParamToRole[req.Role]
+ if !found {
+ return nil, status.Error(codes.InvalidArgument, "invalid role")
+ }
+
+ for _, pair := range roles {
+ if pair.Role == role {
+ members = append(members, pair.Address)
+ }
+ }
+ }
+
+ return &types.QueryMembersResponse{Members: members}, nil
}
-func (k Keeper) Guardians(ctx context.Context, request *types.QueryGuardiansRequest) (*types.QueryGuardiansResponse, error) {
- panic("implement me")
+func (k Keeper) Member(goCtx context.Context, req *types.QueryMemberRequest) (*types.QueryMemberResponse, error) {
+ if req == nil {
+ return nil, status.Error(codes.InvalidArgument, "empty request")
+ }
+
+ ctx := sdk.UnwrapSDKContext(goCtx)
+ r := k.GetRole(ctx, sdk.MustAccAddressFromBech32(req.Address))
+ if r == types.RoleEmpty {
+ return nil, status.Error(codes.NotFound, "role not found")
+ }
+
+ return &types.QueryMemberResponse{Role: types.Role_name[int32(r)]}, nil
+}
+
+func (k Keeper) Proposals(goCtx context.Context, req *types.QueryProposalsRequest) (*types.QueryProposalsResponse, error) {
+ if req == nil {
+ return nil, status.Error(codes.InvalidArgument, "empty request")
+ }
+
+ ctx := sdk.UnwrapSDKContext(goCtx)
+ store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyProposalPrefix)
+ proposals := make([]types.RoleProposal, 0)
+ pageRes, err := query.Paginate(store, req.Pagination, func(_, value []byte) error {
+ var proposal types.RoleProposal
+ k.cdc.MustUnmarshal(value, &proposal)
+ proposals = append(proposals, proposal)
+ return nil
+ })
+ if err != nil {
+ return nil, status.Error(codes.Internal, err.Error())
+ }
+
+ return &types.QueryProposalsResponse{Proposals: proposals, Pagination: pageRes}, nil
}
-func (k Keeper) Operators(ctx context.Context, request *types.QueryOperatorsRequest) (*types.QueryOperatorsResponse, error) {
- panic("implement me")
+func (k Keeper) Proposal(goCtx context.Context, req *types.QueryProposalRequest) (*types.QueryProposalResponse, error) {
+ if req == nil {
+ return nil, status.Error(codes.InvalidArgument, "empty request")
+ }
+
+ ctx := sdk.UnwrapSDKContext(goCtx)
+ proposal, found := k.GetRoleProposal(ctx, req.ProposalId)
+ if !found {
+ return nil, status.Error(codes.NotFound, fmt.Sprintf("role proposal %d", req.ProposalId))
+ }
+
+ return &types.QueryProposalResponse{Proposal: proposal}, nil
}
-func (k Keeper) Judges(ctx context.Context, request *types.QueryJudgesRequest) (*types.QueryJudgesResponse, error) {
- panic("implement me")
+func (k Keeper) Votes(goCtx context.Context, req *types.QueryVotesRequest) (*types.QueryVotesResponse, error) {
+ if req == nil {
+ return nil, status.Error(codes.InvalidArgument, "empty request")
+ }
+
+ ctx := sdk.UnwrapSDKContext(goCtx)
+ votes := k.GetProposalVotes(ctx, req.ProposalId)
+ return &types.QueryVotesResponse{Votes: votes}, nil
}
-func (k Keeper) Proposals(ctx context.Context, request *types.QueryProposalsRequest) (*types.QueryProposalsResponse, error) {
- panic("implement me")
+func (k Keeper) Vote(goCtx context.Context, req *types.QueryVoteRequest) (*types.QueryVoteResponse, error) {
+ if req == nil {
+ return nil, status.Error(codes.InvalidArgument, "empty request")
+ }
+
+ ctx := sdk.UnwrapSDKContext(goCtx)
+ opt, err := k.GetVote(ctx, req.ProposalId, sdk.MustAccAddressFromBech32(req.Voter))
+ if err != nil {
+ return nil, status.Error(codes.NotFound, err.Error())
+ }
+
+ return &types.QueryVoteResponse{Vote: types.Vote{ProposalId: req.ProposalId, Voter: req.Voter, Option: opt}}, nil
}
-func (k Keeper) Proposal(ctx context.Context, request *types.QueryProposalRequest) (*types.QueryProposalResponse, error) {
- panic("implement me")
+func (k Keeper) BridgeStatus(goCtx context.Context, req *types.QueryBridgeStatusRequest) (*types.QueryBridgeStatusResponse, error) {
+ if req == nil {
+ return nil, status.Error(codes.InvalidArgument, "empty request")
+ }
+
+ ctx := sdk.UnwrapSDKContext(goCtx)
+ return &types.QueryBridgeStatusResponse{Status: k.GetBridgeStatus(ctx), Metadata: k.GetBridgeStatusMetadata(ctx)}, nil
}
diff --git a/x/fbridge/keeper/keeper.go b/x/fbridge/keeper/keeper.go
index 6059da88bc..18cc8e0ef9 100644
--- a/x/fbridge/keeper/keeper.go
+++ b/x/fbridge/keeper/keeper.go
@@ -1,7 +1,9 @@
package keeper
import (
+ "encoding/binary"
"errors"
+ "fmt"
"github.com/tendermint/tendermint/libs/log"
@@ -12,6 +14,7 @@ import (
type Keeper struct {
storeKey sdk.StoreKey
+ memKey sdk.StoreKey
cdc codec.BinaryCodec
authKeeper types.AccountKeeper
bankKeeper types.BankKeeper
@@ -19,30 +22,31 @@ type Keeper struct {
// the target denom for the bridge
targetDenom string
- // the authority address that can execute privileged operations only if the guardian group is not set
- // - UpdateParams
- // - SuggestRole
+ // authority can give a role to a specific address like guardian
authority string
}
func NewKeeper(
cdc codec.BinaryCodec,
- key sdk.StoreKey,
+ key, memKey sdk.StoreKey,
authKeeper types.AccountKeeper,
bankKeeper types.BankKeeper,
- targetDenom string,
- authority string,
+ targetDenom, authority string,
) Keeper {
if addr := authKeeper.GetModuleAddress(types.ModuleName); addr == nil {
panic(errors.New("fbridge module account has not been set"))
}
- if authority != types.DefaultAuthority().String() {
- panic(errors.New("authority must be gov module"))
+ for _, addr := range types.AuthorityCandiates() {
+ if authority == addr.String() {
+ break
+ }
+ panic("x/bridge authority must be the gov or foundation module account")
}
return Keeper{
storeKey: key,
+ memKey: memKey,
cdc: cdc,
authKeeper: authKeeper,
bankKeeper: bankKeeper,
@@ -55,6 +59,108 @@ func (k Keeper) Logger(ctx sdk.Context) log.Logger {
return ctx.Logger().With("module", "x/"+types.ModuleName)
}
+func (k Keeper) InitMemStore(ctx sdk.Context) {
+ memStore := ctx.KVStore(k.memKey)
+ memStoreType := memStore.GetStoreType()
+ if memStoreType != sdk.StoreTypeMemory {
+ panic(fmt.Sprintf("invalid memory store type; got %s, expected: %s", memStoreType, sdk.StoreTypeMemory))
+ }
+
+ // create context with no block gas meter to ensure we do not consume gas during local initialization logic.
+ noGasCtx := ctx.WithBlockGasMeter(sdk.NewInfiniteGasMeter())
+
+ roleMetadata := types.RoleMetadata{}
+ if !k.IsInitialized(noGasCtx) {
+ for _, pair := range k.GetRolePairs(noGasCtx) {
+ switch pair.Role {
+ case types.RoleGuardian:
+ roleMetadata.Guardian++
+ case types.RoleOperator:
+ roleMetadata.Operator++
+ case types.RoleJudge:
+ roleMetadata.Judge++
+ }
+ }
+ k.setRoleMetadata(noGasCtx, roleMetadata)
+
+ nInactive := uint64(0)
+ for _, bs := range k.GetBridgeSwitches(ctx) {
+ if bs.Status == types.StatusInactive {
+ nInactive++
+ }
+ }
+ k.setBridgeInactiveCounter(noGasCtx, nInactive)
+
+ memStore := noGasCtx.KVStore(k.memKey)
+ memStore.Set(types.KeyMemInitialized, []byte{1})
+ }
+}
+
+// IsInitialized returns true if the keeper is properly initialized, and false otherwise.
+func (k Keeper) IsInitialized(ctx sdk.Context) bool {
+ memStore := ctx.KVStore(k.memKey)
+ return memStore.Get(types.KeyMemInitialized) != nil
+}
+
func (k Keeper) GetAuthority() string {
return k.authority
}
+
+func (k Keeper) IsBridgeHalted(ctx sdk.Context) bool {
+ return k.GetBridgeStatus(ctx) == types.StatusInactive
+}
+
+func (k Keeper) setRoleMetadata(ctx sdk.Context, data types.RoleMetadata) {
+ memStore := ctx.KVStore(k.memKey)
+ bz := k.cdc.MustMarshal(&data)
+ memStore.Set(types.KeyMemRoleMetadata, bz)
+}
+
+func (k Keeper) GetRoleMetadata(ctx sdk.Context) types.RoleMetadata {
+ memStore := ctx.KVStore(k.memKey)
+ data := types.RoleMetadata{}
+ bz := memStore.Get(types.KeyMemRoleMetadata)
+ if bz == nil {
+ return types.RoleMetadata{}
+ }
+ k.cdc.MustUnmarshal(bz, &data)
+ return data
+}
+
+func (k Keeper) GetBridgeStatus(ctx sdk.Context) types.BridgeStatus {
+ roleMeta := k.GetRoleMetadata(ctx)
+ if roleMeta.Guardian != 0 {
+ bsMeta := k.GetBridgeStatusMetadata(ctx)
+ if types.CheckTrustLevelThreshold(roleMeta.Guardian, bsMeta.Inactive, k.GetParams(ctx).GuardianTrustLevel) {
+ return types.StatusInactive
+ }
+
+ return types.StatusActive
+ }
+
+ return types.StatusInactive
+}
+
+func (k Keeper) setBridgeInactiveCounter(ctx sdk.Context, nInactive uint64) {
+ memStore := ctx.KVStore(k.memKey)
+ bz := make([]byte, 8)
+ binary.BigEndian.PutUint64(bz, nInactive)
+ memStore.Set(types.KeyMemBridgeInactiveCounter, bz)
+}
+
+func (k Keeper) GetBridgeInactiveCounter(ctx sdk.Context) uint64 {
+ memStore := ctx.KVStore(k.memKey)
+ bz := memStore.Get(types.KeyMemBridgeInactiveCounter)
+ if bz == nil {
+ panic("bridge inactive counter must be set at initialization")
+ }
+
+ return binary.BigEndian.Uint64(bz)
+}
+
+func (k Keeper) GetBridgeStatusMetadata(ctx sdk.Context) types.BridgeStatusMetadata {
+ bsMeta := types.BridgeStatusMetadata{}
+ bsMeta.Inactive = k.GetBridgeInactiveCounter(ctx)
+ bsMeta.Active = k.GetRoleMetadata(ctx).Guardian - bsMeta.Inactive
+ return bsMeta
+}
diff --git a/x/fbridge/keeper/msg_server.go b/x/fbridge/keeper/msg_server.go
index 491f57c632..5f6775f4bc 100644
--- a/x/fbridge/keeper/msg_server.go
+++ b/x/fbridge/keeper/msg_server.go
@@ -21,6 +21,10 @@ func NewMsgServer(k Keeper) types.MsgServer {
func (m msgServer) Transfer(goCtx context.Context, msg *types.MsgTransfer) (*types.MsgTransferResponse, error) {
ctx := sdk.UnwrapSDKContext(goCtx)
+ if m.IsBridgeHalted(ctx) {
+ return nil, types.ErrInactiveBridge
+ }
+
from, err := sdk.AccAddressFromBech32(msg.Sender)
if err != nil {
return nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid sender address (%s)", err)
@@ -48,41 +52,94 @@ func (m msgServer) Transfer(goCtx context.Context, msg *types.MsgTransfer) (*typ
}
func (m msgServer) Provision(ctx context.Context, msg *types.MsgProvision) (*types.MsgProvisionResponse, error) {
- panic("implement me")
+ panic(sdkerrors.ErrNotSupported)
}
func (m msgServer) HoldTransfer(ctx context.Context, msg *types.MsgHoldTransfer) (*types.MsgHoldTransferResponse, error) {
- panic("implement me")
+ panic(sdkerrors.ErrNotSupported)
}
func (m msgServer) ReleaseTransfer(ctx context.Context, msg *types.MsgReleaseTransfer) (*types.MsgReleaseTransferResponse, error) {
- panic("implement me")
+ panic(sdkerrors.ErrNotSupported)
}
func (m msgServer) RemoveProvision(ctx context.Context, msg *types.MsgRemoveProvision) (*types.MsgRemoveProvisionResponse, error) {
- panic("implement me")
+ panic(sdkerrors.ErrNotSupported)
}
func (m msgServer) ClaimBatch(ctx context.Context, msg *types.MsgClaimBatch) (*types.MsgClaimBatchResponse, error) {
- panic("implement me")
+ panic(sdkerrors.ErrNotSupported)
}
func (m msgServer) Claim(ctx context.Context, msg *types.MsgClaim) (*types.MsgClaimResponse, error) {
- panic("implement me")
+ panic(sdkerrors.ErrNotSupported)
}
-func (m msgServer) SuggestRole(ctx context.Context, msg *types.MsgSuggestRole) (*types.MsgSuggestRoleResponse, error) {
- panic("implement me")
-}
+func (m msgServer) SuggestRole(goCtx context.Context, msg *types.MsgSuggestRole) (*types.MsgSuggestRoleResponse, error) {
+ ctx := sdk.UnwrapSDKContext(goCtx)
+
+ proposer, err := sdk.AccAddressFromBech32(msg.From)
+ if err != nil {
+ return nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid proposer address (%s)", err)
+ }
+
+ target, err := sdk.AccAddressFromBech32(msg.Target)
+ if err != nil {
+ return nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid target address (%s)", err)
+ }
+
+ if err := types.IsValidRole(msg.Role); err != nil {
+ return nil, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, err.Error())
+ }
+
+ proposal, err := m.RegisterRoleProposal(ctx, proposer, target, msg.Role)
+ if err != nil {
+ return nil, err
+ }
+
+ if err := ctx.EventManager().EmitTypedEvent(&types.EventSuggestRole{
+ Proposal: proposal,
+ }); err != nil {
+ panic(err)
+ }
-func (m msgServer) AddVoteForRole(ctx context.Context, msg *types.MsgAddVoteForRole) (*types.MsgAddVoteForRoleResponse, error) {
- panic("implement me")
+ return &types.MsgSuggestRoleResponse{}, nil
}
-func (m msgServer) Halt(ctx context.Context, msg *types.MsgHalt) (*types.MsgHaltResponse, error) {
- panic("implement me")
+func (m msgServer) AddVoteForRole(goCtx context.Context, msg *types.MsgAddVoteForRole) (*types.MsgAddVoteForRoleResponse, error) {
+ ctx := sdk.UnwrapSDKContext(goCtx)
+
+ voter, err := sdk.AccAddressFromBech32(msg.From)
+ if err != nil {
+ return nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid proposer address (%s)", err)
+ }
+
+ if err := m.addVote(ctx, msg.ProposalId, voter, msg.Option); err != nil {
+ return nil, err
+ }
+
+ if err := ctx.EventManager().EmitTypedEvent(&types.EventAddVoteForRole{
+ Voter: msg.From,
+ ProposalId: msg.ProposalId,
+ Option: msg.Option,
+ }); err != nil {
+ panic(err)
+ }
+
+ return &types.MsgAddVoteForRoleResponse{}, nil
}
-func (m msgServer) Resume(ctx context.Context, resume *types.MsgResume) (*types.MsgResumeResponse, error) {
- panic("implement me")
+func (m msgServer) SetBridgeStatus(goCtx context.Context, msg *types.MsgSetBridgeStatus) (*types.MsgSetBridgeStatusResponse, error) {
+ ctx := sdk.UnwrapSDKContext(goCtx)
+
+ addr, err := sdk.AccAddressFromBech32(msg.Guardian)
+ if err != nil {
+ return nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid guardian address (%s)", err)
+ }
+
+ if err := m.updateBridgeSwitch(ctx, addr, msg.Status); err != nil {
+ return nil, err
+ }
+
+ return &types.MsgSetBridgeStatusResponse{}, nil
}
diff --git a/x/fbridge/keeper/params.go b/x/fbridge/keeper/params.go
new file mode 100644
index 0000000000..dcbfc093d7
--- /dev/null
+++ b/x/fbridge/keeper/params.go
@@ -0,0 +1,24 @@
+package keeper
+
+import (
+ sdk "github.com/Finschia/finschia-sdk/types"
+ "github.com/Finschia/finschia-sdk/x/fbridge/types"
+)
+
+func (k Keeper) SetParams(ctx sdk.Context, params types.Params) {
+ store := ctx.KVStore(k.storeKey)
+ bz := k.cdc.MustMarshal(¶ms)
+ store.Set(types.KeyParams, bz)
+}
+
+func (k Keeper) GetParams(ctx sdk.Context) types.Params {
+ store := ctx.KVStore(k.storeKey)
+ bz := store.Get(types.KeyParams)
+ if bz == nil {
+ return types.DefaultParams()
+ }
+
+ var params types.Params
+ k.cdc.MustUnmarshal(bz, ¶ms)
+ return params
+}
diff --git a/x/fbridge/keeper/transfer_test.go b/x/fbridge/keeper/transfer_test.go
index ac0743ad98..4466e3d06c 100644
--- a/x/fbridge/keeper/transfer_test.go
+++ b/x/fbridge/keeper/transfer_test.go
@@ -7,26 +7,23 @@ import (
"github.com/stretchr/testify/require"
sdk "github.com/Finschia/finschia-sdk/types"
- authtypes "github.com/Finschia/finschia-sdk/x/auth/types"
"github.com/Finschia/finschia-sdk/x/fbridge/testutil"
"github.com/Finschia/finschia-sdk/x/fbridge/types"
)
func TestHandleBridgeTransfer(t *testing.T) {
- key, ctx, encCfg, authKeeper, bankKeeper := testutil.PrepareFbridgeTest(t)
+ key, memKey, ctx, encCfg, authKeeper, bankKeeper, _ := testutil.PrepareFbridgeTest(t, 0)
sender := sdk.AccAddress("test")
amt := sdk.NewInt(1000000)
denom := "stake"
token := sdk.Coins{sdk.Coin{Denom: denom, Amount: amt}}
- bridge := authtypes.NewEmptyModuleAccount("fbridge")
- authKeeper.EXPECT().GetModuleAddress(types.ModuleName).Return(bridge.GetAddress()).AnyTimes()
bankKeeper.EXPECT().IsSendEnabledCoins(ctx, token).Return(nil)
bankKeeper.EXPECT().SendCoinsFromAccountToModule(ctx, sender, types.ModuleName, token).Return(nil)
bankKeeper.EXPECT().BurnCoins(ctx, types.ModuleName, token).Return(nil)
- k := NewKeeper(encCfg.Codec, key, authKeeper, bankKeeper, denom, authtypes.NewModuleAddress("gov").String())
+ k := NewKeeper(encCfg.Codec, key, memKey, authKeeper, bankKeeper, denom, types.DefaultAuthority().String())
targetSeq := uint64(2)
bz := make([]byte, 8)
binary.BigEndian.PutUint64(bz, targetSeq)
diff --git a/x/fbridge/module/module.go b/x/fbridge/module/module.go
index e7f7cfc28c..72d43c88f3 100644
--- a/x/fbridge/module/module.go
+++ b/x/fbridge/module/module.go
@@ -24,9 +24,11 @@ const (
)
var (
- _ module.AppModuleBasic = AppModuleBasic{}
- _ module.AppModuleGenesis = AppModule{}
- _ module.AppModule = AppModule{}
+ _ module.AppModuleBasic = AppModuleBasic{}
+ _ module.AppModuleGenesis = AppModule{}
+ _ module.AppModule = AppModule{}
+ _ module.BeginBlockAppModule = AppModule{}
+ _ module.EndBlockAppModule = AppModule{}
)
// AppModuleBasic defines the basic application module used by the fbridge module.
@@ -87,7 +89,7 @@ type AppModule struct {
}
// NewAppModule creates a new AppModule object
-func NewAppModule(cdc codec.Codec, keeper keeper.Keeper) AppModule {
+func NewAppModule(_ codec.Codec, keeper keeper.Keeper) AppModule {
return AppModule{
keeper: keeper,
}
@@ -121,9 +123,21 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw
// ConsensusVersion implements AppModule/ConsensusVersion.
func (AppModule) ConsensusVersion() uint64 { return consensusVersion }
+// BeginBlock returns the begin blocker for the fbridge module.
+func (am AppModule) BeginBlock(ctx sdk.Context, _ abci.RequestBeginBlock) {
+ am.keeper.BeginBlocker(ctx)
+}
+
+// EndBlock returns the end blocker for the fbridge module.
+// It returns no validator updates.
+func (am AppModule) EndBlock(ctx sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate {
+ am.keeper.EndBlocker(ctx)
+ return []abci.ValidatorUpdate{}
+}
+
// RegisterInvariants does nothing, there are no invariants to enforce
func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry) {
- _ = ir
+ keeper.RegisterInvariants(ir, am.keeper)
}
// Deprecated: Route does nothing.
diff --git a/x/fbridge/testutil/setup.go b/x/fbridge/testutil/setup.go
index 029772fac0..a7258e9cf8 100644
--- a/x/fbridge/testutil/setup.go
+++ b/x/fbridge/testutil/setup.go
@@ -12,19 +12,22 @@ import (
"github.com/Finschia/finschia-sdk/client"
"github.com/Finschia/finschia-sdk/codec"
codectypes "github.com/Finschia/finschia-sdk/codec/types"
+ "github.com/Finschia/finschia-sdk/crypto/keys/secp256k1"
"github.com/Finschia/finschia-sdk/std"
"github.com/Finschia/finschia-sdk/store"
storetypes "github.com/Finschia/finschia-sdk/store/types"
sdk "github.com/Finschia/finschia-sdk/types"
"github.com/Finschia/finschia-sdk/x/auth/tx"
+ authtypes "github.com/Finschia/finschia-sdk/x/auth/types"
"github.com/Finschia/finschia-sdk/x/fbridge/types"
)
-func DefaultContextWithDB(tb testing.TB, key, tkey storetypes.StoreKey) sdk.Context {
+func DefaultContextWithDB(tb testing.TB, key, mkey, tkey storetypes.StoreKey) sdk.Context {
tb.Helper()
db := dbm.NewMemDB()
cms := store.NewCommitMultiStore(db)
cms.MountStoreWithDB(key, storetypes.StoreTypeIAVL, db)
+ cms.MountStoreWithDB(mkey, storetypes.StoreTypeMemory, db)
cms.MountStoreWithDB(tkey, storetypes.StoreTypeTransient, db)
err := cms.LoadLatestVersion()
assert.NoError(tb, err)
@@ -60,16 +63,23 @@ func MakeTestEncodingConfig() TestEncodingConfig {
return encCfg
}
-func PrepareFbridgeTest(tb testing.TB) (*sdk.KVStoreKey, sdk.Context, TestEncodingConfig, *MockAccountKeeper, *MockBankKeeper) {
+func PrepareFbridgeTest(tb testing.TB, n int) (*sdk.KVStoreKey, *sdk.MemoryStoreKey, sdk.Context, TestEncodingConfig, *MockAccountKeeper, *MockBankKeeper, []sdk.AccAddress) {
tb.Helper()
ctrl := gomock.NewController(tb)
key := storetypes.NewKVStoreKey(types.StoreKey)
- ctx := DefaultContextWithDB(tb, key, sdk.NewTransientStoreKey("transient_test"))
+ memKey := storetypes.NewMemoryStoreKey(types.MemStoreKey)
+ ctx := DefaultContextWithDB(tb, key, memKey, sdk.NewTransientStoreKey("transient_test"))
encCfg := MakeTestEncodingConfig()
authKeeper := NewMockAccountKeeper(ctrl)
+ authKeeper.EXPECT().GetModuleAddress(types.ModuleName).Return(authtypes.NewEmptyModuleAccount("fbridge").GetAddress()).AnyTimes()
bankKeeper := NewMockBankKeeper(ctrl)
- return key, ctx, encCfg, authKeeper, bankKeeper
+ addrs := make([]sdk.AccAddress, n)
+ for i := 0; i < n; i++ {
+ addrs[i] = sdk.AccAddress(secp256k1.GenPrivKey().PubKey().Address())
+ }
+
+ return key, memKey, ctx, encCfg, authKeeper, bankKeeper, addrs
}
diff --git a/x/fbridge/types/codec.go b/x/fbridge/types/codec.go
index c2edd215be..745a212112 100644
--- a/x/fbridge/types/codec.go
+++ b/x/fbridge/types/codec.go
@@ -22,8 +22,7 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
legacy.RegisterAminoMsg(cdc, &MsgClaim{}, "lbm-sdk/MsgClaim")
legacy.RegisterAminoMsg(cdc, &MsgSuggestRole{}, "lbm-sdk/MsgSuggestRole")
legacy.RegisterAminoMsg(cdc, &MsgAddVoteForRole{}, "lbm-sdk/MsgAddVoteForRole")
- legacy.RegisterAminoMsg(cdc, &MsgHalt{}, "lbm-sdk/MsgHalt")
- legacy.RegisterAminoMsg(cdc, &MsgResume{}, "lbm-sdk/MsgResume")
+ legacy.RegisterAminoMsg(cdc, &MsgSetBridgeStatus{}, "lbm-sdk/MsgSetBridgeStatus")
}
func RegisterInterfaces(registrar types.InterfaceRegistry) {
@@ -38,8 +37,7 @@ func RegisterInterfaces(registrar types.InterfaceRegistry) {
&MsgClaim{},
&MsgSuggestRole{},
&MsgAddVoteForRole{},
- &MsgHalt{},
- &MsgResume{},
+ &MsgSetBridgeStatus{},
)
msgservice.RegisterMsgServiceDesc(registrar, &_Msg_serviceDesc)
diff --git a/x/fbridge/types/errors.go b/x/fbridge/types/errors.go
new file mode 100644
index 0000000000..9a8b1e2db0
--- /dev/null
+++ b/x/fbridge/types/errors.go
@@ -0,0 +1,9 @@
+package types
+
+import sdkerrors "github.com/Finschia/finschia-sdk/types/errors"
+
+var (
+ ErrUnknownProposal = sdkerrors.Register(ModuleName, 2, "unknown proposal")
+ ErrUnknownVote = sdkerrors.Register(ModuleName, 3, "unknown vote")
+ ErrInactiveBridge = sdkerrors.Register(ModuleName, 4, "the bridge has halted")
+)
diff --git a/x/fbridge/types/event.pb.go b/x/fbridge/types/event.pb.go
index 0749710deb..e82390f62a 100644
--- a/x/fbridge/types/event.pb.go
+++ b/x/fbridge/types/event.pb.go
@@ -5,6 +5,7 @@ package types
import (
fmt "fmt"
+ _ "github.com/gogo/protobuf/gogoproto"
proto "github.com/gogo/protobuf/proto"
io "io"
math "math"
@@ -94,6 +95,113 @@ func (m *EventTransfer) GetAmount() string {
return ""
}
+type EventSuggestRole struct {
+ Proposal RoleProposal `protobuf:"bytes,1,opt,name=proposal,proto3" json:"proposal"`
+}
+
+func (m *EventSuggestRole) Reset() { *m = EventSuggestRole{} }
+func (m *EventSuggestRole) String() string { return proto.CompactTextString(m) }
+func (*EventSuggestRole) ProtoMessage() {}
+func (*EventSuggestRole) Descriptor() ([]byte, []int) {
+ return fileDescriptor_a36aa6e56f2275b8, []int{1}
+}
+func (m *EventSuggestRole) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *EventSuggestRole) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ if deterministic {
+ return xxx_messageInfo_EventSuggestRole.Marshal(b, m, deterministic)
+ } else {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+ }
+}
+func (m *EventSuggestRole) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_EventSuggestRole.Merge(m, src)
+}
+func (m *EventSuggestRole) XXX_Size() int {
+ return m.Size()
+}
+func (m *EventSuggestRole) XXX_DiscardUnknown() {
+ xxx_messageInfo_EventSuggestRole.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_EventSuggestRole proto.InternalMessageInfo
+
+func (m *EventSuggestRole) GetProposal() RoleProposal {
+ if m != nil {
+ return m.Proposal
+ }
+ return RoleProposal{}
+}
+
+type EventAddVoteForRole struct {
+ // the voter address
+ Voter string `protobuf:"bytes,1,opt,name=voter,proto3" json:"voter,omitempty"`
+ // the role proposal id
+ ProposalId uint64 `protobuf:"varint,2,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"`
+ // the vote option
+ Option VoteOption `protobuf:"varint,3,opt,name=option,proto3,enum=lbm.fbridge.v1.VoteOption" json:"option,omitempty"`
+}
+
+func (m *EventAddVoteForRole) Reset() { *m = EventAddVoteForRole{} }
+func (m *EventAddVoteForRole) String() string { return proto.CompactTextString(m) }
+func (*EventAddVoteForRole) ProtoMessage() {}
+func (*EventAddVoteForRole) Descriptor() ([]byte, []int) {
+ return fileDescriptor_a36aa6e56f2275b8, []int{2}
+}
+func (m *EventAddVoteForRole) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *EventAddVoteForRole) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ if deterministic {
+ return xxx_messageInfo_EventAddVoteForRole.Marshal(b, m, deterministic)
+ } else {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+ }
+}
+func (m *EventAddVoteForRole) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_EventAddVoteForRole.Merge(m, src)
+}
+func (m *EventAddVoteForRole) XXX_Size() int {
+ return m.Size()
+}
+func (m *EventAddVoteForRole) XXX_DiscardUnknown() {
+ xxx_messageInfo_EventAddVoteForRole.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_EventAddVoteForRole proto.InternalMessageInfo
+
+func (m *EventAddVoteForRole) GetVoter() string {
+ if m != nil {
+ return m.Voter
+ }
+ return ""
+}
+
+func (m *EventAddVoteForRole) GetProposalId() uint64 {
+ if m != nil {
+ return m.ProposalId
+ }
+ return 0
+}
+
+func (m *EventAddVoteForRole) GetOption() VoteOption {
+ if m != nil {
+ return m.Option
+ }
+ return OptionEmpty
+}
+
type EventProvision struct {
// the sequence number of the bridge request
Seq uint64 `protobuf:"varint,1,opt,name=seq,proto3" json:"seq,omitempty"`
@@ -111,7 +219,7 @@ func (m *EventProvision) Reset() { *m = EventProvision{} }
func (m *EventProvision) String() string { return proto.CompactTextString(m) }
func (*EventProvision) ProtoMessage() {}
func (*EventProvision) Descriptor() ([]byte, []int) {
- return fileDescriptor_a36aa6e56f2275b8, []int{1}
+ return fileDescriptor_a36aa6e56f2275b8, []int{3}
}
func (m *EventProvision) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -184,7 +292,7 @@ func (m *EventConfirmProvision) Reset() { *m = EventConfirmProvision{} }
func (m *EventConfirmProvision) String() string { return proto.CompactTextString(m) }
func (*EventConfirmProvision) ProtoMessage() {}
func (*EventConfirmProvision) Descriptor() ([]byte, []int) {
- return fileDescriptor_a36aa6e56f2275b8, []int{2}
+ return fileDescriptor_a36aa6e56f2275b8, []int{4}
}
func (m *EventConfirmProvision) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -235,7 +343,7 @@ func (m *EventClaim) Reset() { *m = EventClaim{} }
func (m *EventClaim) String() string { return proto.CompactTextString(m) }
func (*EventClaim) ProtoMessage() {}
func (*EventClaim) Descriptor() ([]byte, []int) {
- return fileDescriptor_a36aa6e56f2275b8, []int{3}
+ return fileDescriptor_a36aa6e56f2275b8, []int{5}
}
func (m *EventClaim) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -294,6 +402,8 @@ func (m *EventClaim) GetAmount() string {
func init() {
proto.RegisterType((*EventTransfer)(nil), "lbm.fbridge.v1.EventTransfer")
+ proto.RegisterType((*EventSuggestRole)(nil), "lbm.fbridge.v1.EventSuggestRole")
+ proto.RegisterType((*EventAddVoteForRole)(nil), "lbm.fbridge.v1.EventAddVoteForRole")
proto.RegisterType((*EventProvision)(nil), "lbm.fbridge.v1.EventProvision")
proto.RegisterType((*EventConfirmProvision)(nil), "lbm.fbridge.v1.EventConfirmProvision")
proto.RegisterType((*EventClaim)(nil), "lbm.fbridge.v1.EventClaim")
@@ -302,25 +412,33 @@ func init() {
func init() { proto.RegisterFile("lbm/fbridge/v1/event.proto", fileDescriptor_a36aa6e56f2275b8) }
var fileDescriptor_a36aa6e56f2275b8 = []byte{
- // 276 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x91, 0xbd, 0x4e, 0xc3, 0x30,
- 0x10, 0xc7, 0x63, 0x5a, 0x2a, 0xb0, 0x44, 0x85, 0x22, 0x81, 0xa2, 0x0e, 0x56, 0x95, 0xa9, 0x0c,
- 0xc4, 0x54, 0xbc, 0x01, 0x08, 0x06, 0x26, 0x54, 0x31, 0xb1, 0xe5, 0xe3, 0xd2, 0x1a, 0x62, 0x3b,
- 0x9c, 0x5d, 0x0b, 0x5e, 0x81, 0x89, 0xc7, 0x62, 0xec, 0xc8, 0x88, 0x92, 0x17, 0x41, 0xf9, 0xa0,
- 0x63, 0xb7, 0x6e, 0xf7, 0xd3, 0xff, 0x7e, 0xba, 0xbf, 0x74, 0x74, 0x52, 0x24, 0x92, 0xe7, 0x09,
- 0x8a, 0x6c, 0x09, 0xdc, 0xcd, 0x39, 0x38, 0x50, 0x36, 0x2a, 0x51, 0x5b, 0xed, 0x8f, 0x8b, 0x44,
- 0x46, 0x7d, 0x16, 0xb9, 0x79, 0x28, 0xe9, 0xc9, 0x5d, 0x13, 0x3f, 0x61, 0xac, 0x4c, 0x0e, 0xe8,
- 0x9f, 0xd2, 0x81, 0x81, 0xb7, 0x80, 0x4c, 0xc9, 0x6c, 0xb8, 0x68, 0x46, 0xff, 0x9c, 0x8e, 0x0c,
- 0xa8, 0x0c, 0x30, 0x38, 0x98, 0x92, 0xd9, 0xf1, 0xa2, 0x27, 0x7f, 0x42, 0x8f, 0x10, 0x52, 0x10,
- 0x0e, 0x30, 0x18, 0xb4, 0xc9, 0x96, 0x1b, 0x27, 0x96, 0x7a, 0xad, 0x6c, 0x30, 0xec, 0x9c, 0x8e,
- 0xc2, 0x4f, 0x42, 0xc7, 0xed, 0xbd, 0x47, 0xd4, 0x4e, 0x18, 0xa1, 0xd5, 0x7e, 0x0f, 0x36, 0x8e,
- 0x2e, 0x01, 0x63, 0xab, 0x31, 0x38, 0xec, 0x9c, 0x7f, 0x0e, 0x2f, 0xe8, 0x59, 0xdb, 0xe5, 0x56,
- 0xab, 0x5c, 0xa0, 0xdc, 0x51, 0x29, 0x7c, 0xa1, 0xb4, 0x5b, 0x2d, 0x62, 0x21, 0xf7, 0x5b, 0xf9,
- 0xe6, 0xe1, 0xbb, 0x62, 0x64, 0x53, 0x31, 0xf2, 0x5b, 0x31, 0xf2, 0x55, 0x33, 0x6f, 0x53, 0x33,
- 0xef, 0xa7, 0x66, 0xde, 0xf3, 0xd5, 0x52, 0xd8, 0xd5, 0x3a, 0x89, 0x52, 0x2d, 0xf9, 0xbd, 0x50,
- 0x26, 0x5d, 0x89, 0x98, 0xe7, 0xfd, 0x70, 0x69, 0xb2, 0x57, 0xfe, 0xbe, 0xfd, 0xbb, 0xfd, 0x28,
- 0xc1, 0x24, 0xa3, 0xf6, 0xeb, 0xd7, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x3b, 0x5f, 0xda, 0xeb,
- 0x13, 0x02, 0x00, 0x00,
+ // 408 bytes of a gzipped FileDescriptorProto
+ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x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ea,
+ 0xe4, 0x52, 0x48, 0x3d, 0xbf, 0x16, 0x69, 0x52, 0x0c, 0xc3, 0x13, 0x9d, 0x7f, 0x49, 0xbe, 0xad,
+ 0x1f, 0xb0, 0xf9, 0xde, 0xa0, 0xce, 0x26, 0xf6, 0xf1, 0x3e, 0xfb, 0x17, 0x00, 0x00, 0xff, 0xff,
+ 0x96, 0x66, 0x6c, 0xc3, 0x1e, 0x03, 0x00, 0x00,
}
func (m *EventTransfer) Marshal() (dAtA []byte, err error) {
@@ -372,6 +490,79 @@ func (m *EventTransfer) MarshalToSizedBuffer(dAtA []byte) (int, error) {
return len(dAtA) - i, nil
}
+func (m *EventSuggestRole) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *EventSuggestRole) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *EventSuggestRole) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ {
+ size, err := m.Proposal.MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintEvent(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0xa
+ return len(dAtA) - i, nil
+}
+
+func (m *EventAddVoteForRole) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *EventAddVoteForRole) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *EventAddVoteForRole) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ if m.Option != 0 {
+ i = encodeVarintEvent(dAtA, i, uint64(m.Option))
+ i--
+ dAtA[i] = 0x18
+ }
+ if m.ProposalId != 0 {
+ i = encodeVarintEvent(dAtA, i, uint64(m.ProposalId))
+ i--
+ dAtA[i] = 0x10
+ }
+ if len(m.Voter) > 0 {
+ i -= len(m.Voter)
+ copy(dAtA[i:], m.Voter)
+ i = encodeVarintEvent(dAtA, i, uint64(len(m.Voter)))
+ i--
+ dAtA[i] = 0xa
+ }
+ return len(dAtA) - i, nil
+}
+
func (m *EventProvision) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
@@ -540,6 +731,36 @@ func (m *EventTransfer) Size() (n int) {
return n
}
+func (m *EventSuggestRole) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ l = m.Proposal.Size()
+ n += 1 + l + sovEvent(uint64(l))
+ return n
+}
+
+func (m *EventAddVoteForRole) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ l = len(m.Voter)
+ if l > 0 {
+ n += 1 + l + sovEvent(uint64(l))
+ }
+ if m.ProposalId != 0 {
+ n += 1 + sovEvent(uint64(m.ProposalId))
+ }
+ if m.Option != 0 {
+ n += 1 + sovEvent(uint64(m.Option))
+ }
+ return n
+}
+
func (m *EventProvision) Size() (n int) {
if m == nil {
return 0
@@ -775,6 +996,209 @@ func (m *EventTransfer) Unmarshal(dAtA []byte) error {
}
return nil
}
+func (m *EventSuggestRole) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowEvent
+ }
+ if iNdEx >= l {
+ return 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 fmt.Errorf("proto: EventSuggestRole: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: EventSuggestRole: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Proposal", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowEvent
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthEvent
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthEvent
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if err := m.Proposal.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipEvent(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthEvent
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *EventAddVoteForRole) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowEvent
+ }
+ if iNdEx >= l {
+ return 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 fmt.Errorf("proto: EventAddVoteForRole: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: EventAddVoteForRole: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Voter", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowEvent
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthEvent
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthEvent
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Voter = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 2:
+ if wireType != 0 {
+ return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType)
+ }
+ m.ProposalId = 0
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowEvent
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ m.ProposalId |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ case 3:
+ if wireType != 0 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Option", wireType)
+ }
+ m.Option = 0
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowEvent
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ m.Option |= VoteOption(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ default:
+ iNdEx = preIndex
+ skippy, err := skipEvent(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthEvent
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
func (m *EventProvision) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
diff --git a/x/fbridge/types/fbridge.go b/x/fbridge/types/fbridge.go
new file mode 100644
index 0000000000..fa20ca542e
--- /dev/null
+++ b/x/fbridge/types/fbridge.go
@@ -0,0 +1,39 @@
+package types
+
+import (
+ "errors"
+)
+
+var QueryParamToRole = map[string]Role{
+ "unspecified": 0,
+ "guardian": 1,
+ "operator": 2,
+ "judge": 3,
+}
+
+func IsValidRole(role Role) error {
+ switch role {
+ case RoleGuardian, RoleOperator, RoleJudge:
+ return nil
+ }
+
+ return errors.New("unsupported role")
+}
+
+func IsValidVoteOption(option VoteOption) error {
+ switch option {
+ case OptionYes, OptionNo:
+ return nil
+ }
+
+ return errors.New("unsupported vote option")
+}
+
+func IsValidBridgeStatus(status BridgeStatus) error {
+ switch status {
+ case StatusActive, StatusInactive:
+ return nil
+ }
+
+ return errors.New("unsupported bridge status")
+}
diff --git a/x/fbridge/types/fbridge.pb.go b/x/fbridge/types/fbridge.pb.go
index a9b8197a74..e81d70a81b 100644
--- a/x/fbridge/types/fbridge.pb.go
+++ b/x/fbridge/types/fbridge.pb.go
@@ -8,15 +8,19 @@ import (
github_com_Finschia_finschia_sdk_types "github.com/Finschia/finschia-sdk/types"
_ "github.com/gogo/protobuf/gogoproto"
proto "github.com/gogo/protobuf/proto"
+ github_com_gogo_protobuf_types "github.com/gogo/protobuf/types"
+ _ "google.golang.org/protobuf/types/known/timestamppb"
io "io"
math "math"
math_bits "math/bits"
+ time "time"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
+var _ = time.Kitchen
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
@@ -28,10 +32,10 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
type Role int32
const (
- Role_UNSPECIFIED Role = 0
- Role_GUARDIAN Role = 1
- Role_OPERATOR Role = 2
- Role_JUDGE Role = 3
+ RoleEmpty Role = 0
+ RoleGuardian Role = 1
+ RoleOperator Role = 2
+ RoleJudge Role = 3
)
var Role_name = map[int32]string{
@@ -56,6 +60,69 @@ func (Role) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_62374d75fc6aa1ba, []int{0}
}
+// VoteOption enumerates the valid vote options for a given role proposal.
+type VoteOption int32
+
+const (
+ // VOTE_OPTION_UNSPECIFIED defines a no-op vote option.
+ OptionEmpty VoteOption = 0
+ // VOTE_OPTION_YES defines a yes vote option.
+ OptionYes VoteOption = 1
+ // VOTE_OPTION_NO defines a no vote option.
+ OptionNo VoteOption = 2
+)
+
+var VoteOption_name = map[int32]string{
+ 0: "VOTE_OPTION_UNSPECIFIED",
+ 1: "VOTE_OPTION_YES",
+ 2: "VOTE_OPTION_NO",
+}
+
+var VoteOption_value = map[string]int32{
+ "VOTE_OPTION_UNSPECIFIED": 0,
+ "VOTE_OPTION_YES": 1,
+ "VOTE_OPTION_NO": 2,
+}
+
+func (x VoteOption) String() string {
+ return proto.EnumName(VoteOption_name, int32(x))
+}
+
+func (VoteOption) EnumDescriptor() ([]byte, []int) {
+ return fileDescriptor_62374d75fc6aa1ba, []int{1}
+}
+
+type BridgeStatus int32
+
+const (
+ // BRIDGE_STATUS_UNSPECIFIED defines an unspecified bridge status.
+ StatusEmpty BridgeStatus = 0
+ // BRIDGE_STATUS_ACTIVE defines an active bridge status.
+ StatusActive BridgeStatus = 1
+ // BRIDGE_STATUS_INACTIVE defines an inactive bridge status.
+ StatusInactive BridgeStatus = 2
+)
+
+var BridgeStatus_name = map[int32]string{
+ 0: "BRIDGE_STATUS_UNSPECIFIED",
+ 1: "BRIDGE_STATUS_ACTIVE",
+ 2: "BRIDGE_STATUS_INACTIVE",
+}
+
+var BridgeStatus_value = map[string]int32{
+ "BRIDGE_STATUS_UNSPECIFIED": 0,
+ "BRIDGE_STATUS_ACTIVE": 1,
+ "BRIDGE_STATUS_INACTIVE": 2,
+}
+
+func (x BridgeStatus) String() string {
+ return proto.EnumName(BridgeStatus_name, int32(x))
+}
+
+func (BridgeStatus) EnumDescriptor() ([]byte, []int) {
+ return fileDescriptor_62374d75fc6aa1ba, []int{2}
+}
+
type Params struct {
// ratio of how many operators' confirmations are needed to be valid.
OperatorTrustLevel Fraction `protobuf:"bytes,1,opt,name=operator_trust_level,json=operatorTrustLevel,proto3" json:"operator_trust_level"`
@@ -322,6 +389,58 @@ func (m *Fraction) GetDenominator() uint64 {
return 0
}
+type RolePair struct {
+ Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
+ Role Role `protobuf:"varint,2,opt,name=role,proto3,enum=lbm.fbridge.v1.Role" json:"role,omitempty"`
+}
+
+func (m *RolePair) Reset() { *m = RolePair{} }
+func (m *RolePair) String() string { return proto.CompactTextString(m) }
+func (*RolePair) ProtoMessage() {}
+func (*RolePair) Descriptor() ([]byte, []int) {
+ return fileDescriptor_62374d75fc6aa1ba, []int{4}
+}
+func (m *RolePair) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *RolePair) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ if deterministic {
+ return xxx_messageInfo_RolePair.Marshal(b, m, deterministic)
+ } else {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+ }
+}
+func (m *RolePair) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_RolePair.Merge(m, src)
+}
+func (m *RolePair) XXX_Size() int {
+ return m.Size()
+}
+func (m *RolePair) XXX_DiscardUnknown() {
+ xxx_messageInfo_RolePair.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_RolePair proto.InternalMessageInfo
+
+func (m *RolePair) GetAddress() string {
+ if m != nil {
+ return m.Address
+ }
+ return ""
+}
+
+func (m *RolePair) GetRole() Role {
+ if m != nil {
+ return m.Role
+ }
+ return RoleEmpty
+}
+
type RoleProposal struct {
Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
// the proposer address
@@ -335,14 +454,14 @@ type RoleProposal struct {
// - judge : 3
Role Role `protobuf:"varint,4,opt,name=role,proto3,enum=lbm.fbridge.v1.Role" json:"role,omitempty"`
// the unix timestamp the proposal will be expired (unix timestamp)
- ExpiredAt uint64 `protobuf:"varint,5,opt,name=expired_at,json=expiredAt,proto3" json:"expired_at,omitempty"`
+ ExpiredAt time.Time `protobuf:"bytes,5,opt,name=expired_at,json=expiredAt,proto3,stdtime" json:"expired_at"`
}
func (m *RoleProposal) Reset() { *m = RoleProposal{} }
func (m *RoleProposal) String() string { return proto.CompactTextString(m) }
func (*RoleProposal) ProtoMessage() {}
func (*RoleProposal) Descriptor() ([]byte, []int) {
- return fileDescriptor_62374d75fc6aa1ba, []int{4}
+ return fileDescriptor_62374d75fc6aa1ba, []int{5}
}
func (m *RoleProposal) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -396,68 +515,276 @@ func (m *RoleProposal) GetRole() Role {
if m != nil {
return m.Role
}
- return Role_UNSPECIFIED
+ return RoleEmpty
}
-func (m *RoleProposal) GetExpiredAt() uint64 {
+func (m *RoleProposal) GetExpiredAt() time.Time {
if m != nil {
return m.ExpiredAt
}
+ return time.Time{}
+}
+
+// Vote defines a vote on a role proposal.
+type Vote struct {
+ ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"`
+ Voter string `protobuf:"bytes,2,opt,name=voter,proto3" json:"voter,omitempty"`
+ Option VoteOption `protobuf:"varint,3,opt,name=option,proto3,enum=lbm.fbridge.v1.VoteOption" json:"option,omitempty"`
+}
+
+func (m *Vote) Reset() { *m = Vote{} }
+func (m *Vote) String() string { return proto.CompactTextString(m) }
+func (*Vote) ProtoMessage() {}
+func (*Vote) Descriptor() ([]byte, []int) {
+ return fileDescriptor_62374d75fc6aa1ba, []int{6}
+}
+func (m *Vote) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *Vote) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ if deterministic {
+ return xxx_messageInfo_Vote.Marshal(b, m, deterministic)
+ } else {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+ }
+}
+func (m *Vote) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_Vote.Merge(m, src)
+}
+func (m *Vote) XXX_Size() int {
+ return m.Size()
+}
+func (m *Vote) XXX_DiscardUnknown() {
+ xxx_messageInfo_Vote.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_Vote proto.InternalMessageInfo
+
+func (m *Vote) GetProposalId() uint64 {
+ if m != nil {
+ return m.ProposalId
+ }
+ return 0
+}
+
+func (m *Vote) GetVoter() string {
+ if m != nil {
+ return m.Voter
+ }
+ return ""
+}
+
+func (m *Vote) GetOption() VoteOption {
+ if m != nil {
+ return m.Option
+ }
+ return OptionEmpty
+}
+
+// RoleMetadata defines the metadata of the role.
+type RoleMetadata struct {
+ // the number of registered guardians
+ Guardian uint64 `protobuf:"varint,1,opt,name=guardian,proto3" json:"guardian,omitempty"`
+ // the number of the operators
+ Operator uint64 `protobuf:"varint,2,opt,name=operator,proto3" json:"operator,omitempty"`
+ // the number of the judges
+ Judge uint64 `protobuf:"varint,3,opt,name=judge,proto3" json:"judge,omitempty"`
+}
+
+func (m *RoleMetadata) Reset() { *m = RoleMetadata{} }
+func (m *RoleMetadata) String() string { return proto.CompactTextString(m) }
+func (*RoleMetadata) ProtoMessage() {}
+func (*RoleMetadata) Descriptor() ([]byte, []int) {
+ return fileDescriptor_62374d75fc6aa1ba, []int{7}
+}
+func (m *RoleMetadata) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *RoleMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ if deterministic {
+ return xxx_messageInfo_RoleMetadata.Marshal(b, m, deterministic)
+ } else {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+ }
+}
+func (m *RoleMetadata) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_RoleMetadata.Merge(m, src)
+}
+func (m *RoleMetadata) XXX_Size() int {
+ return m.Size()
+}
+func (m *RoleMetadata) XXX_DiscardUnknown() {
+ xxx_messageInfo_RoleMetadata.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_RoleMetadata proto.InternalMessageInfo
+
+func (m *RoleMetadata) GetGuardian() uint64 {
+ if m != nil {
+ return m.Guardian
+ }
+ return 0
+}
+
+func (m *RoleMetadata) GetOperator() uint64 {
+ if m != nil {
+ return m.Operator
+ }
+ return 0
+}
+
+func (m *RoleMetadata) GetJudge() uint64 {
+ if m != nil {
+ return m.Judge
+ }
+ return 0
+}
+
+// BridgeStatusMetadata defines the metadata of the bridge status.
+type BridgeStatusMetadata struct {
+ // the number of inactived bridge switch
+ Inactive uint64 `protobuf:"varint,1,opt,name=inactive,proto3" json:"inactive,omitempty"`
+ // the number of activated bridge switch
+ Active uint64 `protobuf:"varint,2,opt,name=active,proto3" json:"active,omitempty"`
+}
+
+func (m *BridgeStatusMetadata) Reset() { *m = BridgeStatusMetadata{} }
+func (m *BridgeStatusMetadata) String() string { return proto.CompactTextString(m) }
+func (*BridgeStatusMetadata) ProtoMessage() {}
+func (*BridgeStatusMetadata) Descriptor() ([]byte, []int) {
+ return fileDescriptor_62374d75fc6aa1ba, []int{8}
+}
+func (m *BridgeStatusMetadata) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *BridgeStatusMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ if deterministic {
+ return xxx_messageInfo_BridgeStatusMetadata.Marshal(b, m, deterministic)
+ } else {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+ }
+}
+func (m *BridgeStatusMetadata) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_BridgeStatusMetadata.Merge(m, src)
+}
+func (m *BridgeStatusMetadata) XXX_Size() int {
+ return m.Size()
+}
+func (m *BridgeStatusMetadata) XXX_DiscardUnknown() {
+ xxx_messageInfo_BridgeStatusMetadata.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_BridgeStatusMetadata proto.InternalMessageInfo
+
+func (m *BridgeStatusMetadata) GetInactive() uint64 {
+ if m != nil {
+ return m.Inactive
+ }
+ return 0
+}
+
+func (m *BridgeStatusMetadata) GetActive() uint64 {
+ if m != nil {
+ return m.Active
+ }
return 0
}
func init() {
proto.RegisterEnum("lbm.fbridge.v1.Role", Role_name, Role_value)
+ proto.RegisterEnum("lbm.fbridge.v1.VoteOption", VoteOption_name, VoteOption_value)
+ proto.RegisterEnum("lbm.fbridge.v1.BridgeStatus", BridgeStatus_name, BridgeStatus_value)
proto.RegisterType((*Params)(nil), "lbm.fbridge.v1.Params")
proto.RegisterType((*ProvisionData)(nil), "lbm.fbridge.v1.ProvisionData")
proto.RegisterType((*ProvisionStatus)(nil), "lbm.fbridge.v1.ProvisionStatus")
proto.RegisterType((*Fraction)(nil), "lbm.fbridge.v1.Fraction")
+ proto.RegisterType((*RolePair)(nil), "lbm.fbridge.v1.RolePair")
proto.RegisterType((*RoleProposal)(nil), "lbm.fbridge.v1.RoleProposal")
+ proto.RegisterType((*Vote)(nil), "lbm.fbridge.v1.Vote")
+ proto.RegisterType((*RoleMetadata)(nil), "lbm.fbridge.v1.RoleMetadata")
+ proto.RegisterType((*BridgeStatusMetadata)(nil), "lbm.fbridge.v1.BridgeStatusMetadata")
}
func init() { proto.RegisterFile("lbm/fbridge/v1/fbridge.proto", fileDescriptor_62374d75fc6aa1ba) }
var fileDescriptor_62374d75fc6aa1ba = []byte{
- // 614 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0x41, 0x4f, 0x1b, 0x3d,
- 0x10, 0xcd, 0x86, 0x10, 0x65, 0x27, 0x90, 0xe4, 0xb3, 0xd0, 0x27, 0x84, 0x68, 0xa0, 0x91, 0xaa,
- 0x22, 0xa4, 0x26, 0x85, 0xde, 0x2b, 0x05, 0x12, 0x50, 0xa2, 0x0a, 0x56, 0x06, 0x2e, 0xbd, 0x44,
- 0xce, 0xae, 0x59, 0x5c, 0x76, 0xed, 0xad, 0xed, 0x8d, 0x68, 0x7f, 0x45, 0xef, 0x3d, 0xf5, 0xdf,
- 0xa0, 0x9e, 0x38, 0x56, 0x3d, 0xa0, 0x0a, 0xfe, 0x48, 0x65, 0xef, 0x6e, 0x0a, 0xbd, 0x94, 0xdb,
- 0xcc, 0xdb, 0x37, 0xcf, 0xcf, 0xcf, 0x93, 0xc0, 0x7a, 0x34, 0x8d, 0x7b, 0xe7, 0x53, 0xc9, 0x82,
- 0x90, 0xf6, 0x66, 0x3b, 0x45, 0xd9, 0x4d, 0xa4, 0xd0, 0x02, 0x35, 0xa2, 0x69, 0xdc, 0x2d, 0xa0,
- 0xd9, 0xce, 0xda, 0x4a, 0x28, 0x42, 0x61, 0x3f, 0xf5, 0x4c, 0x95, 0xb1, 0x3a, 0xdf, 0xcb, 0x50,
- 0xf5, 0x88, 0x24, 0xb1, 0x42, 0x1e, 0xac, 0x88, 0x84, 0x4a, 0xa2, 0x85, 0x9c, 0x68, 0x99, 0x2a,
- 0x3d, 0x89, 0xe8, 0x8c, 0x46, 0xab, 0x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0x09, 0x1f, 0x5e, 0x07, 0x00, 0x00,
}
func (m *Params) Marshal() (dAtA []byte, err error) {
@@ -651,6 +978,41 @@ func (m *Fraction) MarshalToSizedBuffer(dAtA []byte) (int, error) {
return len(dAtA) - i, nil
}
+func (m *RolePair) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *RolePair) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *RolePair) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ if m.Role != 0 {
+ i = encodeVarintFbridge(dAtA, i, uint64(m.Role))
+ i--
+ dAtA[i] = 0x10
+ }
+ if len(m.Address) > 0 {
+ i -= len(m.Address)
+ copy(dAtA[i:], m.Address)
+ i = encodeVarintFbridge(dAtA, i, uint64(len(m.Address)))
+ i--
+ dAtA[i] = 0xa
+ }
+ return len(dAtA) - i, nil
+}
+
func (m *RoleProposal) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
@@ -671,11 +1033,14 @@ func (m *RoleProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) {
_ = i
var l int
_ = l
- if m.ExpiredAt != 0 {
- i = encodeVarintFbridge(dAtA, i, uint64(m.ExpiredAt))
- i--
- dAtA[i] = 0x28
+ n4, err4 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.ExpiredAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.ExpiredAt):])
+ if err4 != nil {
+ return 0, err4
}
+ i -= n4
+ i = encodeVarintFbridge(dAtA, i, uint64(n4))
+ i--
+ dAtA[i] = 0x2a
if m.Role != 0 {
i = encodeVarintFbridge(dAtA, i, uint64(m.Role))
i--
@@ -703,46 +1068,157 @@ func (m *RoleProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) {
return len(dAtA) - i, nil
}
-func encodeVarintFbridge(dAtA []byte, offset int, v uint64) int {
- offset -= sovFbridge(v)
- base := offset
- for v >= 1<<7 {
- dAtA[offset] = uint8(v&0x7f | 0x80)
- v >>= 7
- offset++
+func (m *Vote) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
}
- dAtA[offset] = uint8(v)
- return base
+ return dAtA[:n], nil
}
-func (m *Params) Size() (n int) {
- if m == nil {
- return 0
- }
+
+func (m *Vote) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *Vote) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
var l int
_ = l
- l = m.OperatorTrustLevel.Size()
- n += 1 + l + sovFbridge(uint64(l))
- l = m.GuardianTrustLevel.Size()
- n += 1 + l + sovFbridge(uint64(l))
- l = m.JudgeTrustLevel.Size()
- n += 1 + l + sovFbridge(uint64(l))
- if m.TimelockPeriod != 0 {
- n += 1 + sovFbridge(uint64(m.TimelockPeriod))
+ if m.Option != 0 {
+ i = encodeVarintFbridge(dAtA, i, uint64(m.Option))
+ i--
+ dAtA[i] = 0x18
}
- if m.ProposalPeriod != 0 {
- n += 1 + sovFbridge(uint64(m.ProposalPeriod))
+ if len(m.Voter) > 0 {
+ i -= len(m.Voter)
+ copy(dAtA[i:], m.Voter)
+ i = encodeVarintFbridge(dAtA, i, uint64(len(m.Voter)))
+ i--
+ dAtA[i] = 0x12
}
- return n
+ if m.ProposalId != 0 {
+ i = encodeVarintFbridge(dAtA, i, uint64(m.ProposalId))
+ i--
+ dAtA[i] = 0x8
+ }
+ return len(dAtA) - i, nil
}
-func (m *ProvisionData) Size() (n int) {
- if m == nil {
- return 0
+func (m *RoleMetadata) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
}
+ return dAtA[:n], nil
+}
+
+func (m *RoleMetadata) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *RoleMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
var l int
_ = l
- if m.Seq != 0 {
- n += 1 + sovFbridge(uint64(m.Seq))
+ if m.Judge != 0 {
+ i = encodeVarintFbridge(dAtA, i, uint64(m.Judge))
+ i--
+ dAtA[i] = 0x18
+ }
+ if m.Operator != 0 {
+ i = encodeVarintFbridge(dAtA, i, uint64(m.Operator))
+ i--
+ dAtA[i] = 0x10
+ }
+ if m.Guardian != 0 {
+ i = encodeVarintFbridge(dAtA, i, uint64(m.Guardian))
+ i--
+ dAtA[i] = 0x8
+ }
+ return len(dAtA) - i, nil
+}
+
+func (m *BridgeStatusMetadata) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *BridgeStatusMetadata) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *BridgeStatusMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ if m.Active != 0 {
+ i = encodeVarintFbridge(dAtA, i, uint64(m.Active))
+ i--
+ dAtA[i] = 0x10
+ }
+ if m.Inactive != 0 {
+ i = encodeVarintFbridge(dAtA, i, uint64(m.Inactive))
+ i--
+ dAtA[i] = 0x8
+ }
+ return len(dAtA) - i, nil
+}
+
+func encodeVarintFbridge(dAtA []byte, offset int, v uint64) int {
+ offset -= sovFbridge(v)
+ base := offset
+ for v >= 1<<7 {
+ dAtA[offset] = uint8(v&0x7f | 0x80)
+ v >>= 7
+ offset++
+ }
+ dAtA[offset] = uint8(v)
+ return base
+}
+func (m *Params) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ l = m.OperatorTrustLevel.Size()
+ n += 1 + l + sovFbridge(uint64(l))
+ l = m.GuardianTrustLevel.Size()
+ n += 1 + l + sovFbridge(uint64(l))
+ l = m.JudgeTrustLevel.Size()
+ n += 1 + l + sovFbridge(uint64(l))
+ if m.TimelockPeriod != 0 {
+ n += 1 + sovFbridge(uint64(m.TimelockPeriod))
+ }
+ if m.ProposalPeriod != 0 {
+ n += 1 + sovFbridge(uint64(m.ProposalPeriod))
+ }
+ return n
+}
+
+func (m *ProvisionData) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ if m.Seq != 0 {
+ n += 1 + sovFbridge(uint64(m.Seq))
}
l = m.Amount.Size()
n += 1 + l + sovFbridge(uint64(l))
@@ -790,6 +1266,22 @@ func (m *Fraction) Size() (n int) {
return n
}
+func (m *RolePair) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ l = len(m.Address)
+ if l > 0 {
+ n += 1 + l + sovFbridge(uint64(l))
+ }
+ if m.Role != 0 {
+ n += 1 + sovFbridge(uint64(m.Role))
+ }
+ return n
+}
+
func (m *RoleProposal) Size() (n int) {
if m == nil {
return 0
@@ -810,8 +1302,59 @@ func (m *RoleProposal) Size() (n int) {
if m.Role != 0 {
n += 1 + sovFbridge(uint64(m.Role))
}
- if m.ExpiredAt != 0 {
- n += 1 + sovFbridge(uint64(m.ExpiredAt))
+ l = github_com_gogo_protobuf_types.SizeOfStdTime(m.ExpiredAt)
+ n += 1 + l + sovFbridge(uint64(l))
+ return n
+}
+
+func (m *Vote) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ if m.ProposalId != 0 {
+ n += 1 + sovFbridge(uint64(m.ProposalId))
+ }
+ l = len(m.Voter)
+ if l > 0 {
+ n += 1 + l + sovFbridge(uint64(l))
+ }
+ if m.Option != 0 {
+ n += 1 + sovFbridge(uint64(m.Option))
+ }
+ return n
+}
+
+func (m *RoleMetadata) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ if m.Guardian != 0 {
+ n += 1 + sovFbridge(uint64(m.Guardian))
+ }
+ if m.Operator != 0 {
+ n += 1 + sovFbridge(uint64(m.Operator))
+ }
+ if m.Judge != 0 {
+ n += 1 + sovFbridge(uint64(m.Judge))
+ }
+ return n
+}
+
+func (m *BridgeStatusMetadata) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ if m.Inactive != 0 {
+ n += 1 + sovFbridge(uint64(m.Inactive))
+ }
+ if m.Active != 0 {
+ n += 1 + sovFbridge(uint64(m.Active))
}
return n
}
@@ -1372,6 +1915,107 @@ func (m *Fraction) Unmarshal(dAtA []byte) error {
}
return nil
}
+func (m *RolePair) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowFbridge
+ }
+ if iNdEx >= l {
+ return 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 fmt.Errorf("proto: RolePair: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: RolePair: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowFbridge
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthFbridge
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthFbridge
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Address = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 2:
+ if wireType != 0 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Role", wireType)
+ }
+ m.Role = 0
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowFbridge
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ m.Role |= Role(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ default:
+ iNdEx = preIndex
+ skippy, err := skipFbridge(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthFbridge
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
func (m *RoleProposal) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -1504,10 +2148,339 @@ func (m *RoleProposal) Unmarshal(dAtA []byte) error {
}
}
case 5:
- if wireType != 0 {
+ if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field ExpiredAt", wireType)
}
- m.ExpiredAt = 0
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowFbridge
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthFbridge
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthFbridge
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.ExpiredAt, dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipFbridge(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthFbridge
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *Vote) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowFbridge
+ }
+ if iNdEx >= l {
+ return 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 fmt.Errorf("proto: Vote: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: Vote: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 0 {
+ return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType)
+ }
+ m.ProposalId = 0
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowFbridge
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ m.ProposalId |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Voter", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowFbridge
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthFbridge
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthFbridge
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Voter = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 3:
+ if wireType != 0 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Option", wireType)
+ }
+ m.Option = 0
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowFbridge
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ m.Option |= VoteOption(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ default:
+ iNdEx = preIndex
+ skippy, err := skipFbridge(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthFbridge
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *RoleMetadata) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowFbridge
+ }
+ if iNdEx >= l {
+ return 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 fmt.Errorf("proto: RoleMetadata: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: RoleMetadata: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 0 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Guardian", wireType)
+ }
+ m.Guardian = 0
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowFbridge
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ m.Guardian |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ case 2:
+ if wireType != 0 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Operator", wireType)
+ }
+ m.Operator = 0
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowFbridge
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ m.Operator |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ case 3:
+ if wireType != 0 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Judge", wireType)
+ }
+ m.Judge = 0
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowFbridge
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ m.Judge |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ default:
+ iNdEx = preIndex
+ skippy, err := skipFbridge(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthFbridge
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *BridgeStatusMetadata) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowFbridge
+ }
+ if iNdEx >= l {
+ return 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 fmt.Errorf("proto: BridgeStatusMetadata: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: BridgeStatusMetadata: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 0 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Inactive", wireType)
+ }
+ m.Inactive = 0
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowFbridge
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ m.Inactive |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ case 2:
+ if wireType != 0 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Active", wireType)
+ }
+ m.Active = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowFbridge
@@ -1517,7 +2490,7 @@ func (m *RoleProposal) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
- m.ExpiredAt |= uint64(b&0x7F) << shift
+ m.Active |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
diff --git a/x/fbridge/types/genesis.go b/x/fbridge/types/genesis.go
index 07af6f9677..358f64b2fa 100644
--- a/x/fbridge/types/genesis.go
+++ b/x/fbridge/types/genesis.go
@@ -5,26 +5,104 @@ import (
sdk "github.com/Finschia/finschia-sdk/types"
authtypes "github.com/Finschia/finschia-sdk/x/auth/types"
+ foundationtypes "github.com/Finschia/finschia-sdk/x/foundation"
govtypes "github.com/Finschia/finschia-sdk/x/gov/types"
)
func DefaultGenesisState() *GenesisState {
return &GenesisState{
+ Params: DefaultParams(),
SendingState: SendingState{
NextSeq: 1,
},
- ReceivingState: ReceivingState{},
+ ReceivingState: ReceivingState{},
+ NextRoleProposalId: 1,
+ }
+}
+
+func DefaultAuthority() sdk.AccAddress {
+ return authtypes.NewModuleAddress(govtypes.ModuleName)
+}
+
+func AuthorityCandiates() []sdk.AccAddress {
+ return []sdk.AccAddress{
+ authtypes.NewModuleAddress(govtypes.ModuleName),
+ authtypes.NewModuleAddress(foundationtypes.ModuleName),
}
}
func ValidateGenesis(data GenesisState) error {
- if data.SendingState.NextSeq < 1 {
- panic(errors.New("next sequence must be positive"))
+ if err := ValidateParams(data.Params); err != nil {
+ return err
+ }
+
+ if err := validateSendingState(data.SendingState); err != nil {
+ return err
+ }
+
+ if data.NextRoleProposalId < 1 {
+ return errors.New("next role proposal ID must be positive")
+ }
+
+ for _, v := range data.RoleProposals {
+ if v.Id < 1 {
+ return errors.New("role proposal ID must be positive")
+ }
+ sdk.MustAccAddressFromBech32(v.Proposer)
+ sdk.MustAccAddressFromBech32(v.Target)
+ if err := IsValidRole(v.Role); err != nil {
+ return err
+ }
+ }
+
+ for _, v := range data.Votes {
+ if v.ProposalId < 1 {
+ return errors.New("role proposal ID must be positive")
+ }
+ sdk.MustAccAddressFromBech32(v.Voter)
+ if err := IsValidVoteOption(v.Option); err != nil {
+ return err
+ }
+ }
+
+ for _, v := range data.Roles {
+ sdk.MustAccAddressFromBech32(v.Address)
+ if err := IsValidRole(v.Role); err != nil {
+ return err
+ }
+ }
+
+ for _, v := range data.BridgeSwitches {
+ sdk.MustAccAddressFromBech32(v.Guardian)
+ if err := IsValidBridgeStatus(v.Status); err != nil {
+ return err
+ }
}
return nil
}
-func DefaultAuthority() sdk.AccAddress {
- return authtypes.NewModuleAddress(govtypes.ModuleName)
+func validateSendingState(state SendingState) error {
+ if state.NextSeq < 1 {
+ return errors.New("next sequence must be positive")
+ }
+
+ if state.NextSeq-1 != uint64(len(state.SeqToBlocknum)) {
+ return errors.New("sequence to blocknum mapping is invalid")
+ }
+
+ chkSeq := make(map[uint64]struct{})
+ for _, v := range state.SeqToBlocknum {
+ if v.Blocknum == 0 || v.Seq == 0 {
+ return errors.New("blocknum and seq must be positive")
+ }
+
+ if _, ok := chkSeq[v.Seq]; ok {
+ return errors.New("duplicate sequence")
+ }
+
+ chkSeq[v.Seq] = struct{}{}
+ }
+
+ return nil
}
diff --git a/x/fbridge/types/genesis.pb.go b/x/fbridge/types/genesis.pb.go
index 7b28e12f13..844eb131ae 100644
--- a/x/fbridge/types/genesis.pb.go
+++ b/x/fbridge/types/genesis.pb.go
@@ -31,6 +31,16 @@ type GenesisState struct {
SendingState SendingState `protobuf:"bytes,2,opt,name=sending_state,json=sendingState,proto3" json:"sending_state"`
// receiving_state defines status saved when receiving tokens from a counterpart chain
ReceivingState ReceivingState `protobuf:"bytes,3,opt,name=receiving_state,json=receivingState,proto3" json:"receiving_state"`
+ // next_role_proposal_id is the next role proposal ID to be used.
+ NextRoleProposalId uint64 `protobuf:"varint,4,opt,name=next_role_proposal_id,json=nextRoleProposalId,proto3" json:"next_role_proposal_id,omitempty"`
+ // role_proposals defines all the role proposals present at genesis.
+ RoleProposals []RoleProposal `protobuf:"bytes,5,rep,name=role_proposals,json=roleProposals,proto3" json:"role_proposals"`
+ // votes defines all the votes present for role proposals at genesis.
+ Votes []Vote `protobuf:"bytes,6,rep,name=votes,proto3" json:"votes"`
+ // roles defines all addresses assigned roles at genesis.
+ Roles []RolePair `protobuf:"bytes,7,rep,name=roles,proto3" json:"roles"`
+ // bridge_switches defines the status of whether each guardian has allowed the bridge to operate.
+ BridgeSwitches []BridgeSwitch `protobuf:"bytes,8,rep,name=bridge_switches,json=bridgeSwitches,proto3" json:"bridge_switches"`
}
func (m *GenesisState) Reset() { *m = GenesisState{} }
@@ -87,6 +97,41 @@ func (m *GenesisState) GetReceivingState() ReceivingState {
return ReceivingState{}
}
+func (m *GenesisState) GetNextRoleProposalId() uint64 {
+ if m != nil {
+ return m.NextRoleProposalId
+ }
+ return 0
+}
+
+func (m *GenesisState) GetRoleProposals() []RoleProposal {
+ if m != nil {
+ return m.RoleProposals
+ }
+ return nil
+}
+
+func (m *GenesisState) GetVotes() []Vote {
+ if m != nil {
+ return m.Votes
+ }
+ return nil
+}
+
+func (m *GenesisState) GetRoles() []RolePair {
+ if m != nil {
+ return m.Roles
+ }
+ return nil
+}
+
+func (m *GenesisState) GetBridgeSwitches() []BridgeSwitch {
+ if m != nil {
+ return m.BridgeSwitches
+ }
+ return nil
+}
+
type SendingState struct {
// the next sequence number of the bridge request (greatest sequence number + 1)
NextSeq uint64 `protobuf:"varint,1,opt,name=next_seq,json=nextSeq,proto3" json:"next_seq,omitempty"`
@@ -461,6 +506,59 @@ func (m *ConfirmedProvision) GetCommitment() string {
return ""
}
+type BridgeSwitch struct {
+ // the guardian address
+ Guardian string `protobuf:"bytes,1,opt,name=guardian,proto3" json:"guardian,omitempty"`
+ Status BridgeStatus `protobuf:"varint,2,opt,name=status,proto3,enum=lbm.fbridge.v1.BridgeStatus" json:"status,omitempty"`
+}
+
+func (m *BridgeSwitch) Reset() { *m = BridgeSwitch{} }
+func (m *BridgeSwitch) String() string { return proto.CompactTextString(m) }
+func (*BridgeSwitch) ProtoMessage() {}
+func (*BridgeSwitch) Descriptor() ([]byte, []int) {
+ return fileDescriptor_0fc3cc4535a29f6d, []int{8}
+}
+func (m *BridgeSwitch) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *BridgeSwitch) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ if deterministic {
+ return xxx_messageInfo_BridgeSwitch.Marshal(b, m, deterministic)
+ } else {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+ }
+}
+func (m *BridgeSwitch) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_BridgeSwitch.Merge(m, src)
+}
+func (m *BridgeSwitch) XXX_Size() int {
+ return m.Size()
+}
+func (m *BridgeSwitch) XXX_DiscardUnknown() {
+ xxx_messageInfo_BridgeSwitch.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_BridgeSwitch proto.InternalMessageInfo
+
+func (m *BridgeSwitch) GetGuardian() string {
+ if m != nil {
+ return m.Guardian
+ }
+ return ""
+}
+
+func (m *BridgeSwitch) GetStatus() BridgeStatus {
+ if m != nil {
+ return m.Status
+ }
+ return StatusEmpty
+}
+
func init() {
proto.RegisterType((*GenesisState)(nil), "lbm.fbridge.v1.GenesisState")
proto.RegisterType((*SendingState)(nil), "lbm.fbridge.v1.SendingState")
@@ -470,54 +568,64 @@ func init() {
proto.RegisterType((*Commitment)(nil), "lbm.fbridge.v1.Commitment")
proto.RegisterType((*Provision)(nil), "lbm.fbridge.v1.Provision")
proto.RegisterType((*ConfirmedProvision)(nil), "lbm.fbridge.v1.ConfirmedProvision")
+ proto.RegisterType((*BridgeSwitch)(nil), "lbm.fbridge.v1.BridgeSwitch")
}
func init() { proto.RegisterFile("lbm/fbridge/v1/genesis.proto", fileDescriptor_0fc3cc4535a29f6d) }
var fileDescriptor_0fc3cc4535a29f6d = []byte{
- // 666 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x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c6, 0x21, 0x4b, 0x26, 0xcf,
+ 0x69, 0xca, 0xc3, 0x0b, 0x8a, 0x27, 0x73, 0xbd, 0xf8, 0x88, 0x47, 0x6f, 0x26, 0x6f, 0xcb, 0xc7,
+ 0x52, 0x5c, 0x66, 0x84, 0x07, 0x6d, 0xf5, 0x50, 0x7e, 0xf2, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff,
+ 0xd3, 0xf5, 0xbb, 0x75, 0x8c, 0x07, 0x00, 0x00,
}
func (m *GenesisState) Marshal() (dAtA []byte, err error) {
@@ -540,6 +648,67 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) {
_ = i
var l int
_ = l
+ if len(m.BridgeSwitches) > 0 {
+ for iNdEx := len(m.BridgeSwitches) - 1; iNdEx >= 0; iNdEx-- {
+ {
+ size, err := m.BridgeSwitches[iNdEx].MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenesis(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0x42
+ }
+ }
+ if len(m.Roles) > 0 {
+ for iNdEx := len(m.Roles) - 1; iNdEx >= 0; iNdEx-- {
+ {
+ size, err := m.Roles[iNdEx].MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenesis(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0x3a
+ }
+ }
+ if len(m.Votes) > 0 {
+ for iNdEx := len(m.Votes) - 1; iNdEx >= 0; iNdEx-- {
+ {
+ size, err := m.Votes[iNdEx].MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenesis(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0x32
+ }
+ }
+ if len(m.RoleProposals) > 0 {
+ for iNdEx := len(m.RoleProposals) - 1; iNdEx >= 0; iNdEx-- {
+ {
+ size, err := m.RoleProposals[iNdEx].MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenesis(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0x2a
+ }
+ }
+ if m.NextRoleProposalId != 0 {
+ i = encodeVarintGenesis(dAtA, i, uint64(m.NextRoleProposalId))
+ i--
+ dAtA[i] = 0x20
+ }
{
size, err := m.ReceivingState.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
@@ -930,6 +1099,41 @@ func (m *ConfirmedProvision) MarshalToSizedBuffer(dAtA []byte) (int, error) {
return len(dAtA) - i, nil
}
+func (m *BridgeSwitch) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *BridgeSwitch) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *BridgeSwitch) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ if m.Status != 0 {
+ i = encodeVarintGenesis(dAtA, i, uint64(m.Status))
+ i--
+ dAtA[i] = 0x10
+ }
+ if len(m.Guardian) > 0 {
+ i -= len(m.Guardian)
+ copy(dAtA[i:], m.Guardian)
+ i = encodeVarintGenesis(dAtA, i, uint64(len(m.Guardian)))
+ i--
+ dAtA[i] = 0xa
+ }
+ return len(dAtA) - i, nil
+}
+
func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int {
offset -= sovGenesis(v)
base := offset
@@ -953,6 +1157,33 @@ func (m *GenesisState) Size() (n int) {
n += 1 + l + sovGenesis(uint64(l))
l = m.ReceivingState.Size()
n += 1 + l + sovGenesis(uint64(l))
+ if m.NextRoleProposalId != 0 {
+ n += 1 + sovGenesis(uint64(m.NextRoleProposalId))
+ }
+ if len(m.RoleProposals) > 0 {
+ for _, e := range m.RoleProposals {
+ l = e.Size()
+ n += 1 + l + sovGenesis(uint64(l))
+ }
+ }
+ if len(m.Votes) > 0 {
+ for _, e := range m.Votes {
+ l = e.Size()
+ n += 1 + l + sovGenesis(uint64(l))
+ }
+ }
+ if len(m.Roles) > 0 {
+ for _, e := range m.Roles {
+ l = e.Size()
+ n += 1 + l + sovGenesis(uint64(l))
+ }
+ }
+ if len(m.BridgeSwitches) > 0 {
+ for _, e := range m.BridgeSwitches {
+ l = e.Size()
+ n += 1 + l + sovGenesis(uint64(l))
+ }
+ }
return n
}
@@ -1111,6 +1342,22 @@ func (m *ConfirmedProvision) Size() (n int) {
return n
}
+func (m *BridgeSwitch) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ l = len(m.Guardian)
+ if l > 0 {
+ n += 1 + l + sovGenesis(uint64(l))
+ }
+ if m.Status != 0 {
+ n += 1 + sovGenesis(uint64(m.Status))
+ }
+ return n
+}
+
func sovGenesis(x uint64) (n int) {
return (math_bits.Len64(x|1) + 6) / 7
}
@@ -1245,6 +1492,161 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error {
return err
}
iNdEx = postIndex
+ case 4:
+ if wireType != 0 {
+ return fmt.Errorf("proto: wrong wireType = %d for field NextRoleProposalId", wireType)
+ }
+ m.NextRoleProposalId = 0
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenesis
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ m.NextRoleProposalId |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ case 5:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field RoleProposals", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenesis
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenesis
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenesis
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.RoleProposals = append(m.RoleProposals, RoleProposal{})
+ if err := m.RoleProposals[len(m.RoleProposals)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 6:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Votes", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenesis
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenesis
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenesis
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Votes = append(m.Votes, Vote{})
+ if err := m.Votes[len(m.Votes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 7:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Roles", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenesis
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenesis
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenesis
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Roles = append(m.Roles, RolePair{})
+ if err := m.Roles[len(m.Roles)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 8:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field BridgeSwitches", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenesis
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenesis
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenesis
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.BridgeSwitches = append(m.BridgeSwitches, BridgeSwitch{})
+ if err := m.BridgeSwitches[len(m.BridgeSwitches)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipGenesis(dAtA[iNdEx:])
@@ -2261,6 +2663,107 @@ func (m *ConfirmedProvision) Unmarshal(dAtA []byte) error {
}
return nil
}
+func (m *BridgeSwitch) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenesis
+ }
+ if iNdEx >= l {
+ return 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 fmt.Errorf("proto: BridgeSwitch: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: BridgeSwitch: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Guardian", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenesis
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenesis
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenesis
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Guardian = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 2:
+ if wireType != 0 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType)
+ }
+ m.Status = 0
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenesis
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ m.Status |= BridgeStatus(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenesis(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthGenesis
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
func skipGenesis(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
diff --git a/x/fbridge/types/keys.go b/x/fbridge/types/keys.go
index 714c3b4fcf..81653c6456 100644
--- a/x/fbridge/types/keys.go
+++ b/x/fbridge/types/keys.go
@@ -1,19 +1,52 @@
package types
-import "encoding/binary"
+import (
+ "encoding/binary"
+
+ sdk "github.com/Finschia/finschia-sdk/types"
+ "github.com/Finschia/finschia-sdk/types/address"
+ "github.com/Finschia/finschia-sdk/types/kv"
+)
const (
// ModuleName is the module name constant used in many places
ModuleName = "fbridge"
- // StoreKey is the store key string for distribution
+ // StoreKey is the store key string for fbridge
StoreKey = ModuleName
+
+ // MemStoreKey is the in-memory store key string for fbridge
+ MemStoreKey = "mem_" + StoreKey
)
+// - 0x01: params
+// - 0x02: next sequence number for bridge sending
+// - 0x03: block number of sequence
+//
+// - 0x10: next proposal ID
+// 0x11: proposal
+// 0x12: vote
+// - 0x13: role
+// - 0x14: bridge switch
+//
+// - 0xF0: memstore initialized
+// - 0xF1: role metadata
+// - 0xF2: bridge status
+
var (
KeyParams = []byte{0x01} // key for fbridge module params
KeyNextSeqSend = []byte{0x02} // key for the next bridge send sequence
KeySeqToBlocknumPrefix = []byte{0x03} // key prefix for the sequence to block number mapping
+
+ KeyNextProposalID = []byte{0x10} // key for the next role proposal ID
+ KeyProposalPrefix = []byte{0x11} // key prefix for the role proposal
+ KeyProposalVotePrefix = []byte{0x12} // key prefix for the role proposal vote
+ KeyRolePrefix = []byte{0x13} // key prefix for the role of an address
+ KeyBridgeSwitchPrefix = []byte{0x14} // key for the switch to halt
+
+ KeyMemInitialized = []byte{0xF0}
+ KeyMemRoleMetadata = []byte{0xF1} // key for the role metadata
+ KeyMemBridgeInactiveCounter = []byte{0xF2} // key for the bridge inactive status
)
func SeqToBlocknumKey(seq uint64) []byte {
@@ -21,3 +54,54 @@ func SeqToBlocknumKey(seq uint64) []byte {
binary.BigEndian.PutUint64(bz, seq)
return append(KeySeqToBlocknumPrefix, bz...)
}
+
+// GetProposalIDBytes returns the byte representation of the proposalID
+func GetProposalIDBytes(proposalID uint64) []byte {
+ bz := make([]byte, 8)
+ binary.BigEndian.PutUint64(bz, proposalID)
+ return bz
+}
+
+// ProposalKey key of a specific role proposal
+func ProposalKey(proposalID uint64) []byte {
+ return append(KeyProposalPrefix, GetProposalIDBytes(proposalID)...)
+}
+
+// VotesKey gets the first part of the votes key based on the proposalID
+func VotesKey(proposalID uint64) []byte {
+ return append(KeyProposalVotePrefix, GetProposalIDBytes(proposalID)...)
+}
+
+// VoterVoteKey key of a specific vote from the store
+func VoterVoteKey(proposalID uint64, voterAddr sdk.AccAddress) []byte {
+ return append(VotesKey(proposalID), address.MustLengthPrefix(voterAddr.Bytes())...)
+}
+
+// SplitVoterVoteKey split the voter key and returns the proposal id and voter address
+func SplitVoterVoteKey(key []byte) (uint64, sdk.AccAddress) {
+ kv.AssertKeyAtLeastLength(key, 11)
+ proposalID := binary.BigEndian.Uint64(key[1:9])
+ voter := sdk.AccAddress(key[10:])
+ return proposalID, voter
+}
+
+// RoleKey key of a specific role of the address from the store
+func RoleKey(target sdk.AccAddress) []byte {
+ return append(KeyRolePrefix, address.MustLengthPrefix(target.Bytes())...)
+}
+
+// SplitRoleKey split the role key and returns the address
+func SplitRoleKey(key []byte) sdk.AccAddress {
+ kv.AssertKeyAtLeastLength(key, 3)
+ return key[2:]
+}
+
+func BridgeSwitchKey(guardian sdk.AccAddress) []byte {
+ return append(KeyBridgeSwitchPrefix, address.MustLengthPrefix(guardian.Bytes())...)
+}
+
+// SplitBridgeSwitchKey split the bridge switch key and returns the guardian address
+func SplitBridgeSwitchKey(key []byte) sdk.AccAddress {
+ kv.AssertKeyAtLeastLength(key, 3)
+ return key[2:]
+}
diff --git a/x/fbridge/types/msgs.go b/x/fbridge/types/msgs.go
index fce2320548..979176c073 100644
--- a/x/fbridge/types/msgs.go
+++ b/x/fbridge/types/msgs.go
@@ -12,8 +12,7 @@ var (
_ sdk.Msg = &MsgClaim{}
_ sdk.Msg = &MsgSuggestRole{}
_ sdk.Msg = &MsgAddVoteForRole{}
- _ sdk.Msg = &MsgHalt{}
- _ sdk.Msg = &MsgResume{}
+ _ sdk.Msg = &MsgSetBridgeStatus{}
)
func (m MsgTransfer) ValidateBasic() error { return nil }
@@ -106,22 +105,12 @@ func (m MsgAddVoteForRole) GetSignBytes() []byte {
return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&m))
}
-func (m MsgHalt) ValidateBasic() error { return nil }
+func (m MsgSetBridgeStatus) ValidateBasic() error { return nil }
-func (m MsgHalt) GetSigners() []sdk.AccAddress {
+func (m MsgSetBridgeStatus) GetSigners() []sdk.AccAddress {
return []sdk.AccAddress{sdk.MustAccAddressFromBech32(m.Guardian)}
}
-func (m MsgHalt) GetSignBytes() []byte {
- return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&m))
-}
-
-func (m MsgResume) ValidateBasic() error { return nil }
-
-func (m MsgResume) GetSigners() []sdk.AccAddress {
- return []sdk.AccAddress{sdk.MustAccAddressFromBech32(m.From)}
-}
-
-func (m MsgResume) GetSignBytes() []byte {
+func (m MsgSetBridgeStatus) GetSignBytes() []byte {
return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&m))
}
diff --git a/x/fbridge/types/params.go b/x/fbridge/types/params.go
index ab1254f4c2..3ef148d1e8 100644
--- a/x/fbridge/types/params.go
+++ b/x/fbridge/types/params.go
@@ -1 +1,65 @@
package types
+
+import (
+ "time"
+
+ sdkerrors "github.com/Finschia/finschia-sdk/types/errors"
+)
+
+func DefaultParams() Params {
+ return Params{
+ GuardianTrustLevel: Fraction{Numerator: 2, Denominator: 3},
+ OperatorTrustLevel: Fraction{Numerator: 2, Denominator: 3},
+ JudgeTrustLevel: Fraction{Numerator: 1, Denominator: 1},
+ ProposalPeriod: uint64(time.Minute * 60),
+ TimelockPeriod: uint64(time.Hour * 24),
+ }
+}
+
+func ValidateParams(params Params) error {
+ if err := ValidateTrustLevel(params.GuardianTrustLevel); err != nil {
+ return sdkerrors.ErrInvalidRequest.Wrap("guardian trust level: " + err.Error())
+ }
+
+ if err := ValidateTrustLevel(params.OperatorTrustLevel); err != nil {
+ return sdkerrors.ErrInvalidRequest.Wrap("operator trust level: " + err.Error())
+ }
+
+ if err := ValidateTrustLevel(params.JudgeTrustLevel); err != nil {
+ return sdkerrors.ErrInvalidRequest.Wrap("judge trust level: " + err.Error())
+ }
+
+ if params.ProposalPeriod == 0 {
+ return sdkerrors.ErrInvalidRequest.Wrap("proposal period cannot be 0")
+ }
+
+ if params.TimelockPeriod == 0 {
+ return sdkerrors.ErrInvalidRequest.Wrap("timelock period cannot be 0")
+ }
+
+ return nil
+}
+
+func CheckTrustLevelThreshold(total, current uint64, trustLevel Fraction) bool {
+ if err := ValidateTrustLevel(trustLevel); err != nil {
+ panic(err)
+ }
+
+ if total*trustLevel.Numerator <= current*trustLevel.Denominator &&
+ total > 0 &&
+ current <= total {
+ return true
+ }
+
+ return false
+}
+
+func ValidateTrustLevel(trustLevel Fraction) error {
+ if trustLevel.Denominator < 1 || trustLevel.Numerator < 1 {
+ return sdkerrors.ErrInvalidRequest.Wrap("trust level must be positive")
+ } else if trustLevel.Denominator < trustLevel.Numerator {
+ return sdkerrors.ErrInvalidRequest.Wrap("trust level denominator must be greater than or equal to the numerator")
+ }
+
+ return nil
+}
diff --git a/x/fbridge/types/params_test.go b/x/fbridge/types/params_test.go
new file mode 100644
index 0000000000..025ee7bbd0
--- /dev/null
+++ b/x/fbridge/types/params_test.go
@@ -0,0 +1,62 @@
+package types_test
+
+import (
+ "testing"
+
+ "github.com/stretchr/testify/require"
+
+ "github.com/Finschia/finschia-sdk/x/fbridge/types"
+)
+
+func TestCheckTrustLevelThreshold(t *testing.T) {
+ tcs := map[string]struct {
+ total uint64
+ current uint64
+ trustLevel types.Fraction
+ isPanic bool
+ isValid bool
+ }{
+ "meet the trust level": {
+ current: 3,
+ total: 4,
+ trustLevel: types.Fraction{Numerator: 2, Denominator: 3},
+ isValid: true,
+ },
+ "not meet the trust level": {
+ current: 1,
+ total: 2,
+ trustLevel: types.Fraction{Numerator: 2, Denominator: 3},
+ isValid: false,
+ },
+ "total is 0": {
+ total: 0,
+ current: 3,
+ trustLevel: types.Fraction{Numerator: 2, Denominator: 3},
+ isValid: false,
+ },
+ "invalid trust level - 1": {
+ total: 10,
+ current: 8,
+ trustLevel: types.Fraction{Numerator: 3, Denominator: 2},
+ isPanic: true,
+ },
+ "invalid trust level - 2": {
+ total: 10,
+ current: 8,
+ trustLevel: types.Fraction{Numerator: 3, Denominator: 0},
+ isPanic: true,
+ },
+ }
+
+ for name, tc := range tcs {
+ t.Run(name, func(t *testing.T) {
+ if tc.isPanic {
+ require.Panics(t, func() { types.CheckTrustLevelThreshold(tc.total, tc.current, tc.trustLevel) })
+ } else if tc.isValid {
+ require.True(t, types.CheckTrustLevelThreshold(tc.total, tc.current, tc.trustLevel))
+ } else {
+ require.False(t, types.CheckTrustLevelThreshold(tc.total, tc.current, tc.trustLevel))
+ }
+ })
+ }
+}
diff --git a/x/fbridge/types/query.pb.go b/x/fbridge/types/query.pb.go
index 7583ca187f..e0aa3d380a 100644
--- a/x/fbridge/types/query.pb.go
+++ b/x/fbridge/types/query.pb.go
@@ -846,21 +846,23 @@ func (m *QueryCommitmentsResponse) GetCommitments() []string {
return nil
}
-type QueryGuardiansRequest struct {
+type QueryMembersRequest struct {
+ // the role name (guardian, operator, judge)
+ Role string `protobuf:"bytes,1,opt,name=role,proto3" json:"role,omitempty"`
}
-func (m *QueryGuardiansRequest) Reset() { *m = QueryGuardiansRequest{} }
-func (m *QueryGuardiansRequest) String() string { return proto.CompactTextString(m) }
-func (*QueryGuardiansRequest) ProtoMessage() {}
-func (*QueryGuardiansRequest) Descriptor() ([]byte, []int) {
+func (m *QueryMembersRequest) Reset() { *m = QueryMembersRequest{} }
+func (m *QueryMembersRequest) String() string { return proto.CompactTextString(m) }
+func (*QueryMembersRequest) ProtoMessage() {}
+func (*QueryMembersRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_5e7780f9db9d346e, []int{18}
}
-func (m *QueryGuardiansRequest) XXX_Unmarshal(b []byte) error {
+func (m *QueryMembersRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-func (m *QueryGuardiansRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+func (m *QueryMembersRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
- return xxx_messageInfo_QueryGuardiansRequest.Marshal(b, m, deterministic)
+ return xxx_messageInfo_QueryMembersRequest.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
@@ -870,34 +872,41 @@ func (m *QueryGuardiansRequest) XXX_Marshal(b []byte, deterministic bool) ([]byt
return b[:n], nil
}
}
-func (m *QueryGuardiansRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_QueryGuardiansRequest.Merge(m, src)
+func (m *QueryMembersRequest) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_QueryMembersRequest.Merge(m, src)
}
-func (m *QueryGuardiansRequest) XXX_Size() int {
+func (m *QueryMembersRequest) XXX_Size() int {
return m.Size()
}
-func (m *QueryGuardiansRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_QueryGuardiansRequest.DiscardUnknown(m)
+func (m *QueryMembersRequest) XXX_DiscardUnknown() {
+ xxx_messageInfo_QueryMembersRequest.DiscardUnknown(m)
}
-var xxx_messageInfo_QueryGuardiansRequest proto.InternalMessageInfo
+var xxx_messageInfo_QueryMembersRequest proto.InternalMessageInfo
-type QueryGuardiansResponse struct {
- Guardians []string `protobuf:"bytes,1,rep,name=guardians,proto3" json:"guardians,omitempty"`
+func (m *QueryMembersRequest) GetRole() string {
+ if m != nil {
+ return m.Role
+ }
+ return ""
+}
+
+type QueryMembersResponse struct {
+ Members []string `protobuf:"bytes,1,rep,name=members,proto3" json:"members,omitempty"`
}
-func (m *QueryGuardiansResponse) Reset() { *m = QueryGuardiansResponse{} }
-func (m *QueryGuardiansResponse) String() string { return proto.CompactTextString(m) }
-func (*QueryGuardiansResponse) ProtoMessage() {}
-func (*QueryGuardiansResponse) Descriptor() ([]byte, []int) {
+func (m *QueryMembersResponse) Reset() { *m = QueryMembersResponse{} }
+func (m *QueryMembersResponse) String() string { return proto.CompactTextString(m) }
+func (*QueryMembersResponse) ProtoMessage() {}
+func (*QueryMembersResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_5e7780f9db9d346e, []int{19}
}
-func (m *QueryGuardiansResponse) XXX_Unmarshal(b []byte) error {
+func (m *QueryMembersResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-func (m *QueryGuardiansResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+func (m *QueryMembersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
- return xxx_messageInfo_QueryGuardiansResponse.Marshal(b, m, deterministic)
+ return xxx_messageInfo_QueryMembersResponse.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
@@ -907,77 +916,41 @@ func (m *QueryGuardiansResponse) XXX_Marshal(b []byte, deterministic bool) ([]by
return b[:n], nil
}
}
-func (m *QueryGuardiansResponse) XXX_Merge(src proto.Message) {
- xxx_messageInfo_QueryGuardiansResponse.Merge(m, src)
+func (m *QueryMembersResponse) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_QueryMembersResponse.Merge(m, src)
}
-func (m *QueryGuardiansResponse) XXX_Size() int {
+func (m *QueryMembersResponse) XXX_Size() int {
return m.Size()
}
-func (m *QueryGuardiansResponse) XXX_DiscardUnknown() {
- xxx_messageInfo_QueryGuardiansResponse.DiscardUnknown(m)
+func (m *QueryMembersResponse) XXX_DiscardUnknown() {
+ xxx_messageInfo_QueryMembersResponse.DiscardUnknown(m)
}
-var xxx_messageInfo_QueryGuardiansResponse proto.InternalMessageInfo
+var xxx_messageInfo_QueryMembersResponse proto.InternalMessageInfo
-func (m *QueryGuardiansResponse) GetGuardians() []string {
+func (m *QueryMembersResponse) GetMembers() []string {
if m != nil {
- return m.Guardians
+ return m.Members
}
return nil
}
-type QueryOperatorsRequest struct {
+type QueryMemberRequest struct {
+ Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
}
-func (m *QueryOperatorsRequest) Reset() { *m = QueryOperatorsRequest{} }
-func (m *QueryOperatorsRequest) String() string { return proto.CompactTextString(m) }
-func (*QueryOperatorsRequest) ProtoMessage() {}
-func (*QueryOperatorsRequest) Descriptor() ([]byte, []int) {
+func (m *QueryMemberRequest) Reset() { *m = QueryMemberRequest{} }
+func (m *QueryMemberRequest) String() string { return proto.CompactTextString(m) }
+func (*QueryMemberRequest) ProtoMessage() {}
+func (*QueryMemberRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_5e7780f9db9d346e, []int{20}
}
-func (m *QueryOperatorsRequest) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *QueryOperatorsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_QueryOperatorsRequest.Marshal(b, m, deterministic)
- } else {
- b = b[:cap(b)]
- n, err := m.MarshalToSizedBuffer(b)
- if err != nil {
- return nil, err
- }
- return b[:n], nil
- }
-}
-func (m *QueryOperatorsRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_QueryOperatorsRequest.Merge(m, src)
-}
-func (m *QueryOperatorsRequest) XXX_Size() int {
- return m.Size()
-}
-func (m *QueryOperatorsRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_QueryOperatorsRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_QueryOperatorsRequest proto.InternalMessageInfo
-
-type QueryOperatorsResponse struct {
- Operators []string `protobuf:"bytes,1,rep,name=operators,proto3" json:"operators,omitempty"`
-}
-
-func (m *QueryOperatorsResponse) Reset() { *m = QueryOperatorsResponse{} }
-func (m *QueryOperatorsResponse) String() string { return proto.CompactTextString(m) }
-func (*QueryOperatorsResponse) ProtoMessage() {}
-func (*QueryOperatorsResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_5e7780f9db9d346e, []int{21}
-}
-func (m *QueryOperatorsResponse) XXX_Unmarshal(b []byte) error {
+func (m *QueryMemberRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-func (m *QueryOperatorsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+func (m *QueryMemberRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
- return xxx_messageInfo_QueryOperatorsResponse.Marshal(b, m, deterministic)
+ return xxx_messageInfo_QueryMemberRequest.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
@@ -987,77 +960,41 @@ func (m *QueryOperatorsResponse) XXX_Marshal(b []byte, deterministic bool) ([]by
return b[:n], nil
}
}
-func (m *QueryOperatorsResponse) XXX_Merge(src proto.Message) {
- xxx_messageInfo_QueryOperatorsResponse.Merge(m, src)
+func (m *QueryMemberRequest) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_QueryMemberRequest.Merge(m, src)
}
-func (m *QueryOperatorsResponse) XXX_Size() int {
+func (m *QueryMemberRequest) XXX_Size() int {
return m.Size()
}
-func (m *QueryOperatorsResponse) XXX_DiscardUnknown() {
- xxx_messageInfo_QueryOperatorsResponse.DiscardUnknown(m)
+func (m *QueryMemberRequest) XXX_DiscardUnknown() {
+ xxx_messageInfo_QueryMemberRequest.DiscardUnknown(m)
}
-var xxx_messageInfo_QueryOperatorsResponse proto.InternalMessageInfo
+var xxx_messageInfo_QueryMemberRequest proto.InternalMessageInfo
-func (m *QueryOperatorsResponse) GetOperators() []string {
+func (m *QueryMemberRequest) GetAddress() string {
if m != nil {
- return m.Operators
- }
- return nil
-}
-
-type QueryJudgesRequest struct {
-}
-
-func (m *QueryJudgesRequest) Reset() { *m = QueryJudgesRequest{} }
-func (m *QueryJudgesRequest) String() string { return proto.CompactTextString(m) }
-func (*QueryJudgesRequest) ProtoMessage() {}
-func (*QueryJudgesRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_5e7780f9db9d346e, []int{22}
-}
-func (m *QueryJudgesRequest) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *QueryJudgesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_QueryJudgesRequest.Marshal(b, m, deterministic)
- } else {
- b = b[:cap(b)]
- n, err := m.MarshalToSizedBuffer(b)
- if err != nil {
- return nil, err
- }
- return b[:n], nil
+ return m.Address
}
-}
-func (m *QueryJudgesRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_QueryJudgesRequest.Merge(m, src)
-}
-func (m *QueryJudgesRequest) XXX_Size() int {
- return m.Size()
-}
-func (m *QueryJudgesRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_QueryJudgesRequest.DiscardUnknown(m)
+ return ""
}
-var xxx_messageInfo_QueryJudgesRequest proto.InternalMessageInfo
-
-type QueryJudgesResponse struct {
- Judges []string `protobuf:"bytes,1,rep,name=judges,proto3" json:"judges,omitempty"`
+type QueryMemberResponse struct {
+ Role string `protobuf:"bytes,1,opt,name=role,proto3" json:"role,omitempty"`
}
-func (m *QueryJudgesResponse) Reset() { *m = QueryJudgesResponse{} }
-func (m *QueryJudgesResponse) String() string { return proto.CompactTextString(m) }
-func (*QueryJudgesResponse) ProtoMessage() {}
-func (*QueryJudgesResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_5e7780f9db9d346e, []int{23}
+func (m *QueryMemberResponse) Reset() { *m = QueryMemberResponse{} }
+func (m *QueryMemberResponse) String() string { return proto.CompactTextString(m) }
+func (*QueryMemberResponse) ProtoMessage() {}
+func (*QueryMemberResponse) Descriptor() ([]byte, []int) {
+ return fileDescriptor_5e7780f9db9d346e, []int{21}
}
-func (m *QueryJudgesResponse) XXX_Unmarshal(b []byte) error {
+func (m *QueryMemberResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-func (m *QueryJudgesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+func (m *QueryMemberResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
- return xxx_messageInfo_QueryJudgesResponse.Marshal(b, m, deterministic)
+ return xxx_messageInfo_QueryMemberResponse.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
@@ -1067,23 +1004,23 @@ func (m *QueryJudgesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte,
return b[:n], nil
}
}
-func (m *QueryJudgesResponse) XXX_Merge(src proto.Message) {
- xxx_messageInfo_QueryJudgesResponse.Merge(m, src)
+func (m *QueryMemberResponse) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_QueryMemberResponse.Merge(m, src)
}
-func (m *QueryJudgesResponse) XXX_Size() int {
+func (m *QueryMemberResponse) XXX_Size() int {
return m.Size()
}
-func (m *QueryJudgesResponse) XXX_DiscardUnknown() {
- xxx_messageInfo_QueryJudgesResponse.DiscardUnknown(m)
+func (m *QueryMemberResponse) XXX_DiscardUnknown() {
+ xxx_messageInfo_QueryMemberResponse.DiscardUnknown(m)
}
-var xxx_messageInfo_QueryJudgesResponse proto.InternalMessageInfo
+var xxx_messageInfo_QueryMemberResponse proto.InternalMessageInfo
-func (m *QueryJudgesResponse) GetJudges() []string {
+func (m *QueryMemberResponse) GetRole() string {
if m != nil {
- return m.Judges
+ return m.Role
}
- return nil
+ return ""
}
type QueryProposalsRequest struct {
@@ -1095,7 +1032,7 @@ func (m *QueryProposalsRequest) Reset() { *m = QueryProposalsRequest{} }
func (m *QueryProposalsRequest) String() string { return proto.CompactTextString(m) }
func (*QueryProposalsRequest) ProtoMessage() {}
func (*QueryProposalsRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_5e7780f9db9d346e, []int{24}
+ return fileDescriptor_5e7780f9db9d346e, []int{22}
}
func (m *QueryProposalsRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -1132,14 +1069,16 @@ func (m *QueryProposalsRequest) GetPagination() *query.PageRequest {
}
type QueryProposalsResponse struct {
- Proposals []*RoleProposal `protobuf:"bytes,1,rep,name=proposals,proto3" json:"proposals,omitempty"`
+ Proposals []RoleProposal `protobuf:"bytes,1,rep,name=proposals,proto3" json:"proposals"`
+ // pagination defines an pagination for the response.
+ Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"`
}
func (m *QueryProposalsResponse) Reset() { *m = QueryProposalsResponse{} }
func (m *QueryProposalsResponse) String() string { return proto.CompactTextString(m) }
func (*QueryProposalsResponse) ProtoMessage() {}
func (*QueryProposalsResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_5e7780f9db9d346e, []int{25}
+ return fileDescriptor_5e7780f9db9d346e, []int{23}
}
func (m *QueryProposalsResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -1168,23 +1107,30 @@ func (m *QueryProposalsResponse) XXX_DiscardUnknown() {
var xxx_messageInfo_QueryProposalsResponse proto.InternalMessageInfo
-func (m *QueryProposalsResponse) GetProposals() []*RoleProposal {
+func (m *QueryProposalsResponse) GetProposals() []RoleProposal {
if m != nil {
return m.Proposals
}
return nil
}
+func (m *QueryProposalsResponse) GetPagination() *query.PageResponse {
+ if m != nil {
+ return m.Pagination
+ }
+ return nil
+}
+
type QueryProposalRequest struct {
// the proposal id
- ProposalId string `protobuf:"bytes,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"`
+ ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"`
}
func (m *QueryProposalRequest) Reset() { *m = QueryProposalRequest{} }
func (m *QueryProposalRequest) String() string { return proto.CompactTextString(m) }
func (*QueryProposalRequest) ProtoMessage() {}
func (*QueryProposalRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_5e7780f9db9d346e, []int{26}
+ return fileDescriptor_5e7780f9db9d346e, []int{24}
}
func (m *QueryProposalRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -1213,22 +1159,22 @@ func (m *QueryProposalRequest) XXX_DiscardUnknown() {
var xxx_messageInfo_QueryProposalRequest proto.InternalMessageInfo
-func (m *QueryProposalRequest) GetProposalId() string {
+func (m *QueryProposalRequest) GetProposalId() uint64 {
if m != nil {
return m.ProposalId
}
- return ""
+ return 0
}
type QueryProposalResponse struct {
- Proposal *RoleProposal `protobuf:"bytes,1,opt,name=proposal,proto3" json:"proposal,omitempty"`
+ Proposal RoleProposal `protobuf:"bytes,1,opt,name=proposal,proto3" json:"proposal"`
}
func (m *QueryProposalResponse) Reset() { *m = QueryProposalResponse{} }
func (m *QueryProposalResponse) String() string { return proto.CompactTextString(m) }
func (*QueryProposalResponse) ProtoMessage() {}
func (*QueryProposalResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_5e7780f9db9d346e, []int{27}
+ return fileDescriptor_5e7780f9db9d346e, []int{25}
}
func (m *QueryProposalResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -1257,13 +1203,290 @@ func (m *QueryProposalResponse) XXX_DiscardUnknown() {
var xxx_messageInfo_QueryProposalResponse proto.InternalMessageInfo
-func (m *QueryProposalResponse) GetProposal() *RoleProposal {
+func (m *QueryProposalResponse) GetProposal() RoleProposal {
if m != nil {
return m.Proposal
}
+ return RoleProposal{}
+}
+
+type QueryVoteRequest struct {
+ // proposal_id defines the unique id of the proposal.
+ ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"`
+ // voter defines the oter address for the proposals.
+ Voter string `protobuf:"bytes,2,opt,name=voter,proto3" json:"voter,omitempty"`
+}
+
+func (m *QueryVoteRequest) Reset() { *m = QueryVoteRequest{} }
+func (m *QueryVoteRequest) String() string { return proto.CompactTextString(m) }
+func (*QueryVoteRequest) ProtoMessage() {}
+func (*QueryVoteRequest) Descriptor() ([]byte, []int) {
+ return fileDescriptor_5e7780f9db9d346e, []int{26}
+}
+func (m *QueryVoteRequest) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *QueryVoteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ if deterministic {
+ return xxx_messageInfo_QueryVoteRequest.Marshal(b, m, deterministic)
+ } else {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+ }
+}
+func (m *QueryVoteRequest) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_QueryVoteRequest.Merge(m, src)
+}
+func (m *QueryVoteRequest) XXX_Size() int {
+ return m.Size()
+}
+func (m *QueryVoteRequest) XXX_DiscardUnknown() {
+ xxx_messageInfo_QueryVoteRequest.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_QueryVoteRequest proto.InternalMessageInfo
+
+func (m *QueryVoteRequest) GetProposalId() uint64 {
+ if m != nil {
+ return m.ProposalId
+ }
+ return 0
+}
+
+func (m *QueryVoteRequest) GetVoter() string {
+ if m != nil {
+ return m.Voter
+ }
+ return ""
+}
+
+type QueryVoteResponse struct {
+ // vote defined the queried vote.
+ Vote Vote `protobuf:"bytes,1,opt,name=vote,proto3" json:"vote"`
+}
+
+func (m *QueryVoteResponse) Reset() { *m = QueryVoteResponse{} }
+func (m *QueryVoteResponse) String() string { return proto.CompactTextString(m) }
+func (*QueryVoteResponse) ProtoMessage() {}
+func (*QueryVoteResponse) Descriptor() ([]byte, []int) {
+ return fileDescriptor_5e7780f9db9d346e, []int{27}
+}
+func (m *QueryVoteResponse) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *QueryVoteResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ if deterministic {
+ return xxx_messageInfo_QueryVoteResponse.Marshal(b, m, deterministic)
+ } else {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+ }
+}
+func (m *QueryVoteResponse) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_QueryVoteResponse.Merge(m, src)
+}
+func (m *QueryVoteResponse) XXX_Size() int {
+ return m.Size()
+}
+func (m *QueryVoteResponse) XXX_DiscardUnknown() {
+ xxx_messageInfo_QueryVoteResponse.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_QueryVoteResponse proto.InternalMessageInfo
+
+func (m *QueryVoteResponse) GetVote() Vote {
+ if m != nil {
+ return m.Vote
+ }
+ return Vote{}
+}
+
+type QueryVotesRequest struct {
+ // proposal_id defines the unique id of the proposal.
+ ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"`
+}
+
+func (m *QueryVotesRequest) Reset() { *m = QueryVotesRequest{} }
+func (m *QueryVotesRequest) String() string { return proto.CompactTextString(m) }
+func (*QueryVotesRequest) ProtoMessage() {}
+func (*QueryVotesRequest) Descriptor() ([]byte, []int) {
+ return fileDescriptor_5e7780f9db9d346e, []int{28}
+}
+func (m *QueryVotesRequest) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *QueryVotesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ if deterministic {
+ return xxx_messageInfo_QueryVotesRequest.Marshal(b, m, deterministic)
+ } else {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+ }
+}
+func (m *QueryVotesRequest) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_QueryVotesRequest.Merge(m, src)
+}
+func (m *QueryVotesRequest) XXX_Size() int {
+ return m.Size()
+}
+func (m *QueryVotesRequest) XXX_DiscardUnknown() {
+ xxx_messageInfo_QueryVotesRequest.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_QueryVotesRequest proto.InternalMessageInfo
+
+func (m *QueryVotesRequest) GetProposalId() uint64 {
+ if m != nil {
+ return m.ProposalId
+ }
+ return 0
+}
+
+type QueryVotesResponse struct {
+ // votes defined the queried votes.
+ Votes []Vote `protobuf:"bytes,1,rep,name=votes,proto3" json:"votes"`
+}
+
+func (m *QueryVotesResponse) Reset() { *m = QueryVotesResponse{} }
+func (m *QueryVotesResponse) String() string { return proto.CompactTextString(m) }
+func (*QueryVotesResponse) ProtoMessage() {}
+func (*QueryVotesResponse) Descriptor() ([]byte, []int) {
+ return fileDescriptor_5e7780f9db9d346e, []int{29}
+}
+func (m *QueryVotesResponse) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *QueryVotesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ if deterministic {
+ return xxx_messageInfo_QueryVotesResponse.Marshal(b, m, deterministic)
+ } else {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+ }
+}
+func (m *QueryVotesResponse) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_QueryVotesResponse.Merge(m, src)
+}
+func (m *QueryVotesResponse) XXX_Size() int {
+ return m.Size()
+}
+func (m *QueryVotesResponse) XXX_DiscardUnknown() {
+ xxx_messageInfo_QueryVotesResponse.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_QueryVotesResponse proto.InternalMessageInfo
+
+func (m *QueryVotesResponse) GetVotes() []Vote {
+ if m != nil {
+ return m.Votes
+ }
return nil
}
+type QueryBridgeStatusRequest struct {
+}
+
+func (m *QueryBridgeStatusRequest) Reset() { *m = QueryBridgeStatusRequest{} }
+func (m *QueryBridgeStatusRequest) String() string { return proto.CompactTextString(m) }
+func (*QueryBridgeStatusRequest) ProtoMessage() {}
+func (*QueryBridgeStatusRequest) Descriptor() ([]byte, []int) {
+ return fileDescriptor_5e7780f9db9d346e, []int{30}
+}
+func (m *QueryBridgeStatusRequest) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *QueryBridgeStatusRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ if deterministic {
+ return xxx_messageInfo_QueryBridgeStatusRequest.Marshal(b, m, deterministic)
+ } else {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+ }
+}
+func (m *QueryBridgeStatusRequest) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_QueryBridgeStatusRequest.Merge(m, src)
+}
+func (m *QueryBridgeStatusRequest) XXX_Size() int {
+ return m.Size()
+}
+func (m *QueryBridgeStatusRequest) XXX_DiscardUnknown() {
+ xxx_messageInfo_QueryBridgeStatusRequest.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_QueryBridgeStatusRequest proto.InternalMessageInfo
+
+type QueryBridgeStatusResponse struct {
+ Status BridgeStatus `protobuf:"varint,1,opt,name=status,proto3,enum=lbm.fbridge.v1.BridgeStatus" json:"status,omitempty"`
+ Metadata BridgeStatusMetadata `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata"`
+}
+
+func (m *QueryBridgeStatusResponse) Reset() { *m = QueryBridgeStatusResponse{} }
+func (m *QueryBridgeStatusResponse) String() string { return proto.CompactTextString(m) }
+func (*QueryBridgeStatusResponse) ProtoMessage() {}
+func (*QueryBridgeStatusResponse) Descriptor() ([]byte, []int) {
+ return fileDescriptor_5e7780f9db9d346e, []int{31}
+}
+func (m *QueryBridgeStatusResponse) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *QueryBridgeStatusResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ if deterministic {
+ return xxx_messageInfo_QueryBridgeStatusResponse.Marshal(b, m, deterministic)
+ } else {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+ }
+}
+func (m *QueryBridgeStatusResponse) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_QueryBridgeStatusResponse.Merge(m, src)
+}
+func (m *QueryBridgeStatusResponse) XXX_Size() int {
+ return m.Size()
+}
+func (m *QueryBridgeStatusResponse) XXX_DiscardUnknown() {
+ xxx_messageInfo_QueryBridgeStatusResponse.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_QueryBridgeStatusResponse proto.InternalMessageInfo
+
+func (m *QueryBridgeStatusResponse) GetStatus() BridgeStatus {
+ if m != nil {
+ return m.Status
+ }
+ return StatusEmpty
+}
+
+func (m *QueryBridgeStatusResponse) GetMetadata() BridgeStatusMetadata {
+ if m != nil {
+ return m.Metadata
+ }
+ return BridgeStatusMetadata{}
+}
+
func init() {
proto.RegisterType((*QueryParamsRequest)(nil), "lbm.fbridge.v1.QueryParamsRequest")
proto.RegisterType((*QueryParamsResponse)(nil), "lbm.fbridge.v1.QueryParamsResponse")
@@ -1283,99 +1506,115 @@ func init() {
proto.RegisterType((*QueryConfirmedProvisionResponse)(nil), "lbm.fbridge.v1.QueryConfirmedProvisionResponse")
proto.RegisterType((*QueryCommitmentsRequest)(nil), "lbm.fbridge.v1.QueryCommitmentsRequest")
proto.RegisterType((*QueryCommitmentsResponse)(nil), "lbm.fbridge.v1.QueryCommitmentsResponse")
- proto.RegisterType((*QueryGuardiansRequest)(nil), "lbm.fbridge.v1.QueryGuardiansRequest")
- proto.RegisterType((*QueryGuardiansResponse)(nil), "lbm.fbridge.v1.QueryGuardiansResponse")
- proto.RegisterType((*QueryOperatorsRequest)(nil), "lbm.fbridge.v1.QueryOperatorsRequest")
- proto.RegisterType((*QueryOperatorsResponse)(nil), "lbm.fbridge.v1.QueryOperatorsResponse")
- proto.RegisterType((*QueryJudgesRequest)(nil), "lbm.fbridge.v1.QueryJudgesRequest")
- proto.RegisterType((*QueryJudgesResponse)(nil), "lbm.fbridge.v1.QueryJudgesResponse")
+ proto.RegisterType((*QueryMembersRequest)(nil), "lbm.fbridge.v1.QueryMembersRequest")
+ proto.RegisterType((*QueryMembersResponse)(nil), "lbm.fbridge.v1.QueryMembersResponse")
+ proto.RegisterType((*QueryMemberRequest)(nil), "lbm.fbridge.v1.QueryMemberRequest")
+ proto.RegisterType((*QueryMemberResponse)(nil), "lbm.fbridge.v1.QueryMemberResponse")
proto.RegisterType((*QueryProposalsRequest)(nil), "lbm.fbridge.v1.QueryProposalsRequest")
proto.RegisterType((*QueryProposalsResponse)(nil), "lbm.fbridge.v1.QueryProposalsResponse")
proto.RegisterType((*QueryProposalRequest)(nil), "lbm.fbridge.v1.QueryProposalRequest")
proto.RegisterType((*QueryProposalResponse)(nil), "lbm.fbridge.v1.QueryProposalResponse")
+ proto.RegisterType((*QueryVoteRequest)(nil), "lbm.fbridge.v1.QueryVoteRequest")
+ proto.RegisterType((*QueryVoteResponse)(nil), "lbm.fbridge.v1.QueryVoteResponse")
+ proto.RegisterType((*QueryVotesRequest)(nil), "lbm.fbridge.v1.QueryVotesRequest")
+ proto.RegisterType((*QueryVotesResponse)(nil), "lbm.fbridge.v1.QueryVotesResponse")
+ proto.RegisterType((*QueryBridgeStatusRequest)(nil), "lbm.fbridge.v1.QueryBridgeStatusRequest")
+ proto.RegisterType((*QueryBridgeStatusResponse)(nil), "lbm.fbridge.v1.QueryBridgeStatusResponse")
}
func init() { proto.RegisterFile("lbm/fbridge/v1/query.proto", fileDescriptor_5e7780f9db9d346e) }
var fileDescriptor_5e7780f9db9d346e = []byte{
- // 1229 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x57, 0xc1, 0x6e, 0xdb, 0x46,
- 0x10, 0x35, 0x13, 0xc7, 0xb0, 0x46, 0x40, 0xd0, 0x6e, 0x1d, 0xc7, 0x61, 0x5c, 0xc9, 0x66, 0x1a,
- 0xc7, 0x89, 0x6d, 0xd2, 0x52, 0x8c, 0x38, 0x48, 0xd2, 0x36, 0xb0, 0x5b, 0x07, 0x4d, 0xd1, 0xd4,
- 0x91, 0x7d, 0xea, 0xc5, 0xa0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c1, 0x6b, 0xbd, 0x16,
+ 0x8a, 0xa4, 0xbf, 0x83, 0x29, 0x86, 0x4f, 0x5f, 0x1e, 0x03, 0x39, 0xca, 0x22, 0x45, 0x3e, 0x6f,
+ 0xe3, 0xfd, 0x17, 0xaf, 0x0a, 0xda, 0xcb, 0x57, 0x05, 0xed, 0xef, 0x57, 0x05, 0xed, 0xdb, 0xfd,
+ 0xc2, 0xc4, 0xcb, 0xfd, 0xc2, 0xc4, 0x9f, 0xfb, 0x85, 0x89, 0x4f, 0xd7, 0xea, 0x4e, 0xf0, 0xb8,
+ 0x5d, 0x35, 0x6b, 0xdc, 0xa5, 0x5b, 0x8e, 0x27, 0x6a, 0x8f, 0x1d, 0x8b, 0x3e, 0xc2, 0xc5, 0xaa,
+ 0xb0, 0x9f, 0xd0, 0xa7, 0x71, 0xbe, 0xe0, 0x59, 0x93, 0x89, 0xea, 0xa4, 0xfc, 0x13, 0xeb, 0xca,
+ 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xb3, 0xe6, 0xb2, 0x67, 0x70, 0x13, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
@@ -1411,16 +1650,20 @@ type QueryClient interface {
NeededSubmissionSeqs(ctx context.Context, in *QueryNeededSubmissionSeqsRequest, opts ...grpc.CallOption) (*QueryNeededSubmissionSeqsResponse, error)
// Commitments queries commitments of a specific sequence number
Commitments(ctx context.Context, in *QueryCommitmentsRequest, opts ...grpc.CallOption) (*QueryCommitmentsResponse, error)
- // Guardians queries a list of Guardians registered on the bridge
- Guardians(ctx context.Context, in *QueryGuardiansRequest, opts ...grpc.CallOption) (*QueryGuardiansResponse, error)
- // Operators queries a list of Operators registered on the bridge
- Operators(ctx context.Context, in *QueryOperatorsRequest, opts ...grpc.CallOption) (*QueryOperatorsResponse, error)
- // Judges queries a list of Judges registered on the bridge
- Judges(ctx context.Context, in *QueryJudgesRequest, opts ...grpc.CallOption) (*QueryJudgesResponse, error)
+ // Members queries the members of spcific group registered on the bridge
+ Members(ctx context.Context, in *QueryMembersRequest, opts ...grpc.CallOption) (*QueryMembersResponse, error)
+ // Member queries the role of a specific member
+ Member(ctx context.Context, in *QueryMemberRequest, opts ...grpc.CallOption) (*QueryMemberResponse, error)
// Proposals queries a list of SuggestRole Proposals
Proposals(ctx context.Context, in *QueryProposalsRequest, opts ...grpc.CallOption) (*QueryProposalsResponse, error)
// Proposal queries a SuggestRole Proposal
Proposal(ctx context.Context, in *QueryProposalRequest, opts ...grpc.CallOption) (*QueryProposalResponse, error)
+ // Vote queries voted information based on proposalID, voterAddr.
+ Vote(ctx context.Context, in *QueryVoteRequest, opts ...grpc.CallOption) (*QueryVoteResponse, error)
+ // Votes queries votes of a given proposal.
+ Votes(ctx context.Context, in *QueryVotesRequest, opts ...grpc.CallOption) (*QueryVotesResponse, error)
+ // BridgeStatus queries the status of the bridge
+ BridgeStatus(ctx context.Context, in *QueryBridgeStatusRequest, opts ...grpc.CallOption) (*QueryBridgeStatusResponse, error)
}
type queryClient struct {
@@ -1512,27 +1755,18 @@ func (c *queryClient) Commitments(ctx context.Context, in *QueryCommitmentsReque
return out, nil
}
-func (c *queryClient) Guardians(ctx context.Context, in *QueryGuardiansRequest, opts ...grpc.CallOption) (*QueryGuardiansResponse, error) {
- out := new(QueryGuardiansResponse)
- err := c.cc.Invoke(ctx, "/lbm.fbridge.v1.Query/Guardians", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *queryClient) Operators(ctx context.Context, in *QueryOperatorsRequest, opts ...grpc.CallOption) (*QueryOperatorsResponse, error) {
- out := new(QueryOperatorsResponse)
- err := c.cc.Invoke(ctx, "/lbm.fbridge.v1.Query/Operators", in, out, opts...)
+func (c *queryClient) Members(ctx context.Context, in *QueryMembersRequest, opts ...grpc.CallOption) (*QueryMembersResponse, error) {
+ out := new(QueryMembersResponse)
+ err := c.cc.Invoke(ctx, "/lbm.fbridge.v1.Query/Members", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
-func (c *queryClient) Judges(ctx context.Context, in *QueryJudgesRequest, opts ...grpc.CallOption) (*QueryJudgesResponse, error) {
- out := new(QueryJudgesResponse)
- err := c.cc.Invoke(ctx, "/lbm.fbridge.v1.Query/Judges", in, out, opts...)
+func (c *queryClient) Member(ctx context.Context, in *QueryMemberRequest, opts ...grpc.CallOption) (*QueryMemberResponse, error) {
+ out := new(QueryMemberResponse)
+ err := c.cc.Invoke(ctx, "/lbm.fbridge.v1.Query/Member", in, out, opts...)
if err != nil {
return nil, err
}
@@ -1557,39 +1791,70 @@ func (c *queryClient) Proposal(ctx context.Context, in *QueryProposalRequest, op
return out, nil
}
-// QueryServer is the server API for Query service.
-type QueryServer interface {
- // Params queries the parameters of x/fbridge module.
- Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error)
- // NextSeqSend queries the sequence of next bridge request
- NextSeqSend(context.Context, *QueryNextSeqSendRequest) (*QueryNextSeqSendResponse, error)
- // BlocknumToSeqs queries a list of block numbers for which each sequence has been confirmed.
- SeqToBlocknums(context.Context, *QuerySeqToBlocknumsRequest) (*QuerySeqToBlocknumsResponse, error)
- // GreatestSeqByOperator queries a greatest sequence number confirmed by a particular operator
- GreatestSeqByOperator(context.Context, *QueryGreatestSeqByOperatorRequest) (*QueryGreatestSeqByOperatorResponse, error)
- // GreatestConsecutiveConfirmedSeq queries a greatest consecutive sequence number confirmed by n-of-m operators
- GreatestConsecutiveConfirmedSeq(context.Context, *QueryGreatestConsecutiveConfirmedSeqRequest) (*QueryGreatestConsecutiveConfirmedSeqResponse, error)
- // SubmittedProvision queries a provision submitted by a particular operator
- SubmittedProvision(context.Context, *QuerySubmittedProvisionRequest) (*QuerySubmittedProvisionResponse, error)
- // ConfirmedProvision queries a particular sequence of confirmed provisions
- ConfirmedProvision(context.Context, *QueryConfirmedProvisionRequest) (*QueryConfirmedProvisionResponse, error)
- // NeededSubmissionSeqs queries a list of sequence numbers that need to be submitted by a particular operator
+func (c *queryClient) Vote(ctx context.Context, in *QueryVoteRequest, opts ...grpc.CallOption) (*QueryVoteResponse, error) {
+ out := new(QueryVoteResponse)
+ err := c.cc.Invoke(ctx, "/lbm.fbridge.v1.Query/Vote", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *queryClient) Votes(ctx context.Context, in *QueryVotesRequest, opts ...grpc.CallOption) (*QueryVotesResponse, error) {
+ out := new(QueryVotesResponse)
+ err := c.cc.Invoke(ctx, "/lbm.fbridge.v1.Query/Votes", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *queryClient) BridgeStatus(ctx context.Context, in *QueryBridgeStatusRequest, opts ...grpc.CallOption) (*QueryBridgeStatusResponse, error) {
+ out := new(QueryBridgeStatusResponse)
+ err := c.cc.Invoke(ctx, "/lbm.fbridge.v1.Query/BridgeStatus", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+// QueryServer is the server API for Query service.
+type QueryServer interface {
+ // Params queries the parameters of x/fbridge module.
+ Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error)
+ // NextSeqSend queries the sequence of next bridge request
+ NextSeqSend(context.Context, *QueryNextSeqSendRequest) (*QueryNextSeqSendResponse, error)
+ // BlocknumToSeqs queries a list of block numbers for which each sequence has been confirmed.
+ SeqToBlocknums(context.Context, *QuerySeqToBlocknumsRequest) (*QuerySeqToBlocknumsResponse, error)
+ // GreatestSeqByOperator queries a greatest sequence number confirmed by a particular operator
+ GreatestSeqByOperator(context.Context, *QueryGreatestSeqByOperatorRequest) (*QueryGreatestSeqByOperatorResponse, error)
+ // GreatestConsecutiveConfirmedSeq queries a greatest consecutive sequence number confirmed by n-of-m operators
+ GreatestConsecutiveConfirmedSeq(context.Context, *QueryGreatestConsecutiveConfirmedSeqRequest) (*QueryGreatestConsecutiveConfirmedSeqResponse, error)
+ // SubmittedProvision queries a provision submitted by a particular operator
+ SubmittedProvision(context.Context, *QuerySubmittedProvisionRequest) (*QuerySubmittedProvisionResponse, error)
+ // ConfirmedProvision queries a particular sequence of confirmed provisions
+ ConfirmedProvision(context.Context, *QueryConfirmedProvisionRequest) (*QueryConfirmedProvisionResponse, error)
+ // NeededSubmissionSeqs queries a list of sequence numbers that need to be submitted by a particular operator
// The search scope is [greatest_consecutive_seq_by_operator, min(greatest_consecutive_seq_by_operator + range,
// greatest_seq_by_operator)] greatest_consecutive_seq_by_operator can be replaced with greatest_consecutive_seq if
// the operator is newly added
NeededSubmissionSeqs(context.Context, *QueryNeededSubmissionSeqsRequest) (*QueryNeededSubmissionSeqsResponse, error)
// Commitments queries commitments of a specific sequence number
Commitments(context.Context, *QueryCommitmentsRequest) (*QueryCommitmentsResponse, error)
- // Guardians queries a list of Guardians registered on the bridge
- Guardians(context.Context, *QueryGuardiansRequest) (*QueryGuardiansResponse, error)
- // Operators queries a list of Operators registered on the bridge
- Operators(context.Context, *QueryOperatorsRequest) (*QueryOperatorsResponse, error)
- // Judges queries a list of Judges registered on the bridge
- Judges(context.Context, *QueryJudgesRequest) (*QueryJudgesResponse, error)
+ // Members queries the members of spcific group registered on the bridge
+ Members(context.Context, *QueryMembersRequest) (*QueryMembersResponse, error)
+ // Member queries the role of a specific member
+ Member(context.Context, *QueryMemberRequest) (*QueryMemberResponse, error)
// Proposals queries a list of SuggestRole Proposals
Proposals(context.Context, *QueryProposalsRequest) (*QueryProposalsResponse, error)
// Proposal queries a SuggestRole Proposal
Proposal(context.Context, *QueryProposalRequest) (*QueryProposalResponse, error)
+ // Vote queries voted information based on proposalID, voterAddr.
+ Vote(context.Context, *QueryVoteRequest) (*QueryVoteResponse, error)
+ // Votes queries votes of a given proposal.
+ Votes(context.Context, *QueryVotesRequest) (*QueryVotesResponse, error)
+ // BridgeStatus queries the status of the bridge
+ BridgeStatus(context.Context, *QueryBridgeStatusRequest) (*QueryBridgeStatusResponse, error)
}
// UnimplementedQueryServer can be embedded to have forward compatible implementations.
@@ -1623,14 +1888,11 @@ func (*UnimplementedQueryServer) NeededSubmissionSeqs(ctx context.Context, req *
func (*UnimplementedQueryServer) Commitments(ctx context.Context, req *QueryCommitmentsRequest) (*QueryCommitmentsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Commitments not implemented")
}
-func (*UnimplementedQueryServer) Guardians(ctx context.Context, req *QueryGuardiansRequest) (*QueryGuardiansResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "method Guardians not implemented")
-}
-func (*UnimplementedQueryServer) Operators(ctx context.Context, req *QueryOperatorsRequest) (*QueryOperatorsResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "method Operators not implemented")
+func (*UnimplementedQueryServer) Members(ctx context.Context, req *QueryMembersRequest) (*QueryMembersResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method Members not implemented")
}
-func (*UnimplementedQueryServer) Judges(ctx context.Context, req *QueryJudgesRequest) (*QueryJudgesResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "method Judges not implemented")
+func (*UnimplementedQueryServer) Member(ctx context.Context, req *QueryMemberRequest) (*QueryMemberResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method Member not implemented")
}
func (*UnimplementedQueryServer) Proposals(ctx context.Context, req *QueryProposalsRequest) (*QueryProposalsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Proposals not implemented")
@@ -1638,6 +1900,15 @@ func (*UnimplementedQueryServer) Proposals(ctx context.Context, req *QueryPropos
func (*UnimplementedQueryServer) Proposal(ctx context.Context, req *QueryProposalRequest) (*QueryProposalResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Proposal not implemented")
}
+func (*UnimplementedQueryServer) Vote(ctx context.Context, req *QueryVoteRequest) (*QueryVoteResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method Vote not implemented")
+}
+func (*UnimplementedQueryServer) Votes(ctx context.Context, req *QueryVotesRequest) (*QueryVotesResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method Votes not implemented")
+}
+func (*UnimplementedQueryServer) BridgeStatus(ctx context.Context, req *QueryBridgeStatusRequest) (*QueryBridgeStatusResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method BridgeStatus not implemented")
+}
func RegisterQueryServer(s grpc1.Server, srv QueryServer) {
s.RegisterService(&_Query_serviceDesc, srv)
@@ -1805,92 +2076,128 @@ func _Query_Commitments_Handler(srv interface{}, ctx context.Context, dec func(i
return interceptor(ctx, in, info, handler)
}
-func _Query_Guardians_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(QueryGuardiansRequest)
+func _Query_Members_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(QueryMembersRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
- return srv.(QueryServer).Guardians(ctx, in)
+ return srv.(QueryServer).Members(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
- FullMethod: "/lbm.fbridge.v1.Query/Guardians",
+ FullMethod: "/lbm.fbridge.v1.Query/Members",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(QueryServer).Guardians(ctx, req.(*QueryGuardiansRequest))
+ return srv.(QueryServer).Members(ctx, req.(*QueryMembersRequest))
}
return interceptor(ctx, in, info, handler)
}
-func _Query_Operators_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(QueryOperatorsRequest)
+func _Query_Member_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(QueryMemberRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
- return srv.(QueryServer).Operators(ctx, in)
+ return srv.(QueryServer).Member(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
- FullMethod: "/lbm.fbridge.v1.Query/Operators",
+ FullMethod: "/lbm.fbridge.v1.Query/Member",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(QueryServer).Operators(ctx, req.(*QueryOperatorsRequest))
+ return srv.(QueryServer).Member(ctx, req.(*QueryMemberRequest))
}
return interceptor(ctx, in, info, handler)
}
-func _Query_Judges_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(QueryJudgesRequest)
+func _Query_Proposals_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(QueryProposalsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
- return srv.(QueryServer).Judges(ctx, in)
+ return srv.(QueryServer).Proposals(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
- FullMethod: "/lbm.fbridge.v1.Query/Judges",
+ FullMethod: "/lbm.fbridge.v1.Query/Proposals",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(QueryServer).Judges(ctx, req.(*QueryJudgesRequest))
+ return srv.(QueryServer).Proposals(ctx, req.(*QueryProposalsRequest))
}
return interceptor(ctx, in, info, handler)
}
-func _Query_Proposals_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(QueryProposalsRequest)
+func _Query_Proposal_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(QueryProposalRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
- return srv.(QueryServer).Proposals(ctx, in)
+ return srv.(QueryServer).Proposal(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
- FullMethod: "/lbm.fbridge.v1.Query/Proposals",
+ FullMethod: "/lbm.fbridge.v1.Query/Proposal",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(QueryServer).Proposals(ctx, req.(*QueryProposalsRequest))
+ return srv.(QueryServer).Proposal(ctx, req.(*QueryProposalRequest))
}
return interceptor(ctx, in, info, handler)
}
-func _Query_Proposal_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(QueryProposalRequest)
+func _Query_Vote_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(QueryVoteRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
- return srv.(QueryServer).Proposal(ctx, in)
+ return srv.(QueryServer).Vote(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
- FullMethod: "/lbm.fbridge.v1.Query/Proposal",
+ FullMethod: "/lbm.fbridge.v1.Query/Vote",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(QueryServer).Proposal(ctx, req.(*QueryProposalRequest))
+ return srv.(QueryServer).Vote(ctx, req.(*QueryVoteRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _Query_Votes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(QueryVotesRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(QueryServer).Votes(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/lbm.fbridge.v1.Query/Votes",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(QueryServer).Votes(ctx, req.(*QueryVotesRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _Query_BridgeStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(QueryBridgeStatusRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(QueryServer).BridgeStatus(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/lbm.fbridge.v1.Query/BridgeStatus",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(QueryServer).BridgeStatus(ctx, req.(*QueryBridgeStatusRequest))
}
return interceptor(ctx, in, info, handler)
}
@@ -1936,16 +2243,12 @@ var _Query_serviceDesc = grpc.ServiceDesc{
Handler: _Query_Commitments_Handler,
},
{
- MethodName: "Guardians",
- Handler: _Query_Guardians_Handler,
- },
- {
- MethodName: "Operators",
- Handler: _Query_Operators_Handler,
+ MethodName: "Members",
+ Handler: _Query_Members_Handler,
},
{
- MethodName: "Judges",
- Handler: _Query_Judges_Handler,
+ MethodName: "Member",
+ Handler: _Query_Member_Handler,
},
{
MethodName: "Proposals",
@@ -1955,6 +2258,18 @@ var _Query_serviceDesc = grpc.ServiceDesc{
MethodName: "Proposal",
Handler: _Query_Proposal_Handler,
},
+ {
+ MethodName: "Vote",
+ Handler: _Query_Vote_Handler,
+ },
+ {
+ MethodName: "Votes",
+ Handler: _Query_Votes_Handler,
+ },
+ {
+ MethodName: "BridgeStatus",
+ Handler: _Query_BridgeStatus_Handler,
+ },
},
Streams: []grpc.StreamDesc{},
Metadata: "lbm/fbridge/v1/query.proto",
@@ -2543,7 +2858,7 @@ func (m *QueryCommitmentsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error
return len(dAtA) - i, nil
}
-func (m *QueryGuardiansRequest) Marshal() (dAtA []byte, err error) {
+func (m *QueryMembersRequest) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
@@ -2553,20 +2868,27 @@ func (m *QueryGuardiansRequest) Marshal() (dAtA []byte, err error) {
return dAtA[:n], nil
}
-func (m *QueryGuardiansRequest) MarshalTo(dAtA []byte) (int, error) {
+func (m *QueryMembersRequest) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
-func (m *QueryGuardiansRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+func (m *QueryMembersRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
+ if len(m.Role) > 0 {
+ i -= len(m.Role)
+ copy(dAtA[i:], m.Role)
+ i = encodeVarintQuery(dAtA, i, uint64(len(m.Role)))
+ i--
+ dAtA[i] = 0xa
+ }
return len(dAtA) - i, nil
}
-func (m *QueryGuardiansResponse) Marshal() (dAtA []byte, err error) {
+func (m *QueryMembersResponse) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
@@ -2576,21 +2898,21 @@ func (m *QueryGuardiansResponse) Marshal() (dAtA []byte, err error) {
return dAtA[:n], nil
}
-func (m *QueryGuardiansResponse) MarshalTo(dAtA []byte) (int, error) {
+func (m *QueryMembersResponse) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
-func (m *QueryGuardiansResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+func (m *QueryMembersResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
- if len(m.Guardians) > 0 {
- for iNdEx := len(m.Guardians) - 1; iNdEx >= 0; iNdEx-- {
- i -= len(m.Guardians[iNdEx])
- copy(dAtA[i:], m.Guardians[iNdEx])
- i = encodeVarintQuery(dAtA, i, uint64(len(m.Guardians[iNdEx])))
+ if len(m.Members) > 0 {
+ for iNdEx := len(m.Members) - 1; iNdEx >= 0; iNdEx-- {
+ i -= len(m.Members[iNdEx])
+ copy(dAtA[i:], m.Members[iNdEx])
+ i = encodeVarintQuery(dAtA, i, uint64(len(m.Members[iNdEx])))
i--
dAtA[i] = 0xa
}
@@ -2598,7 +2920,7 @@ func (m *QueryGuardiansResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
return len(dAtA) - i, nil
}
-func (m *QueryOperatorsRequest) Marshal() (dAtA []byte, err error) {
+func (m *QueryMemberRequest) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
@@ -2608,20 +2930,27 @@ func (m *QueryOperatorsRequest) Marshal() (dAtA []byte, err error) {
return dAtA[:n], nil
}
-func (m *QueryOperatorsRequest) MarshalTo(dAtA []byte) (int, error) {
+func (m *QueryMemberRequest) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
-func (m *QueryOperatorsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+func (m *QueryMemberRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
+ if len(m.Address) > 0 {
+ i -= len(m.Address)
+ copy(dAtA[i:], m.Address)
+ i = encodeVarintQuery(dAtA, i, uint64(len(m.Address)))
+ i--
+ dAtA[i] = 0xa
+ }
return len(dAtA) - i, nil
}
-func (m *QueryOperatorsResponse) Marshal() (dAtA []byte, err error) {
+func (m *QueryMemberResponse) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
@@ -2631,29 +2960,27 @@ func (m *QueryOperatorsResponse) Marshal() (dAtA []byte, err error) {
return dAtA[:n], nil
}
-func (m *QueryOperatorsResponse) MarshalTo(dAtA []byte) (int, error) {
+func (m *QueryMemberResponse) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
-func (m *QueryOperatorsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+func (m *QueryMemberResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
- if len(m.Operators) > 0 {
- for iNdEx := len(m.Operators) - 1; iNdEx >= 0; iNdEx-- {
- i -= len(m.Operators[iNdEx])
- copy(dAtA[i:], m.Operators[iNdEx])
- i = encodeVarintQuery(dAtA, i, uint64(len(m.Operators[iNdEx])))
- i--
- dAtA[i] = 0xa
- }
+ if len(m.Role) > 0 {
+ i -= len(m.Role)
+ copy(dAtA[i:], m.Role)
+ i = encodeVarintQuery(dAtA, i, uint64(len(m.Role)))
+ i--
+ dAtA[i] = 0xa
}
return len(dAtA) - i, nil
}
-func (m *QueryJudgesRequest) Marshal() (dAtA []byte, err error) {
+func (m *QueryProposalsRequest) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
@@ -2663,20 +2990,32 @@ func (m *QueryJudgesRequest) Marshal() (dAtA []byte, err error) {
return dAtA[:n], nil
}
-func (m *QueryJudgesRequest) MarshalTo(dAtA []byte) (int, error) {
+func (m *QueryProposalsRequest) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
-func (m *QueryJudgesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+func (m *QueryProposalsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
+ if m.Pagination != nil {
+ {
+ size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintQuery(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0xa
+ }
return len(dAtA) - i, nil
}
-func (m *QueryJudgesResponse) Marshal() (dAtA []byte, err error) {
+func (m *QueryProposalsResponse) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
@@ -2686,21 +3025,38 @@ func (m *QueryJudgesResponse) Marshal() (dAtA []byte, err error) {
return dAtA[:n], nil
}
-func (m *QueryJudgesResponse) MarshalTo(dAtA []byte) (int, error) {
+func (m *QueryProposalsResponse) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
-func (m *QueryJudgesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+func (m *QueryProposalsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
- if len(m.Judges) > 0 {
- for iNdEx := len(m.Judges) - 1; iNdEx >= 0; iNdEx-- {
- i -= len(m.Judges[iNdEx])
- copy(dAtA[i:], m.Judges[iNdEx])
- i = encodeVarintQuery(dAtA, i, uint64(len(m.Judges[iNdEx])))
+ if m.Pagination != nil {
+ {
+ size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintQuery(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0x12
+ }
+ if len(m.Proposals) > 0 {
+ for iNdEx := len(m.Proposals) - 1; iNdEx >= 0; iNdEx-- {
+ {
+ size, err := m.Proposals[iNdEx].MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintQuery(dAtA, i, uint64(size))
+ }
i--
dAtA[i] = 0xa
}
@@ -2708,7 +3064,7 @@ func (m *QueryJudgesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
return len(dAtA) - i, nil
}
-func (m *QueryProposalsRequest) Marshal() (dAtA []byte, err error) {
+func (m *QueryProposalRequest) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
@@ -2718,32 +3074,25 @@ func (m *QueryProposalsRequest) Marshal() (dAtA []byte, err error) {
return dAtA[:n], nil
}
-func (m *QueryProposalsRequest) MarshalTo(dAtA []byte) (int, error) {
+func (m *QueryProposalRequest) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
-func (m *QueryProposalsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+func (m *QueryProposalRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
- if m.Pagination != nil {
- {
- size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintQuery(dAtA, i, uint64(size))
- }
+ if m.ProposalId != 0 {
+ i = encodeVarintQuery(dAtA, i, uint64(m.ProposalId))
i--
- dAtA[i] = 0xa
+ dAtA[i] = 0x8
}
return len(dAtA) - i, nil
}
-func (m *QueryProposalsResponse) Marshal() (dAtA []byte, err error) {
+func (m *QueryProposalResponse) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
@@ -2753,34 +3102,30 @@ func (m *QueryProposalsResponse) Marshal() (dAtA []byte, err error) {
return dAtA[:n], nil
}
-func (m *QueryProposalsResponse) MarshalTo(dAtA []byte) (int, error) {
+func (m *QueryProposalResponse) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
-func (m *QueryProposalsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+func (m *QueryProposalResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
- if len(m.Proposals) > 0 {
- for iNdEx := len(m.Proposals) - 1; iNdEx >= 0; iNdEx-- {
- {
- size, err := m.Proposals[iNdEx].MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintQuery(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0xa
+ {
+ size, err := m.Proposal.MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
}
+ i -= size
+ i = encodeVarintQuery(dAtA, i, uint64(size))
}
+ i--
+ dAtA[i] = 0xa
return len(dAtA) - i, nil
}
-func (m *QueryProposalRequest) Marshal() (dAtA []byte, err error) {
+func (m *QueryVoteRequest) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
@@ -2790,27 +3135,32 @@ func (m *QueryProposalRequest) Marshal() (dAtA []byte, err error) {
return dAtA[:n], nil
}
-func (m *QueryProposalRequest) MarshalTo(dAtA []byte) (int, error) {
+func (m *QueryVoteRequest) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
-func (m *QueryProposalRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+func (m *QueryVoteRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
- if len(m.ProposalId) > 0 {
- i -= len(m.ProposalId)
- copy(dAtA[i:], m.ProposalId)
- i = encodeVarintQuery(dAtA, i, uint64(len(m.ProposalId)))
+ if len(m.Voter) > 0 {
+ i -= len(m.Voter)
+ copy(dAtA[i:], m.Voter)
+ i = encodeVarintQuery(dAtA, i, uint64(len(m.Voter)))
i--
- dAtA[i] = 0xa
+ dAtA[i] = 0x12
+ }
+ if m.ProposalId != 0 {
+ i = encodeVarintQuery(dAtA, i, uint64(m.ProposalId))
+ i--
+ dAtA[i] = 0x8
}
return len(dAtA) - i, nil
}
-func (m *QueryProposalResponse) Marshal() (dAtA []byte, err error) {
+func (m *QueryVoteResponse) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
@@ -2820,72 +3170,196 @@ func (m *QueryProposalResponse) Marshal() (dAtA []byte, err error) {
return dAtA[:n], nil
}
-func (m *QueryProposalResponse) MarshalTo(dAtA []byte) (int, error) {
+func (m *QueryVoteResponse) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
-func (m *QueryProposalResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+func (m *QueryVoteResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
- if m.Proposal != nil {
- {
- size, err := m.Proposal.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintQuery(dAtA, i, uint64(size))
+ {
+ size, err := m.Vote.MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
}
- i--
- dAtA[i] = 0xa
+ i -= size
+ i = encodeVarintQuery(dAtA, i, uint64(size))
}
+ i--
+ dAtA[i] = 0xa
return len(dAtA) - i, nil
}
-func encodeVarintQuery(dAtA []byte, offset int, v uint64) int {
- offset -= sovQuery(v)
- base := offset
- for v >= 1<<7 {
- dAtA[offset] = uint8(v&0x7f | 0x80)
- v >>= 7
- offset++
- }
- dAtA[offset] = uint8(v)
- return base
-}
-func (m *QueryParamsRequest) Size() (n int) {
- if m == nil {
- return 0
+func (m *QueryVotesRequest) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
}
- var l int
- _ = l
- return n
+ return dAtA[:n], nil
}
-func (m *QueryParamsResponse) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = m.Params.Size()
- n += 1 + l + sovQuery(uint64(l))
- return n
+func (m *QueryVotesRequest) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
}
-func (m *QueryNextSeqSendRequest) Size() (n int) {
- if m == nil {
- return 0
- }
+func (m *QueryVotesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
var l int
_ = l
- return n
+ if m.ProposalId != 0 {
+ i = encodeVarintQuery(dAtA, i, uint64(m.ProposalId))
+ i--
+ dAtA[i] = 0x8
+ }
+ return len(dAtA) - i, nil
}
-func (m *QueryNextSeqSendResponse) Size() (n int) {
+func (m *QueryVotesResponse) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *QueryVotesResponse) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *QueryVotesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ if len(m.Votes) > 0 {
+ for iNdEx := len(m.Votes) - 1; iNdEx >= 0; iNdEx-- {
+ {
+ size, err := m.Votes[iNdEx].MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintQuery(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0xa
+ }
+ }
+ return len(dAtA) - i, nil
+}
+
+func (m *QueryBridgeStatusRequest) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *QueryBridgeStatusRequest) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *QueryBridgeStatusRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ return len(dAtA) - i, nil
+}
+
+func (m *QueryBridgeStatusResponse) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *QueryBridgeStatusResponse) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *QueryBridgeStatusResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ {
+ size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintQuery(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0x12
+ if m.Status != 0 {
+ i = encodeVarintQuery(dAtA, i, uint64(m.Status))
+ i--
+ dAtA[i] = 0x8
+ }
+ return len(dAtA) - i, nil
+}
+
+func encodeVarintQuery(dAtA []byte, offset int, v uint64) int {
+ offset -= sovQuery(v)
+ base := offset
+ for v >= 1<<7 {
+ dAtA[offset] = uint8(v&0x7f | 0x80)
+ v >>= 7
+ offset++
+ }
+ dAtA[offset] = uint8(v)
+ return base
+}
+func (m *QueryParamsRequest) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ return n
+}
+
+func (m *QueryParamsResponse) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ l = m.Params.Size()
+ n += 1 + l + sovQuery(uint64(l))
+ return n
+}
+
+func (m *QueryNextSeqSendRequest) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ return n
+}
+
+func (m *QueryNextSeqSendResponse) Size() (n int) {
if m == nil {
return 0
}
@@ -3088,23 +3562,27 @@ func (m *QueryCommitmentsResponse) Size() (n int) {
return n
}
-func (m *QueryGuardiansRequest) Size() (n int) {
+func (m *QueryMembersRequest) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
+ l = len(m.Role)
+ if l > 0 {
+ n += 1 + l + sovQuery(uint64(l))
+ }
return n
}
-func (m *QueryGuardiansResponse) Size() (n int) {
+func (m *QueryMembersResponse) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
- if len(m.Guardians) > 0 {
- for _, s := range m.Guardians {
+ if len(m.Members) > 0 {
+ for _, s := range m.Members {
l = len(s)
n += 1 + l + sovQuery(uint64(l))
}
@@ -3112,75 +3590,134 @@ func (m *QueryGuardiansResponse) Size() (n int) {
return n
}
-func (m *QueryOperatorsRequest) Size() (n int) {
+func (m *QueryMemberRequest) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
+ l = len(m.Address)
+ if l > 0 {
+ n += 1 + l + sovQuery(uint64(l))
+ }
return n
}
-func (m *QueryOperatorsResponse) Size() (n int) {
+func (m *QueryMemberResponse) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
- if len(m.Operators) > 0 {
- for _, s := range m.Operators {
- l = len(s)
- n += 1 + l + sovQuery(uint64(l))
- }
+ l = len(m.Role)
+ if l > 0 {
+ n += 1 + l + sovQuery(uint64(l))
}
return n
}
-func (m *QueryJudgesRequest) Size() (n int) {
+func (m *QueryProposalsRequest) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
+ if m.Pagination != nil {
+ l = m.Pagination.Size()
+ n += 1 + l + sovQuery(uint64(l))
+ }
return n
}
-func (m *QueryJudgesResponse) Size() (n int) {
+func (m *QueryProposalsResponse) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
- if len(m.Judges) > 0 {
- for _, s := range m.Judges {
- l = len(s)
+ if len(m.Proposals) > 0 {
+ for _, e := range m.Proposals {
+ l = e.Size()
n += 1 + l + sovQuery(uint64(l))
}
}
+ if m.Pagination != nil {
+ l = m.Pagination.Size()
+ n += 1 + l + sovQuery(uint64(l))
+ }
return n
}
-func (m *QueryProposalsRequest) Size() (n int) {
+func (m *QueryProposalRequest) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
- if m.Pagination != nil {
- l = m.Pagination.Size()
+ if m.ProposalId != 0 {
+ n += 1 + sovQuery(uint64(m.ProposalId))
+ }
+ return n
+}
+
+func (m *QueryProposalResponse) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ l = m.Proposal.Size()
+ n += 1 + l + sovQuery(uint64(l))
+ return n
+}
+
+func (m *QueryVoteRequest) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ if m.ProposalId != 0 {
+ n += 1 + sovQuery(uint64(m.ProposalId))
+ }
+ l = len(m.Voter)
+ if l > 0 {
n += 1 + l + sovQuery(uint64(l))
}
return n
}
-func (m *QueryProposalsResponse) Size() (n int) {
+func (m *QueryVoteResponse) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
- if len(m.Proposals) > 0 {
- for _, e := range m.Proposals {
+ l = m.Vote.Size()
+ n += 1 + l + sovQuery(uint64(l))
+ return n
+}
+
+func (m *QueryVotesRequest) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ if m.ProposalId != 0 {
+ n += 1 + sovQuery(uint64(m.ProposalId))
+ }
+ return n
+}
+
+func (m *QueryVotesResponse) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ if len(m.Votes) > 0 {
+ for _, e := range m.Votes {
l = e.Size()
n += 1 + l + sovQuery(uint64(l))
}
@@ -3188,29 +3725,26 @@ func (m *QueryProposalsResponse) Size() (n int) {
return n
}
-func (m *QueryProposalRequest) Size() (n int) {
+func (m *QueryBridgeStatusRequest) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
- l = len(m.ProposalId)
- if l > 0 {
- n += 1 + l + sovQuery(uint64(l))
- }
return n
}
-func (m *QueryProposalResponse) Size() (n int) {
+func (m *QueryBridgeStatusResponse) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
- if m.Proposal != nil {
- l = m.Proposal.Size()
- n += 1 + l + sovQuery(uint64(l))
+ if m.Status != 0 {
+ n += 1 + sovQuery(uint64(m.Status))
}
+ l = m.Metadata.Size()
+ n += 1 + l + sovQuery(uint64(l))
return n
}
@@ -4774,7 +5308,7 @@ func (m *QueryCommitmentsResponse) Unmarshal(dAtA []byte) error {
}
return nil
}
-func (m *QueryGuardiansRequest) Unmarshal(dAtA []byte) error {
+func (m *QueryMembersRequest) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@@ -4784,25 +5318,389 @@ func (m *QueryGuardiansRequest) Unmarshal(dAtA []byte) error {
if shift >= 64 {
return ErrIntOverflowQuery
}
- if iNdEx >= l {
+ if iNdEx >= l {
+ return 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 fmt.Errorf("proto: QueryMembersRequest: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: QueryMembersRequest: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Role", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowQuery
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthQuery
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthQuery
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Role = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipQuery(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthQuery
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *QueryMembersResponse) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowQuery
+ }
+ if iNdEx >= l {
+ return 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 fmt.Errorf("proto: QueryMembersResponse: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: QueryMembersResponse: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Members", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowQuery
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthQuery
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthQuery
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Members = append(m.Members, string(dAtA[iNdEx:postIndex]))
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipQuery(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthQuery
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *QueryMemberRequest) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowQuery
+ }
+ if iNdEx >= l {
+ return 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 fmt.Errorf("proto: QueryMemberRequest: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: QueryMemberRequest: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowQuery
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthQuery
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthQuery
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Address = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipQuery(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthQuery
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *QueryMemberResponse) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowQuery
+ }
+ if iNdEx >= l {
+ return 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 fmt.Errorf("proto: QueryMemberResponse: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: QueryMemberResponse: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Role", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowQuery
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthQuery
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthQuery
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Role = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipQuery(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthQuery
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *QueryProposalsRequest) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowQuery
+ }
+ if iNdEx >= l {
+ return 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 fmt.Errorf("proto: QueryProposalsRequest: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: QueryProposalsRequest: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowQuery
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthQuery
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthQuery
+ }
+ if postIndex > l {
return io.ErrUnexpectedEOF
}
- b := dAtA[iNdEx]
- iNdEx++
- wire |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
+ if m.Pagination == nil {
+ m.Pagination = &query.PageRequest{}
}
- }
- fieldNum := int32(wire >> 3)
- wireType := int(wire & 0x7)
- if wireType == 4 {
- return fmt.Errorf("proto: QueryGuardiansRequest: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: QueryGuardiansRequest: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
+ if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipQuery(dAtA[iNdEx:])
@@ -4824,7 +5722,7 @@ func (m *QueryGuardiansRequest) Unmarshal(dAtA []byte) error {
}
return nil
}
-func (m *QueryGuardiansResponse) Unmarshal(dAtA []byte) error {
+func (m *QueryProposalsResponse) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@@ -4847,17 +5745,17 @@ func (m *QueryGuardiansResponse) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
- return fmt.Errorf("proto: QueryGuardiansResponse: wiretype end group for non-group")
+ return fmt.Errorf("proto: QueryProposalsResponse: wiretype end group for non-group")
}
if fieldNum <= 0 {
- return fmt.Errorf("proto: QueryGuardiansResponse: illegal tag %d (wire type %d)", fieldNum, wire)
+ return fmt.Errorf("proto: QueryProposalsResponse: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Guardians", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Proposals", wireType)
}
- var stringLen uint64
+ var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowQuery
@@ -4867,23 +5765,61 @@ func (m *QueryGuardiansResponse) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
- stringLen |= uint64(b&0x7F) << shift
+ msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
- intStringLen := int(stringLen)
- if intStringLen < 0 {
+ if msglen < 0 {
return ErrInvalidLengthQuery
}
- postIndex := iNdEx + intStringLen
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthQuery
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Proposals = append(m.Proposals, RoleProposal{})
+ if err := m.Proposals[len(m.Proposals)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowQuery
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthQuery
+ }
+ postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthQuery
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
- m.Guardians = append(m.Guardians, string(dAtA[iNdEx:postIndex]))
+ if m.Pagination == nil {
+ m.Pagination = &query.PageResponse{}
+ }
+ if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
iNdEx = postIndex
default:
iNdEx = preIndex
@@ -4906,7 +5842,7 @@ func (m *QueryGuardiansResponse) Unmarshal(dAtA []byte) error {
}
return nil
}
-func (m *QueryOperatorsRequest) Unmarshal(dAtA []byte) error {
+func (m *QueryProposalRequest) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@@ -4929,12 +5865,31 @@ func (m *QueryOperatorsRequest) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
- return fmt.Errorf("proto: QueryOperatorsRequest: wiretype end group for non-group")
+ return fmt.Errorf("proto: QueryProposalRequest: wiretype end group for non-group")
}
if fieldNum <= 0 {
- return fmt.Errorf("proto: QueryOperatorsRequest: illegal tag %d (wire type %d)", fieldNum, wire)
+ return fmt.Errorf("proto: QueryProposalRequest: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
+ case 1:
+ if wireType != 0 {
+ return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType)
+ }
+ m.ProposalId = 0
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowQuery
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ m.ProposalId |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
default:
iNdEx = preIndex
skippy, err := skipQuery(dAtA[iNdEx:])
@@ -4956,7 +5911,7 @@ func (m *QueryOperatorsRequest) Unmarshal(dAtA []byte) error {
}
return nil
}
-func (m *QueryOperatorsResponse) Unmarshal(dAtA []byte) error {
+func (m *QueryProposalResponse) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@@ -4979,17 +5934,17 @@ func (m *QueryOperatorsResponse) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
- return fmt.Errorf("proto: QueryOperatorsResponse: wiretype end group for non-group")
+ return fmt.Errorf("proto: QueryProposalResponse: wiretype end group for non-group")
}
if fieldNum <= 0 {
- return fmt.Errorf("proto: QueryOperatorsResponse: illegal tag %d (wire type %d)", fieldNum, wire)
+ return fmt.Errorf("proto: QueryProposalResponse: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Operators", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Proposal", wireType)
}
- var stringLen uint64
+ var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowQuery
@@ -4999,23 +5954,24 @@ func (m *QueryOperatorsResponse) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
- stringLen |= uint64(b&0x7F) << shift
+ msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
- intStringLen := int(stringLen)
- if intStringLen < 0 {
+ if msglen < 0 {
return ErrInvalidLengthQuery
}
- postIndex := iNdEx + intStringLen
+ postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthQuery
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
- m.Operators = append(m.Operators, string(dAtA[iNdEx:postIndex]))
+ if err := m.Proposal.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
iNdEx = postIndex
default:
iNdEx = preIndex
@@ -5038,7 +5994,7 @@ func (m *QueryOperatorsResponse) Unmarshal(dAtA []byte) error {
}
return nil
}
-func (m *QueryJudgesRequest) Unmarshal(dAtA []byte) error {
+func (m *QueryVoteRequest) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@@ -5061,12 +6017,63 @@ func (m *QueryJudgesRequest) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
- return fmt.Errorf("proto: QueryJudgesRequest: wiretype end group for non-group")
+ return fmt.Errorf("proto: QueryVoteRequest: wiretype end group for non-group")
}
if fieldNum <= 0 {
- return fmt.Errorf("proto: QueryJudgesRequest: illegal tag %d (wire type %d)", fieldNum, wire)
+ return fmt.Errorf("proto: QueryVoteRequest: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
+ case 1:
+ if wireType != 0 {
+ return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType)
+ }
+ m.ProposalId = 0
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowQuery
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ m.ProposalId |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Voter", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowQuery
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthQuery
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthQuery
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Voter = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipQuery(dAtA[iNdEx:])
@@ -5088,7 +6095,7 @@ func (m *QueryJudgesRequest) Unmarshal(dAtA []byte) error {
}
return nil
}
-func (m *QueryJudgesResponse) Unmarshal(dAtA []byte) error {
+func (m *QueryVoteResponse) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@@ -5111,17 +6118,17 @@ func (m *QueryJudgesResponse) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
- return fmt.Errorf("proto: QueryJudgesResponse: wiretype end group for non-group")
+ return fmt.Errorf("proto: QueryVoteResponse: wiretype end group for non-group")
}
if fieldNum <= 0 {
- return fmt.Errorf("proto: QueryJudgesResponse: illegal tag %d (wire type %d)", fieldNum, wire)
+ return fmt.Errorf("proto: QueryVoteResponse: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Judges", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Vote", wireType)
}
- var stringLen uint64
+ var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowQuery
@@ -5131,23 +6138,24 @@ func (m *QueryJudgesResponse) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
- stringLen |= uint64(b&0x7F) << shift
+ msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
- intStringLen := int(stringLen)
- if intStringLen < 0 {
+ if msglen < 0 {
return ErrInvalidLengthQuery
}
- postIndex := iNdEx + intStringLen
+ postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthQuery
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
- m.Judges = append(m.Judges, string(dAtA[iNdEx:postIndex]))
+ if err := m.Vote.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
iNdEx = postIndex
default:
iNdEx = preIndex
@@ -5170,7 +6178,7 @@ func (m *QueryJudgesResponse) Unmarshal(dAtA []byte) error {
}
return nil
}
-func (m *QueryProposalsRequest) Unmarshal(dAtA []byte) error {
+func (m *QueryVotesRequest) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@@ -5193,17 +6201,17 @@ func (m *QueryProposalsRequest) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
- return fmt.Errorf("proto: QueryProposalsRequest: wiretype end group for non-group")
+ return fmt.Errorf("proto: QueryVotesRequest: wiretype end group for non-group")
}
if fieldNum <= 0 {
- return fmt.Errorf("proto: QueryProposalsRequest: illegal tag %d (wire type %d)", fieldNum, wire)
+ return fmt.Errorf("proto: QueryVotesRequest: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType)
+ if wireType != 0 {
+ return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType)
}
- var msglen int
+ m.ProposalId = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowQuery
@@ -5213,28 +6221,11 @@ func (m *QueryProposalsRequest) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
- msglen |= int(b&0x7F) << shift
+ m.ProposalId |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
- if msglen < 0 {
- return ErrInvalidLengthQuery
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthQuery
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.Pagination == nil {
- m.Pagination = &query.PageRequest{}
- }
- if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipQuery(dAtA[iNdEx:])
@@ -5256,7 +6247,7 @@ func (m *QueryProposalsRequest) Unmarshal(dAtA []byte) error {
}
return nil
}
-func (m *QueryProposalsResponse) Unmarshal(dAtA []byte) error {
+func (m *QueryVotesResponse) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@@ -5279,15 +6270,15 @@ func (m *QueryProposalsResponse) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
- return fmt.Errorf("proto: QueryProposalsResponse: wiretype end group for non-group")
+ return fmt.Errorf("proto: QueryVotesResponse: wiretype end group for non-group")
}
if fieldNum <= 0 {
- return fmt.Errorf("proto: QueryProposalsResponse: illegal tag %d (wire type %d)", fieldNum, wire)
+ return fmt.Errorf("proto: QueryVotesResponse: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Proposals", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Votes", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
@@ -5314,8 +6305,8 @@ func (m *QueryProposalsResponse) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- m.Proposals = append(m.Proposals, &RoleProposal{})
- if err := m.Proposals[len(m.Proposals)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ m.Votes = append(m.Votes, Vote{})
+ if err := m.Votes[len(m.Votes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
@@ -5340,7 +6331,7 @@ func (m *QueryProposalsResponse) Unmarshal(dAtA []byte) error {
}
return nil
}
-func (m *QueryProposalRequest) Unmarshal(dAtA []byte) error {
+func (m *QueryBridgeStatusRequest) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@@ -5363,44 +6354,12 @@ func (m *QueryProposalRequest) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
- return fmt.Errorf("proto: QueryProposalRequest: wiretype end group for non-group")
+ return fmt.Errorf("proto: QueryBridgeStatusRequest: wiretype end group for non-group")
}
if fieldNum <= 0 {
- return fmt.Errorf("proto: QueryProposalRequest: illegal tag %d (wire type %d)", fieldNum, wire)
+ return fmt.Errorf("proto: QueryBridgeStatusRequest: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowQuery
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- stringLen |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- intStringLen := int(stringLen)
- if intStringLen < 0 {
- return ErrInvalidLengthQuery
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthQuery
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.ProposalId = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipQuery(dAtA[iNdEx:])
@@ -5422,7 +6381,7 @@ func (m *QueryProposalRequest) Unmarshal(dAtA []byte) error {
}
return nil
}
-func (m *QueryProposalResponse) Unmarshal(dAtA []byte) error {
+func (m *QueryBridgeStatusResponse) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@@ -5445,15 +6404,34 @@ func (m *QueryProposalResponse) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
- return fmt.Errorf("proto: QueryProposalResponse: wiretype end group for non-group")
+ return fmt.Errorf("proto: QueryBridgeStatusResponse: wiretype end group for non-group")
}
if fieldNum <= 0 {
- return fmt.Errorf("proto: QueryProposalResponse: illegal tag %d (wire type %d)", fieldNum, wire)
+ return fmt.Errorf("proto: QueryBridgeStatusResponse: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
+ if wireType != 0 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType)
+ }
+ m.Status = 0
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowQuery
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ m.Status |= BridgeStatus(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ case 2:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Proposal", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
@@ -5480,10 +6458,7 @@ func (m *QueryProposalResponse) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- if m.Proposal == nil {
- m.Proposal = &RoleProposal{}
- }
- if err := m.Proposal.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
diff --git a/x/fbridge/types/query.pb.gw.go b/x/fbridge/types/query.pb.gw.go
index c62ab4e113..30afc929bb 100644
--- a/x/fbridge/types/query.pb.gw.go
+++ b/x/fbridge/types/query.pb.gw.go
@@ -431,56 +431,92 @@ func local_request_Query_Commitments_0(ctx context.Context, marshaler runtime.Ma
}
-func request_Query_Guardians_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
- var protoReq QueryGuardiansRequest
+var (
+ filter_Query_Members_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
+)
+
+func request_Query_Members_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq QueryMembersRequest
var metadata runtime.ServerMetadata
- msg, err := client.Guardians(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
+ if err := req.ParseForm(); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+ if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Members_0); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+
+ msg, err := client.Members(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
-func local_request_Query_Guardians_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
- var protoReq QueryGuardiansRequest
+func local_request_Query_Members_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq QueryMembersRequest
var metadata runtime.ServerMetadata
- msg, err := server.Guardians(ctx, &protoReq)
+ if err := req.ParseForm(); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+ if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Members_0); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+
+ msg, err := server.Members(ctx, &protoReq)
return msg, metadata, err
}
-func request_Query_Operators_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
- var protoReq QueryOperatorsRequest
+func request_Query_Member_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq QueryMemberRequest
var metadata runtime.ServerMetadata
- msg, err := client.Operators(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
- return msg, metadata, err
+ var (
+ val string
+ ok bool
+ err error
+ _ = err
+ )
-}
+ val, ok = pathParams["address"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address")
+ }
-func local_request_Query_Operators_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
- var protoReq QueryOperatorsRequest
- var metadata runtime.ServerMetadata
+ protoReq.Address, err = runtime.String(val)
+
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err)
+ }
- msg, err := server.Operators(ctx, &protoReq)
+ msg, err := client.Member(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
-func request_Query_Judges_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
- var protoReq QueryJudgesRequest
+func local_request_Query_Member_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq QueryMemberRequest
var metadata runtime.ServerMetadata
- msg, err := client.Judges(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
- return msg, metadata, err
+ var (
+ val string
+ ok bool
+ err error
+ _ = err
+ )
-}
+ val, ok = pathParams["address"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address")
+ }
-func local_request_Query_Judges_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
- var protoReq QueryJudgesRequest
- var metadata runtime.ServerMetadata
+ protoReq.Address, err = runtime.String(val)
+
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err)
+ }
- msg, err := server.Judges(ctx, &protoReq)
+ msg, err := server.Member(ctx, &protoReq)
return msg, metadata, err
}
@@ -537,7 +573,7 @@ func request_Query_Proposal_0(ctx context.Context, marshaler runtime.Marshaler,
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id")
}
- protoReq.ProposalId, err = runtime.String(val)
+ protoReq.ProposalId, err = runtime.Uint64(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err)
@@ -564,7 +600,7 @@ func local_request_Query_Proposal_0(ctx context.Context, marshaler runtime.Marsh
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id")
}
- protoReq.ProposalId, err = runtime.String(val)
+ protoReq.ProposalId, err = runtime.Uint64(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err)
@@ -575,6 +611,154 @@ func local_request_Query_Proposal_0(ctx context.Context, marshaler runtime.Marsh
}
+func request_Query_Vote_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq QueryVoteRequest
+ var metadata runtime.ServerMetadata
+
+ var (
+ val string
+ ok bool
+ err error
+ _ = err
+ )
+
+ val, ok = pathParams["proposal_id"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id")
+ }
+
+ protoReq.ProposalId, err = runtime.Uint64(val)
+
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err)
+ }
+
+ val, ok = pathParams["voter"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "voter")
+ }
+
+ protoReq.Voter, err = runtime.String(val)
+
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "voter", err)
+ }
+
+ msg, err := client.Vote(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
+ return msg, metadata, err
+
+}
+
+func local_request_Query_Vote_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq QueryVoteRequest
+ var metadata runtime.ServerMetadata
+
+ var (
+ val string
+ ok bool
+ err error
+ _ = err
+ )
+
+ val, ok = pathParams["proposal_id"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id")
+ }
+
+ protoReq.ProposalId, err = runtime.Uint64(val)
+
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err)
+ }
+
+ val, ok = pathParams["voter"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "voter")
+ }
+
+ protoReq.Voter, err = runtime.String(val)
+
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "voter", err)
+ }
+
+ msg, err := server.Vote(ctx, &protoReq)
+ return msg, metadata, err
+
+}
+
+func request_Query_Votes_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq QueryVotesRequest
+ var metadata runtime.ServerMetadata
+
+ var (
+ val string
+ ok bool
+ err error
+ _ = err
+ )
+
+ val, ok = pathParams["proposal_id"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id")
+ }
+
+ protoReq.ProposalId, err = runtime.Uint64(val)
+
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err)
+ }
+
+ msg, err := client.Votes(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
+ return msg, metadata, err
+
+}
+
+func local_request_Query_Votes_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq QueryVotesRequest
+ var metadata runtime.ServerMetadata
+
+ var (
+ val string
+ ok bool
+ err error
+ _ = err
+ )
+
+ val, ok = pathParams["proposal_id"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id")
+ }
+
+ protoReq.ProposalId, err = runtime.Uint64(val)
+
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err)
+ }
+
+ msg, err := server.Votes(ctx, &protoReq)
+ return msg, metadata, err
+
+}
+
+func request_Query_BridgeStatus_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq QueryBridgeStatusRequest
+ var metadata runtime.ServerMetadata
+
+ msg, err := client.BridgeStatus(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
+ return msg, metadata, err
+
+}
+
+func local_request_Query_BridgeStatus_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq QueryBridgeStatusRequest
+ var metadata runtime.ServerMetadata
+
+ msg, err := server.BridgeStatus(ctx, &protoReq)
+ return msg, metadata, err
+
+}
+
// RegisterQueryHandlerServer registers the http handlers for service Query to "mux".
// UnaryRPC :call QueryServer directly.
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
@@ -761,7 +945,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv
})
- mux.Handle("GET", pattern_Query_Guardians_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ mux.Handle("GET", pattern_Query_Members_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
@@ -770,18 +954,18 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
- resp, md, err := local_request_Query_Guardians_0(rctx, inboundMarshaler, server, req, pathParams)
+ resp, md, err := local_request_Query_Members_0(rctx, inboundMarshaler, server, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
- forward_Query_Guardians_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+ forward_Query_Members_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
- mux.Handle("GET", pattern_Query_Operators_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ mux.Handle("GET", pattern_Query_Member_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
@@ -790,18 +974,18 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
- resp, md, err := local_request_Query_Operators_0(rctx, inboundMarshaler, server, req, pathParams)
+ resp, md, err := local_request_Query_Member_0(rctx, inboundMarshaler, server, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
- forward_Query_Operators_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+ forward_Query_Member_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
- mux.Handle("GET", pattern_Query_Judges_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ mux.Handle("GET", pattern_Query_Proposals_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
@@ -810,18 +994,18 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
- resp, md, err := local_request_Query_Judges_0(rctx, inboundMarshaler, server, req, pathParams)
+ resp, md, err := local_request_Query_Proposals_0(rctx, inboundMarshaler, server, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
- forward_Query_Judges_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+ forward_Query_Proposals_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
- mux.Handle("GET", pattern_Query_Proposals_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ mux.Handle("GET", pattern_Query_Proposal_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
@@ -830,18 +1014,18 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
- resp, md, err := local_request_Query_Proposals_0(rctx, inboundMarshaler, server, req, pathParams)
+ resp, md, err := local_request_Query_Proposal_0(rctx, inboundMarshaler, server, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
- forward_Query_Proposals_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+ forward_Query_Proposal_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
- mux.Handle("GET", pattern_Query_Proposal_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ mux.Handle("GET", pattern_Query_Vote_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
@@ -850,14 +1034,54 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
- resp, md, err := local_request_Query_Proposal_0(rctx, inboundMarshaler, server, req, pathParams)
+ resp, md, err := local_request_Query_Vote_0(rctx, inboundMarshaler, server, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
- forward_Query_Proposal_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+ forward_Query_Vote_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
+ mux.Handle("GET", pattern_Query_Votes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ ctx, cancel := context.WithCancel(req.Context())
+ defer cancel()
+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
+ rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := local_request_Query_Votes_0(rctx, inboundMarshaler, server, req, pathParams)
+ ctx = runtime.NewServerMetadataContext(ctx, md)
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_Query_Votes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
+ mux.Handle("GET", pattern_Query_BridgeStatus_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ ctx, cancel := context.WithCancel(req.Context())
+ defer cancel()
+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
+ rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := local_request_Query_BridgeStatus_0(rctx, inboundMarshaler, server, req, pathParams)
+ ctx = runtime.NewServerMetadataContext(ctx, md)
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_Query_BridgeStatus_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
@@ -1082,7 +1306,7 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie
})
- mux.Handle("GET", pattern_Query_Guardians_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ mux.Handle("GET", pattern_Query_Members_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
@@ -1091,18 +1315,18 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
- resp, md, err := request_Query_Guardians_0(rctx, inboundMarshaler, client, req, pathParams)
+ resp, md, err := request_Query_Members_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
- forward_Query_Guardians_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+ forward_Query_Members_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
- mux.Handle("GET", pattern_Query_Operators_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ mux.Handle("GET", pattern_Query_Member_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
@@ -1111,18 +1335,18 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
- resp, md, err := request_Query_Operators_0(rctx, inboundMarshaler, client, req, pathParams)
+ resp, md, err := request_Query_Member_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
- forward_Query_Operators_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+ forward_Query_Member_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
- mux.Handle("GET", pattern_Query_Judges_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ mux.Handle("GET", pattern_Query_Proposals_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
@@ -1131,18 +1355,18 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
- resp, md, err := request_Query_Judges_0(rctx, inboundMarshaler, client, req, pathParams)
+ resp, md, err := request_Query_Proposals_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
- forward_Query_Judges_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+ forward_Query_Proposals_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
- mux.Handle("GET", pattern_Query_Proposals_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ mux.Handle("GET", pattern_Query_Proposal_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
@@ -1151,18 +1375,18 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
- resp, md, err := request_Query_Proposals_0(rctx, inboundMarshaler, client, req, pathParams)
+ resp, md, err := request_Query_Proposal_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
- forward_Query_Proposals_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+ forward_Query_Proposal_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
- mux.Handle("GET", pattern_Query_Proposal_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ mux.Handle("GET", pattern_Query_Vote_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
@@ -1171,14 +1395,54 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
- resp, md, err := request_Query_Proposal_0(rctx, inboundMarshaler, client, req, pathParams)
+ resp, md, err := request_Query_Vote_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
- forward_Query_Proposal_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+ forward_Query_Vote_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
+ mux.Handle("GET", pattern_Query_Votes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ ctx, cancel := context.WithCancel(req.Context())
+ defer cancel()
+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
+ rctx, err := runtime.AnnotateContext(ctx, mux, req)
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := request_Query_Votes_0(rctx, inboundMarshaler, client, req, pathParams)
+ ctx = runtime.NewServerMetadataContext(ctx, md)
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_Query_Votes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
+ mux.Handle("GET", pattern_Query_BridgeStatus_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ ctx, cancel := context.WithCancel(req.Context())
+ defer cancel()
+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
+ rctx, err := runtime.AnnotateContext(ctx, mux, req)
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := request_Query_BridgeStatus_0(rctx, inboundMarshaler, client, req, pathParams)
+ ctx = runtime.NewServerMetadataContext(ctx, md)
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_Query_BridgeStatus_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
@@ -1204,15 +1468,19 @@ var (
pattern_Query_Commitments_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"lbm", "fbridge", "v1", "receiving", "commitments", "seq"}, "", runtime.AssumeColonVerbOpt(false)))
- pattern_Query_Guardians_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"lbm", "fbridge", "v1", "guardians"}, "", runtime.AssumeColonVerbOpt(false)))
+ pattern_Query_Members_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"lbm", "fbridge", "v1", "members"}, "", runtime.AssumeColonVerbOpt(false)))
+
+ pattern_Query_Member_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"lbm", "fbridge", "v1", "members", "address"}, "", runtime.AssumeColonVerbOpt(false)))
+
+ pattern_Query_Proposals_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"lbm", "fbridge", "v1", "proposals"}, "", runtime.AssumeColonVerbOpt(false)))
- pattern_Query_Operators_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"lbm", "fbridge", "v1", "operators"}, "", runtime.AssumeColonVerbOpt(false)))
+ pattern_Query_Proposal_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"lbm", "fbridge", "v1", "proposals", "proposal_id"}, "", runtime.AssumeColonVerbOpt(false)))
- pattern_Query_Judges_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"lbm", "fbridge", "v1", "judges"}, "", runtime.AssumeColonVerbOpt(false)))
+ pattern_Query_Vote_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6}, []string{"lbm", "fbridge", "v1", "proposals", "proposal_id", "votes", "voter"}, "", runtime.AssumeColonVerbOpt(false)))
- pattern_Query_Proposals_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"lbm", "fbridge", "v1", "role", "proposals"}, "", runtime.AssumeColonVerbOpt(false)))
+ pattern_Query_Votes_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"lbm", "fbridge", "v1", "proposals", "proposal_id", "votes"}, "", runtime.AssumeColonVerbOpt(false)))
- pattern_Query_Proposal_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"lbm", "fbridge", "v1", "role", "proposals", "proposal_id"}, "", runtime.AssumeColonVerbOpt(false)))
+ pattern_Query_BridgeStatus_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"lbm", "fbridge", "v1", "status"}, "", runtime.AssumeColonVerbOpt(false)))
)
var (
@@ -1234,13 +1502,17 @@ var (
forward_Query_Commitments_0 = runtime.ForwardResponseMessage
- forward_Query_Guardians_0 = runtime.ForwardResponseMessage
+ forward_Query_Members_0 = runtime.ForwardResponseMessage
- forward_Query_Operators_0 = runtime.ForwardResponseMessage
-
- forward_Query_Judges_0 = runtime.ForwardResponseMessage
+ forward_Query_Member_0 = runtime.ForwardResponseMessage
forward_Query_Proposals_0 = runtime.ForwardResponseMessage
forward_Query_Proposal_0 = runtime.ForwardResponseMessage
+
+ forward_Query_Vote_0 = runtime.ForwardResponseMessage
+
+ forward_Query_Votes_0 = runtime.ForwardResponseMessage
+
+ forward_Query_BridgeStatus_0 = runtime.ForwardResponseMessage
)
diff --git a/x/fbridge/types/tx.pb.go b/x/fbridge/types/tx.pb.go
index 91346052d5..150c4f9476 100644
--- a/x/fbridge/types/tx.pb.go
+++ b/x/fbridge/types/tx.pb.go
@@ -753,7 +753,7 @@ func (m *MsgSuggestRole) GetRole() Role {
if m != nil {
return m.Role
}
- return Role_UNSPECIFIED
+ return RoleEmpty
}
type MsgSuggestRoleResponse struct {
@@ -798,9 +798,7 @@ type MsgAddVoteForRole struct {
// the proposal ID
ProposalId uint64 `protobuf:"varint,2,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"`
// the vote option
- // - yes : true
- // - no : false
- Option bool `protobuf:"varint,3,opt,name=option,proto3" json:"option,omitempty"`
+ Option VoteOption `protobuf:"varint,3,opt,name=option,proto3,enum=lbm.fbridge.v1.VoteOption" json:"option,omitempty"`
}
func (m *MsgAddVoteForRole) Reset() { *m = MsgAddVoteForRole{} }
@@ -850,11 +848,11 @@ func (m *MsgAddVoteForRole) GetProposalId() uint64 {
return 0
}
-func (m *MsgAddVoteForRole) GetOption() bool {
+func (m *MsgAddVoteForRole) GetOption() VoteOption {
if m != nil {
return m.Option
}
- return false
+ return OptionEmpty
}
type MsgAddVoteForRoleResponse struct {
@@ -893,24 +891,25 @@ func (m *MsgAddVoteForRoleResponse) XXX_DiscardUnknown() {
var xxx_messageInfo_MsgAddVoteForRoleResponse proto.InternalMessageInfo
-// MsgHalt is input values required for halting the bridge module
-type MsgHalt struct {
+// MsgSetBridgeStatus is input values required for setting the status of the bridge module
+type MsgSetBridgeStatus struct {
// the guardian address
- Guardian string `protobuf:"bytes,1,opt,name=guardian,proto3" json:"guardian,omitempty"`
+ Guardian string `protobuf:"bytes,1,opt,name=guardian,proto3" json:"guardian,omitempty"`
+ Status BridgeStatus `protobuf:"varint,2,opt,name=status,proto3,enum=lbm.fbridge.v1.BridgeStatus" json:"status,omitempty"`
}
-func (m *MsgHalt) Reset() { *m = MsgHalt{} }
-func (m *MsgHalt) String() string { return proto.CompactTextString(m) }
-func (*MsgHalt) ProtoMessage() {}
-func (*MsgHalt) Descriptor() ([]byte, []int) {
+func (m *MsgSetBridgeStatus) Reset() { *m = MsgSetBridgeStatus{} }
+func (m *MsgSetBridgeStatus) String() string { return proto.CompactTextString(m) }
+func (*MsgSetBridgeStatus) ProtoMessage() {}
+func (*MsgSetBridgeStatus) Descriptor() ([]byte, []int) {
return fileDescriptor_54a336bc5ea063bb, []int{18}
}
-func (m *MsgHalt) XXX_Unmarshal(b []byte) error {
+func (m *MsgSetBridgeStatus) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-func (m *MsgHalt) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+func (m *MsgSetBridgeStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
- return xxx_messageInfo_MsgHalt.Marshal(b, m, deterministic)
+ return xxx_messageInfo_MsgSetBridgeStatus.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
@@ -920,122 +919,47 @@ func (m *MsgHalt) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return b[:n], nil
}
}
-func (m *MsgHalt) XXX_Merge(src proto.Message) {
- xxx_messageInfo_MsgHalt.Merge(m, src)
+func (m *MsgSetBridgeStatus) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_MsgSetBridgeStatus.Merge(m, src)
}
-func (m *MsgHalt) XXX_Size() int {
+func (m *MsgSetBridgeStatus) XXX_Size() int {
return m.Size()
}
-func (m *MsgHalt) XXX_DiscardUnknown() {
- xxx_messageInfo_MsgHalt.DiscardUnknown(m)
+func (m *MsgSetBridgeStatus) XXX_DiscardUnknown() {
+ xxx_messageInfo_MsgSetBridgeStatus.DiscardUnknown(m)
}
-var xxx_messageInfo_MsgHalt proto.InternalMessageInfo
+var xxx_messageInfo_MsgSetBridgeStatus proto.InternalMessageInfo
-func (m *MsgHalt) GetGuardian() string {
+func (m *MsgSetBridgeStatus) GetGuardian() string {
if m != nil {
return m.Guardian
}
return ""
}
-type MsgHaltResponse struct {
-}
-
-func (m *MsgHaltResponse) Reset() { *m = MsgHaltResponse{} }
-func (m *MsgHaltResponse) String() string { return proto.CompactTextString(m) }
-func (*MsgHaltResponse) ProtoMessage() {}
-func (*MsgHaltResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_54a336bc5ea063bb, []int{19}
-}
-func (m *MsgHaltResponse) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *MsgHaltResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_MsgHaltResponse.Marshal(b, m, deterministic)
- } else {
- b = b[:cap(b)]
- n, err := m.MarshalToSizedBuffer(b)
- if err != nil {
- return nil, err
- }
- return b[:n], nil
- }
-}
-func (m *MsgHaltResponse) XXX_Merge(src proto.Message) {
- xxx_messageInfo_MsgHaltResponse.Merge(m, src)
-}
-func (m *MsgHaltResponse) XXX_Size() int {
- return m.Size()
-}
-func (m *MsgHaltResponse) XXX_DiscardUnknown() {
- xxx_messageInfo_MsgHaltResponse.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_MsgHaltResponse proto.InternalMessageInfo
-
-// MsgResume is input values required for resuming the bridge module
-type MsgResume struct {
- // the guardian address
- From string `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"`
-}
-
-func (m *MsgResume) Reset() { *m = MsgResume{} }
-func (m *MsgResume) String() string { return proto.CompactTextString(m) }
-func (*MsgResume) ProtoMessage() {}
-func (*MsgResume) Descriptor() ([]byte, []int) {
- return fileDescriptor_54a336bc5ea063bb, []int{20}
-}
-func (m *MsgResume) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *MsgResume) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_MsgResume.Marshal(b, m, deterministic)
- } else {
- b = b[:cap(b)]
- n, err := m.MarshalToSizedBuffer(b)
- if err != nil {
- return nil, err
- }
- return b[:n], nil
- }
-}
-func (m *MsgResume) XXX_Merge(src proto.Message) {
- xxx_messageInfo_MsgResume.Merge(m, src)
-}
-func (m *MsgResume) XXX_Size() int {
- return m.Size()
-}
-func (m *MsgResume) XXX_DiscardUnknown() {
- xxx_messageInfo_MsgResume.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_MsgResume proto.InternalMessageInfo
-
-func (m *MsgResume) GetFrom() string {
+func (m *MsgSetBridgeStatus) GetStatus() BridgeStatus {
if m != nil {
- return m.From
+ return m.Status
}
- return ""
+ return StatusEmpty
}
-type MsgResumeResponse struct {
+type MsgSetBridgeStatusResponse struct {
}
-func (m *MsgResumeResponse) Reset() { *m = MsgResumeResponse{} }
-func (m *MsgResumeResponse) String() string { return proto.CompactTextString(m) }
-func (*MsgResumeResponse) ProtoMessage() {}
-func (*MsgResumeResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_54a336bc5ea063bb, []int{21}
+func (m *MsgSetBridgeStatusResponse) Reset() { *m = MsgSetBridgeStatusResponse{} }
+func (m *MsgSetBridgeStatusResponse) String() string { return proto.CompactTextString(m) }
+func (*MsgSetBridgeStatusResponse) ProtoMessage() {}
+func (*MsgSetBridgeStatusResponse) Descriptor() ([]byte, []int) {
+ return fileDescriptor_54a336bc5ea063bb, []int{19}
}
-func (m *MsgResumeResponse) XXX_Unmarshal(b []byte) error {
+func (m *MsgSetBridgeStatusResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-func (m *MsgResumeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+func (m *MsgSetBridgeStatusResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
- return xxx_messageInfo_MsgResumeResponse.Marshal(b, m, deterministic)
+ return xxx_messageInfo_MsgSetBridgeStatusResponse.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
@@ -1045,17 +969,17 @@ func (m *MsgResumeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, e
return b[:n], nil
}
}
-func (m *MsgResumeResponse) XXX_Merge(src proto.Message) {
- xxx_messageInfo_MsgResumeResponse.Merge(m, src)
+func (m *MsgSetBridgeStatusResponse) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_MsgSetBridgeStatusResponse.Merge(m, src)
}
-func (m *MsgResumeResponse) XXX_Size() int {
+func (m *MsgSetBridgeStatusResponse) XXX_Size() int {
return m.Size()
}
-func (m *MsgResumeResponse) XXX_DiscardUnknown() {
- xxx_messageInfo_MsgResumeResponse.DiscardUnknown(m)
+func (m *MsgSetBridgeStatusResponse) XXX_DiscardUnknown() {
+ xxx_messageInfo_MsgSetBridgeStatusResponse.DiscardUnknown(m)
}
-var xxx_messageInfo_MsgResumeResponse proto.InternalMessageInfo
+var xxx_messageInfo_MsgSetBridgeStatusResponse proto.InternalMessageInfo
func init() {
proto.RegisterType((*MsgTransfer)(nil), "lbm.fbridge.v1.MsgTransfer")
@@ -1076,64 +1000,61 @@ func init() {
proto.RegisterType((*MsgSuggestRoleResponse)(nil), "lbm.fbridge.v1.MsgSuggestRoleResponse")
proto.RegisterType((*MsgAddVoteForRole)(nil), "lbm.fbridge.v1.MsgAddVoteForRole")
proto.RegisterType((*MsgAddVoteForRoleResponse)(nil), "lbm.fbridge.v1.MsgAddVoteForRoleResponse")
- proto.RegisterType((*MsgHalt)(nil), "lbm.fbridge.v1.MsgHalt")
- proto.RegisterType((*MsgHaltResponse)(nil), "lbm.fbridge.v1.MsgHaltResponse")
- proto.RegisterType((*MsgResume)(nil), "lbm.fbridge.v1.MsgResume")
- proto.RegisterType((*MsgResumeResponse)(nil), "lbm.fbridge.v1.MsgResumeResponse")
+ proto.RegisterType((*MsgSetBridgeStatus)(nil), "lbm.fbridge.v1.MsgSetBridgeStatus")
+ proto.RegisterType((*MsgSetBridgeStatusResponse)(nil), "lbm.fbridge.v1.MsgSetBridgeStatusResponse")
}
func init() { proto.RegisterFile("lbm/fbridge/v1/tx.proto", fileDescriptor_54a336bc5ea063bb) }
var fileDescriptor_54a336bc5ea063bb = []byte{
- // 757 bytes of a gzipped FileDescriptorProto
+ // 752 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0xcd, 0x4e, 0xdb, 0x4a,
- 0x14, 0x4e, 0x6e, 0x42, 0x48, 0x0e, 0xdc, 0x00, 0x06, 0x92, 0x60, 0x20, 0x01, 0xdf, 0xcb, 0xbd,
- 0x14, 0xa9, 0x09, 0xd0, 0x45, 0xa5, 0xae, 0xda, 0x20, 0xa1, 0x82, 0x6a, 0xb5, 0x72, 0x7f, 0x54,
- 0x75, 0x51, 0x3a, 0x89, 0x27, 0x83, 0x55, 0xdb, 0x93, 0x7a, 0x26, 0x51, 0xfa, 0x10, 0x95, 0xfa,
- 0x04, 0x7d, 0x8a, 0x3e, 0x04, 0x4b, 0x96, 0x55, 0x17, 0xa8, 0x82, 0x17, 0xa9, 0xec, 0xd8, 0x83,
- 0x1d, 0xec, 0x04, 0xd4, 0xdd, 0x4c, 0xbe, 0x9f, 0x73, 0x8e, 0x67, 0xbe, 0xd8, 0x50, 0x36, 0x5b,
- 0x56, 0xa3, 0xd3, 0x72, 0x0c, 0x9d, 0xe0, 0x46, 0x7f, 0xaf, 0xc1, 0x07, 0xf5, 0xae, 0x43, 0x39,
- 0x95, 0x8a, 0x66, 0xcb, 0xaa, 0xfb, 0x40, 0xbd, 0xbf, 0x27, 0x2f, 0x11, 0x4a, 0xa8, 0x07, 0x35,
- 0xdc, 0xd5, 0x90, 0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x86, 0xd9,
+ 0xf0, 0xfc, 0x57, 0x13, 0x04, 0x21, 0x5c, 0xb9, 0x37, 0x1e, 0x97, 0xb6, 0xef, 0xa1, 0x18, 0x1b,
+ 0xea, 0xff, 0x12, 0x94, 0x51, 0x8a, 0xf2, 0x60, 0x22, 0x25, 0x7c, 0x64, 0xf1, 0xc9, 0x4c, 0x3a,
+ 0xb2, 0x18, 0x27, 0xf1, 0xc8, 0x52, 0x26, 0xaf, 0xb5, 0x7f, 0x72, 0x5e, 0xcd, 0x9e, 0x9e, 0x57,
+ 0xb3, 0x3f, 0xcf, 0xab, 0xd9, 0xaf, 0x17, 0xd5, 0xcc, 0xe9, 0x45, 0x35, 0xf3, 0xfd, 0xa2, 0x9a,
+ 0x79, 0xb7, 0x35, 0xf1, 0xd7, 0x72, 0x28, 0xff, 0x94, 0x04, 0xbf, 0x9b, 0xed, 0x42, 0xf0, 0x87,
+ 0xe4, 0xd1, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa9, 0xb2, 0x5f, 0xea, 0xef, 0x08, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
@@ -1168,10 +1089,9 @@ type MsgClient interface {
SuggestRole(ctx context.Context, in *MsgSuggestRole, opts ...grpc.CallOption) (*MsgSuggestRoleResponse, error)
// AddVoteForRole adds a vote for a role change proposal.
AddVoteForRole(ctx context.Context, in *MsgAddVoteForRole, opts ...grpc.CallOption) (*MsgAddVoteForRoleResponse, error)
- // Halt the bridge module.
- Halt(ctx context.Context, in *MsgHalt, opts ...grpc.CallOption) (*MsgHaltResponse, error)
- // Resume the bridge module.
- Resume(ctx context.Context, in *MsgResume, opts ...grpc.CallOption) (*MsgResumeResponse, error)
+ // SetBridgeStatus operates a switch to halt/resume the bridge module.
+ // If the ratio of inactive bridge switches exceed TrustLevel, the bridge module halts.
+ SetBridgeStatus(ctx context.Context, in *MsgSetBridgeStatus, opts ...grpc.CallOption) (*MsgSetBridgeStatusResponse, error)
}
type msgClient struct {
@@ -1263,18 +1183,9 @@ func (c *msgClient) AddVoteForRole(ctx context.Context, in *MsgAddVoteForRole, o
return out, nil
}
-func (c *msgClient) Halt(ctx context.Context, in *MsgHalt, opts ...grpc.CallOption) (*MsgHaltResponse, error) {
- out := new(MsgHaltResponse)
- err := c.cc.Invoke(ctx, "/lbm.fbridge.v1.Msg/Halt", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *msgClient) Resume(ctx context.Context, in *MsgResume, opts ...grpc.CallOption) (*MsgResumeResponse, error) {
- out := new(MsgResumeResponse)
- err := c.cc.Invoke(ctx, "/lbm.fbridge.v1.Msg/Resume", in, out, opts...)
+func (c *msgClient) SetBridgeStatus(ctx context.Context, in *MsgSetBridgeStatus, opts ...grpc.CallOption) (*MsgSetBridgeStatusResponse, error) {
+ out := new(MsgSetBridgeStatusResponse)
+ err := c.cc.Invoke(ctx, "/lbm.fbridge.v1.Msg/SetBridgeStatus", in, out, opts...)
if err != nil {
return nil, err
}
@@ -1303,10 +1214,9 @@ type MsgServer interface {
SuggestRole(context.Context, *MsgSuggestRole) (*MsgSuggestRoleResponse, error)
// AddVoteForRole adds a vote for a role change proposal.
AddVoteForRole(context.Context, *MsgAddVoteForRole) (*MsgAddVoteForRoleResponse, error)
- // Halt the bridge module.
- Halt(context.Context, *MsgHalt) (*MsgHaltResponse, error)
- // Resume the bridge module.
- Resume(context.Context, *MsgResume) (*MsgResumeResponse, error)
+ // SetBridgeStatus operates a switch to halt/resume the bridge module.
+ // If the ratio of inactive bridge switches exceed TrustLevel, the bridge module halts.
+ SetBridgeStatus(context.Context, *MsgSetBridgeStatus) (*MsgSetBridgeStatusResponse, error)
}
// UnimplementedMsgServer can be embedded to have forward compatible implementations.
@@ -1340,11 +1250,8 @@ func (*UnimplementedMsgServer) SuggestRole(ctx context.Context, req *MsgSuggestR
func (*UnimplementedMsgServer) AddVoteForRole(ctx context.Context, req *MsgAddVoteForRole) (*MsgAddVoteForRoleResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method AddVoteForRole not implemented")
}
-func (*UnimplementedMsgServer) Halt(ctx context.Context, req *MsgHalt) (*MsgHaltResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "method Halt not implemented")
-}
-func (*UnimplementedMsgServer) Resume(ctx context.Context, req *MsgResume) (*MsgResumeResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "method Resume not implemented")
+func (*UnimplementedMsgServer) SetBridgeStatus(ctx context.Context, req *MsgSetBridgeStatus) (*MsgSetBridgeStatusResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method SetBridgeStatus not implemented")
}
func RegisterMsgServer(s grpc1.Server, srv MsgServer) {
@@ -1513,38 +1420,20 @@ func _Msg_AddVoteForRole_Handler(srv interface{}, ctx context.Context, dec func(
return interceptor(ctx, in, info, handler)
}
-func _Msg_Halt_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(MsgHalt)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(MsgServer).Halt(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/lbm.fbridge.v1.Msg/Halt",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(MsgServer).Halt(ctx, req.(*MsgHalt))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _Msg_Resume_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(MsgResume)
+func _Msg_SetBridgeStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(MsgSetBridgeStatus)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
- return srv.(MsgServer).Resume(ctx, in)
+ return srv.(MsgServer).SetBridgeStatus(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
- FullMethod: "/lbm.fbridge.v1.Msg/Resume",
+ FullMethod: "/lbm.fbridge.v1.Msg/SetBridgeStatus",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(MsgServer).Resume(ctx, req.(*MsgResume))
+ return srv.(MsgServer).SetBridgeStatus(ctx, req.(*MsgSetBridgeStatus))
}
return interceptor(ctx, in, info, handler)
}
@@ -1590,12 +1479,8 @@ var _Msg_serviceDesc = grpc.ServiceDesc{
Handler: _Msg_AddVoteForRole_Handler,
},
{
- MethodName: "Halt",
- Handler: _Msg_Halt_Handler,
- },
- {
- MethodName: "Resume",
- Handler: _Msg_Resume_Handler,
+ MethodName: "SetBridgeStatus",
+ Handler: _Msg_SetBridgeStatus_Handler,
},
},
Streams: []grpc.StreamDesc{},
@@ -2129,13 +2014,8 @@ func (m *MsgAddVoteForRole) MarshalToSizedBuffer(dAtA []byte) (int, error) {
_ = i
var l int
_ = l
- if m.Option {
- i--
- if m.Option {
- dAtA[i] = 1
- } else {
- dAtA[i] = 0
- }
+ if m.Option != 0 {
+ i = encodeVarintTx(dAtA, i, uint64(m.Option))
i--
dAtA[i] = 0x18
}
@@ -2177,7 +2057,7 @@ func (m *MsgAddVoteForRoleResponse) MarshalToSizedBuffer(dAtA []byte) (int, erro
return len(dAtA) - i, nil
}
-func (m *MsgHalt) Marshal() (dAtA []byte, err error) {
+func (m *MsgSetBridgeStatus) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
@@ -2187,16 +2067,21 @@ func (m *MsgHalt) Marshal() (dAtA []byte, err error) {
return dAtA[:n], nil
}
-func (m *MsgHalt) MarshalTo(dAtA []byte) (int, error) {
+func (m *MsgSetBridgeStatus) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
-func (m *MsgHalt) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+func (m *MsgSetBridgeStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
+ if m.Status != 0 {
+ i = encodeVarintTx(dAtA, i, uint64(m.Status))
+ i--
+ dAtA[i] = 0x10
+ }
if len(m.Guardian) > 0 {
i -= len(m.Guardian)
copy(dAtA[i:], m.Guardian)
@@ -2207,60 +2092,7 @@ func (m *MsgHalt) MarshalToSizedBuffer(dAtA []byte) (int, error) {
return len(dAtA) - i, nil
}
-func (m *MsgHaltResponse) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalToSizedBuffer(dAtA[:size])
- if err != nil {
- return nil, err
- }
- return dAtA[:n], nil
-}
-
-func (m *MsgHaltResponse) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *MsgHaltResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- return len(dAtA) - i, nil
-}
-
-func (m *MsgResume) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalToSizedBuffer(dAtA[:size])
- if err != nil {
- return nil, err
- }
- return dAtA[:n], nil
-}
-
-func (m *MsgResume) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *MsgResume) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if len(m.From) > 0 {
- i -= len(m.From)
- copy(dAtA[i:], m.From)
- i = encodeVarintTx(dAtA, i, uint64(len(m.From)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *MsgResumeResponse) Marshal() (dAtA []byte, err error) {
+func (m *MsgSetBridgeStatusResponse) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
@@ -2270,12 +2102,12 @@ func (m *MsgResumeResponse) Marshal() (dAtA []byte, err error) {
return dAtA[:n], nil
}
-func (m *MsgResumeResponse) MarshalTo(dAtA []byte) (int, error) {
+func (m *MsgSetBridgeStatusResponse) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
-func (m *MsgResumeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+func (m *MsgSetBridgeStatusResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
@@ -2524,8 +2356,8 @@ func (m *MsgAddVoteForRole) Size() (n int) {
if m.ProposalId != 0 {
n += 1 + sovTx(uint64(m.ProposalId))
}
- if m.Option {
- n += 2
+ if m.Option != 0 {
+ n += 1 + sovTx(uint64(m.Option))
}
return n
}
@@ -2539,7 +2371,7 @@ func (m *MsgAddVoteForRoleResponse) Size() (n int) {
return n
}
-func (m *MsgHalt) Size() (n int) {
+func (m *MsgSetBridgeStatus) Size() (n int) {
if m == nil {
return 0
}
@@ -2549,32 +2381,13 @@ func (m *MsgHalt) Size() (n int) {
if l > 0 {
n += 1 + l + sovTx(uint64(l))
}
- return n
-}
-
-func (m *MsgHaltResponse) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- return n
-}
-
-func (m *MsgResume) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.From)
- if l > 0 {
- n += 1 + l + sovTx(uint64(l))
+ if m.Status != 0 {
+ n += 1 + sovTx(uint64(m.Status))
}
return n
}
-func (m *MsgResumeResponse) Size() (n int) {
+func (m *MsgSetBridgeStatusResponse) Size() (n int) {
if m == nil {
return 0
}
@@ -4058,7 +3871,7 @@ func (m *MsgAddVoteForRole) Unmarshal(dAtA []byte) error {
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Option", wireType)
}
- var v int
+ m.Option = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowTx
@@ -4068,12 +3881,11 @@ func (m *MsgAddVoteForRole) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
- v |= int(b&0x7F) << shift
+ m.Option |= VoteOption(b&0x7F) << shift
if b < 0x80 {
break
}
}
- m.Option = bool(v != 0)
default:
iNdEx = preIndex
skippy, err := skipTx(dAtA[iNdEx:])
@@ -4145,7 +3957,7 @@ func (m *MsgAddVoteForRoleResponse) Unmarshal(dAtA []byte) error {
}
return nil
}
-func (m *MsgHalt) Unmarshal(dAtA []byte) error {
+func (m *MsgSetBridgeStatus) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@@ -4168,10 +3980,10 @@ func (m *MsgHalt) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
- return fmt.Errorf("proto: MsgHalt: wiretype end group for non-group")
+ return fmt.Errorf("proto: MsgSetBridgeStatus: wiretype end group for non-group")
}
if fieldNum <= 0 {
- return fmt.Errorf("proto: MsgHalt: illegal tag %d (wire type %d)", fieldNum, wire)
+ return fmt.Errorf("proto: MsgSetBridgeStatus: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
@@ -4206,111 +4018,11 @@ func (m *MsgHalt) Unmarshal(dAtA []byte) error {
}
m.Guardian = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipTx(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if (skippy < 0) || (iNdEx+skippy) < 0 {
- return ErrInvalidLengthTx
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *MsgHaltResponse) Unmarshal(dAtA []byte) error {
- l := len(dAtA)
- iNdEx := 0
- for iNdEx < l {
- preIndex := iNdEx
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTx
- }
- if iNdEx >= l {
- return 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 fmt.Errorf("proto: MsgHaltResponse: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: MsgHaltResponse: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- default:
- iNdEx = preIndex
- skippy, err := skipTx(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if (skippy < 0) || (iNdEx+skippy) < 0 {
- return ErrInvalidLengthTx
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *MsgResume) Unmarshal(dAtA []byte) error {
- l := len(dAtA)
- iNdEx := 0
- for iNdEx < l {
- preIndex := iNdEx
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTx
- }
- if iNdEx >= l {
- return 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 fmt.Errorf("proto: MsgResume: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: MsgResume: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field From", wireType)
+ case 2:
+ if wireType != 0 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType)
}
- var stringLen uint64
+ m.Status = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowTx
@@ -4320,24 +4032,11 @@ func (m *MsgResume) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
- stringLen |= uint64(b&0x7F) << shift
+ m.Status |= BridgeStatus(b&0x7F) << shift
if b < 0x80 {
break
}
}
- intStringLen := int(stringLen)
- if intStringLen < 0 {
- return ErrInvalidLengthTx
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthTx
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.From = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipTx(dAtA[iNdEx:])
@@ -4359,7 +4058,7 @@ func (m *MsgResume) Unmarshal(dAtA []byte) error {
}
return nil
}
-func (m *MsgResumeResponse) Unmarshal(dAtA []byte) error {
+func (m *MsgSetBridgeStatusResponse) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@@ -4382,10 +4081,10 @@ func (m *MsgResumeResponse) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
- return fmt.Errorf("proto: MsgResumeResponse: wiretype end group for non-group")
+ return fmt.Errorf("proto: MsgSetBridgeStatusResponse: wiretype end group for non-group")
}
if fieldNum <= 0 {
- return fmt.Errorf("proto: MsgResumeResponse: illegal tag %d (wire type %d)", fieldNum, wire)
+ return fmt.Errorf("proto: MsgSetBridgeStatusResponse: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
default:
From 8ad5585c9e0772ba63c75d60a0cf8eb92417da3a Mon Sep 17 00:00:00 2001
From: Jaeseung Lee <41176085+tkxkd0159@users.noreply.github.com>
Date: Wed, 8 May 2024 16:59:32 +0900
Subject: [PATCH 03/10] fix: fbridge auth checking bug (#1361)
---
CHANGELOG.md | 1 +
x/fbridge/keeper/keeper.go | 5 +++
x/fbridge/keeper/keeper_test.go | 64 +++++++++++++++++++++++++++++++++
3 files changed, 70 insertions(+)
create mode 100644 x/fbridge/keeper/keeper_test.go
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 146a25d1a8..09ebbbc7d8 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -81,6 +81,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (x/auth) [#1319](https://github.com/Finschia/finschia-sdk/pull/1319) prevent signing from wrong key in multisig
* (x/mint, x/slashing) [\#1323](https://github.com/Finschia/finschia-sdk/pull/1323) add missing nil check for params validation
* (x/server) [\#1337](https://github.com/Finschia/finschia-sdk/pull/1337) fix panic when defining minimum gas config as `100stake;100uatom`. Use a `,` delimiter instead of `;`. Fixes the server config getter to use the correct delimiter (backport cosmos/cosmos-sdk#18537)
+* (x/fbridge) [\#1361](https://github.com/Finschia/finschia-sdk/pull/1361) Fixes fbridge auth checking bug
### Removed
diff --git a/x/fbridge/keeper/keeper.go b/x/fbridge/keeper/keeper.go
index 18cc8e0ef9..a226a1809e 100644
--- a/x/fbridge/keeper/keeper.go
+++ b/x/fbridge/keeper/keeper.go
@@ -37,10 +37,15 @@ func NewKeeper(
panic(errors.New("fbridge module account has not been set"))
}
+ found := false
for _, addr := range types.AuthorityCandiates() {
if authority == addr.String() {
+ found = true
break
}
+ }
+
+ if !found {
panic("x/bridge authority must be the gov or foundation module account")
}
diff --git a/x/fbridge/keeper/keeper_test.go b/x/fbridge/keeper/keeper_test.go
new file mode 100644
index 0000000000..f1e5891058
--- /dev/null
+++ b/x/fbridge/keeper/keeper_test.go
@@ -0,0 +1,64 @@
+package keeper_test
+
+import (
+ "testing"
+
+ "github.com/golang/mock/gomock"
+ "github.com/stretchr/testify/require"
+
+ authtypes "github.com/Finschia/finschia-sdk/x/auth/types"
+ "github.com/Finschia/finschia-sdk/x/fbridge/keeper"
+ "github.com/Finschia/finschia-sdk/x/fbridge/testutil"
+ "github.com/Finschia/finschia-sdk/x/fbridge/types"
+ "github.com/Finschia/finschia-sdk/x/foundation"
+ govtypes "github.com/Finschia/finschia-sdk/x/gov/types"
+)
+
+func TestNewKeeper(t *testing.T) {
+ key, memKey, _, encCfg, _, bankKeeper, _ := testutil.PrepareFbridgeTest(t, 0)
+ authKeeper := testutil.NewMockAccountKeeper(gomock.NewController(t))
+
+ tcs := map[string]struct {
+ malleate func()
+ isPanic bool
+ }{
+ "fbridge module account has not been set": {
+ malleate: func() {
+ authKeeper.EXPECT().GetModuleAddress(types.ModuleName).Return(nil).Times(1)
+ keeper.NewKeeper(encCfg.Codec, key, memKey, authKeeper, bankKeeper, "stake", types.DefaultAuthority().String())
+ },
+ isPanic: true,
+ },
+ "fbridge authority must be the gov or foundation module account": {
+ malleate: func() {
+ authKeeper.EXPECT().GetModuleAddress(types.ModuleName).Return(authtypes.NewModuleAddress(types.ModuleName)).Times(1)
+ keeper.NewKeeper(encCfg.Codec, key, memKey, authKeeper, bankKeeper, "stake", authtypes.NewModuleAddress("invalid").String())
+ },
+ isPanic: true,
+ },
+ "success - gov authority": {
+ malleate: func() {
+ authKeeper.EXPECT().GetModuleAddress(types.ModuleName).Return(authtypes.NewModuleAddress(types.ModuleName)).Times(1)
+ keeper.NewKeeper(encCfg.Codec, key, memKey, authKeeper, bankKeeper, "stake", authtypes.NewModuleAddress(govtypes.ModuleName).String())
+ },
+ isPanic: false,
+ },
+ "success - foundation authority": {
+ malleate: func() {
+ authKeeper.EXPECT().GetModuleAddress(types.ModuleName).Return(authtypes.NewModuleAddress(types.ModuleName)).Times(1)
+ keeper.NewKeeper(encCfg.Codec, key, memKey, authKeeper, bankKeeper, "stake", authtypes.NewModuleAddress(foundation.ModuleName).String())
+ },
+ isPanic: false,
+ },
+ }
+
+ for name, tc := range tcs {
+ t.Run(name, func(t *testing.T) {
+ if tc.isPanic {
+ require.Panics(t, tc.malleate)
+ } else {
+ tc.malleate()
+ }
+ })
+ }
+}
From 5e2cd7fe5ebe64fb042a40b7a1b106c6aa9f718e Mon Sep 17 00:00:00 2001
From: jaeseung-bae <119839167+jaeseung-bae@users.noreply.github.com>
Date: Wed, 8 May 2024 21:39:23 +0900
Subject: [PATCH 04/10] feat(x/fswap): introduce new event(MakeSwapProposal)
(#1363)
* feat(x/fswap): introduce new event(MakeSwapProposal)
* chore: lint proto
* chore: update proto-doc
* chore: update changelog
* chore: newline
* chore: update proto
* chore: make the event two separate events
---
CHANGELOG.md | 1 +
docs/core/proto-docs.md | 104 ++++++---
proto/lbm/fswap/v1/event.proto | 11 +
x/fswap/keeper/proposal.go | 8 +-
x/fswap/keeper/proposal_test.go | 33 ++-
x/fswap/types/event.pb.go | 392 ++++++++++++++++++++++++++++++--
6 files changed, 490 insertions(+), 59 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 09ebbbc7d8..c14f707a2f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -58,6 +58,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (server) [\#1175](https://github.com/Finschia/finschia-sdk/pull/1175) Use go embed for swagger
* (x/collection) [\#1287](https://github.com/Finschia/finschia-sdk/pull/1287) add nft id validation to MsgSendNFT
* (types) [\#1314](https://github.com/Finschia/finschia-sdk/pull/1314) replace IsEqual with Equal
+* (x/fswap) [\#1363](https://github.com/Finschia/finschia-sdk/pull/1363) introduce new event for MakeSwapProposal
### Bug Fixes
* chore(deps) [\#1141](https://github.com/Finschia/finschia-sdk/pull/1141) Bump github.com/cosmos/ledger-cosmos-go from 0.12.2 to 0.13.2 to fix ledger signing issue
diff --git a/docs/core/proto-docs.md b/docs/core/proto-docs.md
index 379b2d65ea..8494dbe2d0 100644
--- a/docs/core/proto-docs.md
+++ b/docs/core/proto-docs.md
@@ -950,15 +950,17 @@
- [Msg](#lbm.foundation.v1.Msg)
-- [lbm/fswap/v1/event.proto](#lbm/fswap/v1/event.proto)
- - [EventSwapCoins](#lbm.fswap.v1.EventSwapCoins)
-
- [lbm/fswap/v1/fswap.proto](#lbm/fswap/v1/fswap.proto)
- [MakeSwapProposal](#lbm.fswap.v1.MakeSwapProposal)
- [Swap](#lbm.fswap.v1.Swap)
- [SwapStats](#lbm.fswap.v1.SwapStats)
- [Swapped](#lbm.fswap.v1.Swapped)
+- [lbm/fswap/v1/event.proto](#lbm/fswap/v1/event.proto)
+ - [EventAddDenomMetadata](#lbm.fswap.v1.EventAddDenomMetadata)
+ - [EventMakeSwap](#lbm.fswap.v1.EventMakeSwap)
+ - [EventSwapCoins](#lbm.fswap.v1.EventSwapCoins)
+
- [lbm/fswap/v1/genesis.proto](#lbm/fswap/v1/genesis.proto)
- [GenesisState](#lbm.fswap.v1.GenesisState)
@@ -14120,39 +14122,6 @@ Msg defines the foundation Msg service.
-
-Top
-
-## lbm/fswap/v1/event.proto
-
-
-
-
-
-### EventSwapCoins
-
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| `address` | [string](#string) | | holder's address |
-| `from_coin_amount` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | | from-coin amount |
-| `to_coin_amount` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | | to-coin amount |
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Top
@@ -14226,6 +14195,69 @@ From cosmos-sdk 0.46.0 they deprecated this way, but currently finschia-sdk base
+
+
+
+
+
+
+
+
+
+
+
+Top
+
+## lbm/fswap/v1/event.proto
+
+
+
+
+
+### EventAddDenomMetadata
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| `metadata` | [cosmos.bank.v1beta1.Metadata](#cosmos.bank.v1beta1.Metadata) | | |
+
+
+
+
+
+
+
+
+### EventMakeSwap
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| `swap` | [Swap](#lbm.fswap.v1.Swap) | | |
+
+
+
+
+
+
+
+
+### EventSwapCoins
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| `address` | [string](#string) | | holder's address |
+| `from_coin_amount` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | | from-coin amount |
+| `to_coin_amount` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | | to-coin amount |
+
+
+
+
+
diff --git a/proto/lbm/fswap/v1/event.proto b/proto/lbm/fswap/v1/event.proto
index 6834da7654..10f9f3ea5d 100644
--- a/proto/lbm/fswap/v1/event.proto
+++ b/proto/lbm/fswap/v1/event.proto
@@ -5,6 +5,8 @@ option go_package = "github.com/Finschia/finschia-sdk/x/fswap/types";
import "gogoproto/gogo.proto";
import "cosmos/base/v1beta1/coin.proto";
+import "cosmos/bank/v1beta1/bank.proto";
+import "lbm/fswap/v1/fswap.proto";
message EventSwapCoins {
// holder's address
@@ -16,3 +18,12 @@ message EventSwapCoins {
cosmos.base.v1beta1.Coin to_coin_amount = 3
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/Finschia/finschia-sdk/types.Coin"];
}
+
+message EventMakeSwap {
+ Swap swap = 1 [(gogoproto.nullable) = false];
+}
+
+message EventAddDenomMetadata {
+ cosmos.bank.v1beta1.Metadata metadata = 1
+ [(gogoproto.moretags) = "yaml:\"denom_metadata\"", (gogoproto.nullable) = false];
+}
diff --git a/x/fswap/keeper/proposal.go b/x/fswap/keeper/proposal.go
index 1c726e67a6..836f10f0f5 100644
--- a/x/fswap/keeper/proposal.go
+++ b/x/fswap/keeper/proposal.go
@@ -49,19 +49,25 @@ func (k Keeper) MakeSwap(ctx sdk.Context, swap types.Swap, toDenomMetadata bank.
}
}
+ eventManager := ctx.EventManager()
if err := k.setSwap(ctx, swap); err != nil {
return err
}
+ if err := eventManager.EmitTypedEvent(&types.EventMakeSwap{Swap: swap}); err != nil {
+ panic(err)
+ }
existingMetadata, ok := k.GetDenomMetaData(ctx, swap.ToDenom)
if !ok {
k.SetDenomMetaData(ctx, toDenomMetadata)
+ if err := eventManager.EmitTypedEvent(&(types.EventAddDenomMetadata{Metadata: toDenomMetadata})); err != nil {
+ panic(err)
+ }
return nil
}
if !denomMetadataEqual(existingMetadata, toDenomMetadata) {
return errors.ErrInvalidRequest.Wrap("changing existing metadata not allowed")
}
-
return nil
}
diff --git a/x/fswap/keeper/proposal_test.go b/x/fswap/keeper/proposal_test.go
index 4dbe0e63b2..65be82d923 100644
--- a/x/fswap/keeper/proposal_test.go
+++ b/x/fswap/keeper/proposal_test.go
@@ -1,6 +1,8 @@
package keeper_test
import (
+ abci "github.com/tendermint/tendermint/abci/types"
+
sdk "github.com/Finschia/finschia-sdk/types"
sdkerrors "github.com/Finschia/finschia-sdk/types/errors"
bank "github.com/Finschia/finschia-sdk/x/bank/types"
@@ -13,6 +15,7 @@ func (s *KeeperTestSuite) TestMakeSwapProposal() {
toDenomMeta bank.Metadata
existingMetadata bool
expectedError error
+ expectedEvents sdk.Events
}{
"valid": {
types.Swap{
@@ -24,6 +27,28 @@ func (s *KeeperTestSuite) TestMakeSwapProposal() {
s.toDenomMetadata,
false,
nil,
+ sdk.Events{
+ sdk.Event{
+ Type: "lbm.fswap.v1.EventMakeSwap",
+ Attributes: []abci.EventAttribute{
+ {
+ Key: []byte("swap"),
+ Value: []uint8{0x7b, 0x22, 0x66, 0x72, 0x6f, 0x6d, 0x5f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x22, 0x3a, 0x22, 0x66, 0x72, 0x6f, 0x6d, 0x44, 0x22, 0x2c, 0x22, 0x74, 0x6f, 0x5f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x22, 0x3a, 0x22, 0x74, 0x6f, 0x44, 0x22, 0x2c, 0x22, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x63, 0x61, 0x70, 0x5f, 0x66, 0x6f, 0x72, 0x5f, 0x74, 0x6f, 0x5f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x22, 0x3a, 0x22, 0x31, 0x22, 0x2c, 0x22, 0x73, 0x77, 0x61, 0x70, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x22, 0x3a, 0x22, 0x31, 0x2e, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x22, 0x7d},
+ Index: false,
+ },
+ },
+ },
+ sdk.Event{
+ Type: "lbm.fswap.v1.EventAddDenomMetadata",
+ Attributes: []abci.EventAttribute{
+ {
+ Key: []byte("metadata"),
+ Value: []uint8{0x7b, 0x22, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x3a, 0x22, 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x6f, 0x2d, 0x63, 0x6f, 0x69, 0x6e, 0x22, 0x2c, 0x22, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x22, 0x3a, 0x5b, 0x7b, 0x22, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x22, 0x3a, 0x22, 0x74, 0x6f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x22, 0x2c, 0x22, 0x65, 0x78, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x22, 0x3a, 0x30, 0x2c, 0x22, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x65, 0x73, 0x22, 0x3a, 0x5b, 0x5d, 0x7d, 0x5d, 0x2c, 0x22, 0x62, 0x61, 0x73, 0x65, 0x22, 0x3a, 0x22, 0x64, 0x75, 0x6d, 0x6d, 0x79, 0x22, 0x2c, 0x22, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x22, 0x3a, 0x22, 0x64, 0x75, 0x6d, 0x6d, 0x79, 0x63, 0x6f, 0x69, 0x6e, 0x22, 0x2c, 0x22, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x3a, 0x22, 0x44, 0x55, 0x4d, 0x4d, 0x59, 0x22, 0x2c, 0x22, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x22, 0x3a, 0x22, 0x44, 0x55, 0x4d, 0x22, 0x7d},
+ Index: false,
+ },
+ },
+ },
+ },
},
"to-denom metadata change not allowed": {
types.Swap{
@@ -42,6 +67,7 @@ func (s *KeeperTestSuite) TestMakeSwapProposal() {
},
true,
sdkerrors.ErrInvalidRequest,
+ sdk.Events{},
},
}
for name, tc := range testCases {
@@ -51,9 +77,12 @@ func (s *KeeperTestSuite) TestMakeSwapProposal() {
if tc.existingMetadata {
err := s.keeper.MakeSwap(ctx, tc.swap, s.toDenomMetadata)
s.Require().ErrorIs(err, tc.expectedError)
- } else {
- s.Require().ErrorIs(err, tc.expectedError)
+ return
}
+
+ s.Require().ErrorIs(err, tc.expectedError)
+ events := ctx.EventManager().Events()
+ s.Require().Equal(tc.expectedEvents, events)
})
}
}
diff --git a/x/fswap/types/event.pb.go b/x/fswap/types/event.pb.go
index 6461787a83..a535059e7e 100644
--- a/x/fswap/types/event.pb.go
+++ b/x/fswap/types/event.pb.go
@@ -6,6 +6,7 @@ package types
import (
fmt "fmt"
types "github.com/Finschia/finschia-sdk/types"
+ types1 "github.com/Finschia/finschia-sdk/x/bank/types"
_ "github.com/gogo/protobuf/gogoproto"
proto "github.com/gogo/protobuf/proto"
io "io"
@@ -87,33 +88,130 @@ func (m *EventSwapCoins) GetToCoinAmount() types.Coin {
return types.Coin{}
}
+type EventMakeSwap struct {
+ Swap Swap `protobuf:"bytes,1,opt,name=swap,proto3" json:"swap"`
+}
+
+func (m *EventMakeSwap) Reset() { *m = EventMakeSwap{} }
+func (m *EventMakeSwap) String() string { return proto.CompactTextString(m) }
+func (*EventMakeSwap) ProtoMessage() {}
+func (*EventMakeSwap) Descriptor() ([]byte, []int) {
+ return fileDescriptor_92d5edbd64a725af, []int{1}
+}
+func (m *EventMakeSwap) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *EventMakeSwap) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ if deterministic {
+ return xxx_messageInfo_EventMakeSwap.Marshal(b, m, deterministic)
+ } else {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+ }
+}
+func (m *EventMakeSwap) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_EventMakeSwap.Merge(m, src)
+}
+func (m *EventMakeSwap) XXX_Size() int {
+ return m.Size()
+}
+func (m *EventMakeSwap) XXX_DiscardUnknown() {
+ xxx_messageInfo_EventMakeSwap.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_EventMakeSwap proto.InternalMessageInfo
+
+func (m *EventMakeSwap) GetSwap() Swap {
+ if m != nil {
+ return m.Swap
+ }
+ return Swap{}
+}
+
+type EventAddDenomMetadata struct {
+ Metadata types1.Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata" yaml:"denom_metadata"`
+}
+
+func (m *EventAddDenomMetadata) Reset() { *m = EventAddDenomMetadata{} }
+func (m *EventAddDenomMetadata) String() string { return proto.CompactTextString(m) }
+func (*EventAddDenomMetadata) ProtoMessage() {}
+func (*EventAddDenomMetadata) Descriptor() ([]byte, []int) {
+ return fileDescriptor_92d5edbd64a725af, []int{2}
+}
+func (m *EventAddDenomMetadata) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *EventAddDenomMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ if deterministic {
+ return xxx_messageInfo_EventAddDenomMetadata.Marshal(b, m, deterministic)
+ } else {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+ }
+}
+func (m *EventAddDenomMetadata) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_EventAddDenomMetadata.Merge(m, src)
+}
+func (m *EventAddDenomMetadata) XXX_Size() int {
+ return m.Size()
+}
+func (m *EventAddDenomMetadata) XXX_DiscardUnknown() {
+ xxx_messageInfo_EventAddDenomMetadata.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_EventAddDenomMetadata proto.InternalMessageInfo
+
+func (m *EventAddDenomMetadata) GetMetadata() types1.Metadata {
+ if m != nil {
+ return m.Metadata
+ }
+ return types1.Metadata{}
+}
+
func init() {
proto.RegisterType((*EventSwapCoins)(nil), "lbm.fswap.v1.EventSwapCoins")
+ proto.RegisterType((*EventMakeSwap)(nil), "lbm.fswap.v1.EventMakeSwap")
+ proto.RegisterType((*EventAddDenomMetadata)(nil), "lbm.fswap.v1.EventAddDenomMetadata")
}
func init() { proto.RegisterFile("lbm/fswap/v1/event.proto", fileDescriptor_92d5edbd64a725af) }
var fileDescriptor_92d5edbd64a725af = []byte{
- // 289 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x91, 0xc1, 0x4a, 0xc3, 0x30,
- 0x1c, 0xc6, 0x9b, 0x09, 0x8a, 0x75, 0x14, 0x29, 0x1e, 0xea, 0x0e, 0xd9, 0xf0, 0x34, 0x10, 0x13,
- 0xea, 0x9e, 0xc0, 0x89, 0xe2, 0x79, 0xde, 0xbc, 0x8c, 0xa4, 0x4d, 0xbb, 0xe2, 0xd2, 0x7f, 0x69,
- 0xb2, 0x6e, 0xbe, 0x85, 0x67, 0x1f, 0xc1, 0x27, 0xd9, 0x71, 0x47, 0x4f, 0x2a, 0xed, 0x8b, 0x48,
- 0xd2, 0x8a, 0x78, 0xf2, 0xe4, 0xed, 0x0b, 0x5f, 0xbe, 0xdf, 0x0f, 0x12, 0x37, 0x58, 0x72, 0x49,
- 0x13, 0xb5, 0x66, 0x05, 0xad, 0x42, 0x2a, 0x2a, 0x91, 0x6b, 0x52, 0x94, 0xa0, 0xc1, 0xef, 0x2f,
- 0xb9, 0x24, 0xb6, 0x21, 0x55, 0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6e, 0xac, 0xdc, 0x86, 0x47, 0x0b, 0x37, 0x38,
+ 0xb9, 0xf9, 0x3f, 0xd6, 0x3b, 0xc7, 0xdc, 0xec, 0x1c, 0xf3, 0x66, 0xe7, 0x98, 0x7f, 0xf7, 0x8e,
+ 0xb1, 0xd9, 0x3b, 0xc6, 0xd5, 0xde, 0x31, 0x7e, 0xc3, 0x47, 0x63, 0x58, 0x16, 0x3f, 0x44, 0xc7,
+ 0x11, 0x3e, 0xd7, 0xff, 0xa3, 0x77, 0x17, 0x00, 0x00, 0xff, 0xff, 0x9f, 0x45, 0x65, 0x5a, 0xb9,
+ 0x02, 0x00, 0x00,
}
func (m *EventSwapCoins) Marshal() (dAtA []byte, err error) {
@@ -166,6 +264,72 @@ func (m *EventSwapCoins) MarshalToSizedBuffer(dAtA []byte) (int, error) {
return len(dAtA) - i, nil
}
+func (m *EventMakeSwap) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *EventMakeSwap) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *EventMakeSwap) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ {
+ size, err := m.Swap.MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintEvent(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0xa
+ return len(dAtA) - i, nil
+}
+
+func (m *EventAddDenomMetadata) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *EventAddDenomMetadata) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *EventAddDenomMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ {
+ size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintEvent(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0xa
+ return len(dAtA) - i, nil
+}
+
func encodeVarintEvent(dAtA []byte, offset int, v uint64) int {
offset -= sovEvent(v)
base := offset
@@ -194,6 +358,28 @@ func (m *EventSwapCoins) Size() (n int) {
return n
}
+func (m *EventMakeSwap) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ l = m.Swap.Size()
+ n += 1 + l + sovEvent(uint64(l))
+ return n
+}
+
+func (m *EventAddDenomMetadata) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ l = m.Metadata.Size()
+ n += 1 + l + sovEvent(uint64(l))
+ return n
+}
+
func sovEvent(x uint64) (n int) {
return (math_bits.Len64(x|1) + 6) / 7
}
@@ -348,6 +534,172 @@ func (m *EventSwapCoins) Unmarshal(dAtA []byte) error {
}
return nil
}
+func (m *EventMakeSwap) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowEvent
+ }
+ if iNdEx >= l {
+ return 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 fmt.Errorf("proto: EventMakeSwap: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: EventMakeSwap: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Swap", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowEvent
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthEvent
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthEvent
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if err := m.Swap.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipEvent(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthEvent
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *EventAddDenomMetadata) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowEvent
+ }
+ if iNdEx >= l {
+ return 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 fmt.Errorf("proto: EventAddDenomMetadata: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: EventAddDenomMetadata: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowEvent
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthEvent
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthEvent
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipEvent(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthEvent
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
func skipEvent(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
From e31eb434ba0fc34408cfc302c8bca62f99a12cdc Mon Sep 17 00:00:00 2001
From: jaeseung-bae <119839167+jaeseung-bae@users.noreply.github.com>
Date: Thu, 9 May 2024 00:51:38 +0900
Subject: [PATCH 05/10] fix: update swap keys for possibly overlapped keys
(#1365)
* fix: update swap keys for possibly overlapped keys
* chore: lint fix
* chore: update changelog
* chore: use address.LengthPrefix to check length
* Revert "chore: use address.LengthPrefix to check length"
This reverts commit b33165bfea1bd671102f646cc140c4a0c5b79261.
* chore: add denom validation for string type denom
---
CHANGELOG.md | 1 +
x/fswap/keeper/grpc_query.go | 13 +++++++++
x/fswap/keeper/keys.go | 27 ++++++++++++++----
x/fswap/keeper/keys_test.go | 53 ++++++++++++++++++++++++++++++++++++
x/fswap/types/fswap.go | 13 ++++++---
x/fswap/types/msgs.go | 12 ++++----
6 files changed, 104 insertions(+), 15 deletions(-)
create mode 100644 x/fswap/keeper/keys_test.go
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c14f707a2f..9b21e67aa5 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -83,6 +83,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (x/mint, x/slashing) [\#1323](https://github.com/Finschia/finschia-sdk/pull/1323) add missing nil check for params validation
* (x/server) [\#1337](https://github.com/Finschia/finschia-sdk/pull/1337) fix panic when defining minimum gas config as `100stake;100uatom`. Use a `,` delimiter instead of `;`. Fixes the server config getter to use the correct delimiter (backport cosmos/cosmos-sdk#18537)
* (x/fbridge) [\#1361](https://github.com/Finschia/finschia-sdk/pull/1361) Fixes fbridge auth checking bug
+* (x/fswap) [\#1365](https://github.com/Finschia/finschia-sdk/pull/1365) fix update swap keys for possibly overlapped keys(`(hello,world) should be different to (hel,loworld)`)
### Removed
diff --git a/x/fswap/keeper/grpc_query.go b/x/fswap/keeper/grpc_query.go
index def3ee5ffb..8e2e94a5e2 100644
--- a/x/fswap/keeper/grpc_query.go
+++ b/x/fswap/keeper/grpc_query.go
@@ -5,6 +5,7 @@ import (
"github.com/Finschia/finschia-sdk/store/prefix"
sdk "github.com/Finschia/finschia-sdk/types"
+ sdkerrors "github.com/Finschia/finschia-sdk/types/errors"
"github.com/Finschia/finschia-sdk/types/query"
"github.com/Finschia/finschia-sdk/x/fswap/types"
)
@@ -23,6 +24,12 @@ func NewQueryServer(keeper Keeper) *QueryServer {
func (s QueryServer) Swapped(ctx context.Context, req *types.QuerySwappedRequest) (*types.QuerySwappedResponse, error) {
c := sdk.UnwrapSDKContext(ctx)
+ if err := sdk.ValidateDenom(req.GetFromDenom()); err != nil {
+ return nil, sdkerrors.ErrInvalidRequest.Wrap(err.Error())
+ }
+ if err := sdk.ValidateDenom(req.GetToDenom()); err != nil {
+ return nil, sdkerrors.ErrInvalidRequest.Wrap(err.Error())
+ }
swapped, err := s.Keeper.getSwapped(c, req.GetFromDenom(), req.GetToDenom())
if err != nil {
@@ -37,6 +44,12 @@ func (s QueryServer) Swapped(ctx context.Context, req *types.QuerySwappedRequest
func (s QueryServer) TotalSwappableToCoinAmount(ctx context.Context, req *types.QueryTotalSwappableToCoinAmountRequest) (*types.QueryTotalSwappableToCoinAmountResponse, error) {
c := sdk.UnwrapSDKContext(ctx)
+ if err := sdk.ValidateDenom(req.GetFromDenom()); err != nil {
+ return nil, sdkerrors.ErrInvalidRequest.Wrap(err.Error())
+ }
+ if err := sdk.ValidateDenom(req.GetToDenom()); err != nil {
+ return nil, sdkerrors.ErrInvalidRequest.Wrap(err.Error())
+ }
amount, err := s.Keeper.getSwappableNewCoinAmount(c, req.GetFromDenom(), req.GetToDenom())
if err != nil {
diff --git a/x/fswap/keeper/keys.go b/x/fswap/keeper/keys.go
index 04e36660f8..e9a4652926 100644
--- a/x/fswap/keeper/keys.go
+++ b/x/fswap/keeper/keys.go
@@ -8,12 +8,29 @@ var (
// swapKey key(prefix + fromDenom + toDenom)
func swapKey(fromDenom, toDenom string) []byte {
- key := append(swapPrefix, fromDenom...)
- return append(key, toDenom...)
+ denoms := combineDenoms(fromDenom, toDenom)
+ return append(swapPrefix, denoms...)
}
-// swappedKey key(prefix + fromDenom + toDenom)
+// swappedKey key(prefix + (lengthPrefixed+)fromDenom + (lengthPrefixed+)toDenom)
func swappedKey(fromDenom, toDenom string) []byte {
- key := append(swappedKeyPrefix, fromDenom...)
- return append(key, toDenom...)
+ denoms := combineDenoms(fromDenom, toDenom)
+ return append(swappedKeyPrefix, denoms...)
+}
+
+func combineDenoms(fromDenom, toDenom string) []byte {
+ lengthPrefixedFromDenom := lengthPrefix([]byte(fromDenom))
+ lengthPrefixedToDenom := lengthPrefix([]byte(toDenom))
+ return append(lengthPrefixedFromDenom, lengthPrefixedToDenom...)
+}
+
+// lengthPrefix prefixes the address bytes with its length, this is used
+// for example for variable-length components in store keys.
+func lengthPrefix(bz []byte) []byte {
+ bzLen := len(bz)
+ if bzLen == 0 {
+ return bz
+ }
+
+ return append([]byte{byte(bzLen)}, bz...)
}
diff --git a/x/fswap/keeper/keys_test.go b/x/fswap/keeper/keys_test.go
new file mode 100644
index 0000000000..9027b29a58
--- /dev/null
+++ b/x/fswap/keeper/keys_test.go
@@ -0,0 +1,53 @@
+package keeper
+
+import (
+ "testing"
+
+ "github.com/stretchr/testify/require"
+)
+
+func TestSwapKey(t *testing.T) {
+ tests := []struct {
+ name string
+ fromDenom string
+ toDenom string
+ expectedKey []byte
+ }{
+ {
+ name: "swapKey",
+ fromDenom: "cony",
+ toDenom: "peb",
+ expectedKey: []byte{0x1, 0x4, 0x63, 0x6f, 0x6e, 0x79, 0x3, 0x70, 0x65, 0x62},
+ // expectedKey: append(swapPrefix, append(append([]byte{byte(len("cony"))}, []byte("cony")...), append([]byte{byte(len("peb"))}, []byte("peb")...)...)...),
+ },
+ }
+ for _, tc := range tests {
+ t.Run(tc.name, func(t *testing.T) {
+ actualKey := swapKey(tc.fromDenom, tc.toDenom)
+ require.Equal(t, tc.expectedKey, actualKey)
+ })
+ }
+}
+
+func TestSwappedKey(t *testing.T) {
+ tests := []struct {
+ name string
+ fromDenom string
+ toDenom string
+ expectedKey []byte
+ }{
+ {
+ name: "swappedKey",
+ fromDenom: "cony",
+ toDenom: "peb",
+ expectedKey: []byte{0x3, 0x4, 0x63, 0x6f, 0x6e, 0x79, 0x3, 0x70, 0x65, 0x62},
+ // expectedKey: append(swappedKeyPrefix, append(append([]byte{byte(len("cony"))}, []byte("cony")...), append([]byte{byte(len("peb"))}, []byte("peb")...)...)...),
+ },
+ }
+ for _, tc := range tests {
+ t.Run(tc.name, func(t *testing.T) {
+ actualKey := swappedKey(tc.fromDenom, tc.toDenom)
+ require.Equal(t, tc.expectedKey, actualKey)
+ })
+ }
+}
diff --git a/x/fswap/types/fswap.go b/x/fswap/types/fswap.go
index c307c826b3..f45d2b2d89 100644
--- a/x/fswap/types/fswap.go
+++ b/x/fswap/types/fswap.go
@@ -9,21 +9,26 @@ import (
// ValidateBasic validates the set of Swap
func (s *Swap) ValidateBasic() error {
- if s.FromDenom == "" {
- return sdkerrors.ErrInvalidRequest.Wrap("from denomination cannot be empty")
+ if err := sdk.ValidateDenom(s.FromDenom); err != nil {
+ return sdkerrors.ErrInvalidRequest.Wrap(err.Error())
}
- if s.ToDenom == "" {
- return sdkerrors.ErrInvalidRequest.Wrap("to denomination cannot be empty")
+
+ if err := sdk.ValidateDenom(s.ToDenom); err != nil {
+ return sdkerrors.ErrInvalidRequest.Wrap(err.Error())
}
+
if s.FromDenom == s.ToDenom {
return sdkerrors.ErrInvalidRequest.Wrap("from denomination cannot be equal to to denomination")
}
+
if s.AmountCapForToDenom.LT(sdk.OneInt()) {
return sdkerrors.ErrInvalidRequest.Wrap("amount cannot be less than one")
}
+
if s.SwapRate.IsZero() {
return sdkerrors.ErrInvalidRequest.Wrap("swap rate cannot be zero")
}
+
return nil
}
diff --git a/x/fswap/types/msgs.go b/x/fswap/types/msgs.go
index eae8c6a2c2..f94e123cae 100644
--- a/x/fswap/types/msgs.go
+++ b/x/fswap/types/msgs.go
@@ -23,8 +23,8 @@ func (m *MsgSwap) ValidateBasic() error {
return sdkerrors.ErrInvalidCoins.Wrap(m.FromCoinAmount.String())
}
- if len(m.GetToDenom()) == 0 {
- return sdkerrors.ErrInvalidRequest.Wrap("invalid denom (empty denom)")
+ if err := sdk.ValidateDenom(m.GetToDenom()); err != nil {
+ return sdkerrors.ErrInvalidRequest.Wrap(err.Error())
}
return nil
@@ -53,12 +53,12 @@ func (m *MsgSwapAll) ValidateBasic() error {
return sdkerrors.ErrInvalidAddress.Wrapf("Invalid address (%s)", err)
}
- if len(m.GetFromDenom()) == 0 {
- return sdkerrors.ErrInvalidRequest.Wrap("invalid denom (empty denom)")
+ if err := sdk.ValidateDenom(m.FromDenom); err != nil {
+ return sdkerrors.ErrInvalidRequest.Wrap(err.Error())
}
- if len(m.GetToDenom()) == 0 {
- return sdkerrors.ErrInvalidRequest.Wrap("invalid denom (empty denom)")
+ if err := sdk.ValidateDenom(m.ToDenom); err != nil {
+ return sdkerrors.ErrInvalidRequest.Wrap(err.Error())
}
return nil
From a9be0cbf7712abe979d6e9d510c60b335c3adf27 Mon Sep 17 00:00:00 2001
From: Jaeseung Lee <41176085+tkxkd0159@users.noreply.github.com>
Date: Thu, 9 May 2024 01:12:06 +0900
Subject: [PATCH 06/10] feat(x/fbridge): set target denom as module parameters
(#1366)
* set fbridge target denom through params
* add UpdateParams
* add event and unittest
* use sdk denom checker
---
CHANGELOG.md | 1 +
docs/core/proto-docs.md | 48 +++
proto/lbm/fbridge/v1/event.proto | 4 +
proto/lbm/fbridge/v1/fbridge.proto | 2 +
proto/lbm/fbridge/v1/tx.proto | 15 +
simapp/app.go | 2 +-
x/fbridge/keeper/auth_test.go | 4 +-
x/fbridge/keeper/genesis.go | 5 +-
x/fbridge/keeper/keeper.go | 18 +-
x/fbridge/keeper/keeper_test.go | 8 +-
x/fbridge/keeper/msg_server.go | 23 ++
x/fbridge/keeper/params.go | 7 +-
x/fbridge/keeper/params_test.go | 119 +++++++
x/fbridge/keeper/transfer.go | 2 +-
x/fbridge/keeper/transfer_test.go | 6 +-
x/fbridge/types/codec.go | 2 +
x/fbridge/types/event.pb.go | 240 +++++++++++--
x/fbridge/types/fbridge.pb.go | 177 ++++++----
x/fbridge/types/genesis.go | 2 +-
x/fbridge/types/msgs.go | 11 +
x/fbridge/types/params.go | 18 +-
x/fbridge/types/tx.pb.go | 525 +++++++++++++++++++++++++----
22 files changed, 1047 insertions(+), 192 deletions(-)
create mode 100644 x/fbridge/keeper/params_test.go
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9b21e67aa5..950af9a8e9 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -59,6 +59,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (x/collection) [\#1287](https://github.com/Finschia/finschia-sdk/pull/1287) add nft id validation to MsgSendNFT
* (types) [\#1314](https://github.com/Finschia/finschia-sdk/pull/1314) replace IsEqual with Equal
* (x/fswap) [\#1363](https://github.com/Finschia/finschia-sdk/pull/1363) introduce new event for MakeSwapProposal
+* (x/fbridge) [\#1366](https://github.com/Finschia/finschia-sdk/pull/1366) Set target denom as module parameters
### Bug Fixes
* chore(deps) [\#1141](https://github.com/Finschia/finschia-sdk/pull/1141) Bump github.com/cosmos/ledger-cosmos-go from 0.12.2 to 0.13.2 to fix ledger signing issue
diff --git a/docs/core/proto-docs.md b/docs/core/proto-docs.md
index 8494dbe2d0..c9fd2b24ec 100644
--- a/docs/core/proto-docs.md
+++ b/docs/core/proto-docs.md
@@ -776,6 +776,7 @@
- [EventProvision](#lbm.fbridge.v1.EventProvision)
- [EventSuggestRole](#lbm.fbridge.v1.EventSuggestRole)
- [EventTransfer](#lbm.fbridge.v1.EventTransfer)
+ - [EventUpdateParams](#lbm.fbridge.v1.EventUpdateParams)
- [lbm/fbridge/v1/genesis.proto](#lbm/fbridge/v1/genesis.proto)
- [BlockSeqInfo](#lbm.fbridge.v1.BlockSeqInfo)
@@ -845,6 +846,8 @@
- [MsgSuggestRoleResponse](#lbm.fbridge.v1.MsgSuggestRoleResponse)
- [MsgTransfer](#lbm.fbridge.v1.MsgTransfer)
- [MsgTransferResponse](#lbm.fbridge.v1.MsgTransferResponse)
+ - [MsgUpdateParams](#lbm.fbridge.v1.MsgUpdateParams)
+ - [MsgUpdateParamsResponse](#lbm.fbridge.v1.MsgUpdateParamsResponse)
- [Msg](#lbm.fbridge.v1.Msg)
@@ -11451,6 +11454,7 @@ supports positive values.
| `judge_trust_level` | [Fraction](#lbm.fbridge.v1.Fraction) | | ratio of how many judges' confirmations are needed to be valid. |
| `timelock_period` | [uint64](#uint64) | | default timelock period for each provision (unix timestamp) |
| `proposal_period` | [uint64](#uint64) | | default period of the proposal to update the role |
+| `target_denom` | [string](#string) | | target denom of the bridge module. This is the base denom of Finschia normally. |
@@ -11719,6 +11723,21 @@ VoteOption enumerates the valid vote options for a given role proposal.
+
+
+
+### EventUpdateParams
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| `params` | [Params](#lbm.fbridge.v1.Params) | | |
+
+
+
+
+
@@ -12682,6 +12701,34 @@ MsgTransfer is input values required for bridge transfer
+
+
+
+### MsgUpdateParams
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| `authority` | [string](#string) | | the authority address |
+| `params` | [Params](#lbm.fbridge.v1.Params) | | params defines the x/fbridge parameters to update.
+
+NOTE: All parameters must be supplied. |
+
+
+
+
+
+
+
+
+### MsgUpdateParamsResponse
+
+
+
+
+
+
@@ -12696,6 +12743,7 @@ MsgTransfer is input values required for bridge transfer
| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint |
| ----------- | ------------ | ------------- | ------------| ------- | -------- |
+| `UpdateParams` | [MsgUpdateParams](#lbm.fbridge.v1.MsgUpdateParams) | [MsgUpdateParamsResponse](#lbm.fbridge.v1.MsgUpdateParamsResponse) | UpdateParams updates the x/fbridge parameters. | |
| `Transfer` | [MsgTransfer](#lbm.fbridge.v1.MsgTransfer) | [MsgTransferResponse](#lbm.fbridge.v1.MsgTransferResponse) | Submit a transfer request to the bridge module. | |
| `Provision` | [MsgProvision](#lbm.fbridge.v1.MsgProvision) | [MsgProvisionResponse](#lbm.fbridge.v1.MsgProvisionResponse) | Submit a provision to the bridge module. | |
| `HoldTransfer` | [MsgHoldTransfer](#lbm.fbridge.v1.MsgHoldTransfer) | [MsgHoldTransferResponse](#lbm.fbridge.v1.MsgHoldTransferResponse) | Set the time lock value from default value to uint64.max for specific confirmed provision. | |
diff --git a/proto/lbm/fbridge/v1/event.proto b/proto/lbm/fbridge/v1/event.proto
index 324a2db2a2..610039eb5b 100644
--- a/proto/lbm/fbridge/v1/event.proto
+++ b/proto/lbm/fbridge/v1/event.proto
@@ -6,6 +6,10 @@ option go_package = "github.com/Finschia/finschia-sdk/x/fbridge/types";
import "gogoproto/gogo.proto";
import "lbm/fbridge/v1/fbridge.proto";
+message EventUpdateParams {
+ Params params = 1 [(gogoproto.nullable) = false];
+}
+
message EventTransfer {
// the sequence number of the bridge request
uint64 seq = 1;
diff --git a/proto/lbm/fbridge/v1/fbridge.proto b/proto/lbm/fbridge/v1/fbridge.proto
index c3c4d5b6c7..d4bc9aa311 100644
--- a/proto/lbm/fbridge/v1/fbridge.proto
+++ b/proto/lbm/fbridge/v1/fbridge.proto
@@ -17,6 +17,8 @@ message Params {
uint64 timelock_period = 4;
// default period of the proposal to update the role
uint64 proposal_period = 5;
+ // target denom of the bridge module. This is the base denom of Finschia normally.
+ string target_denom = 6;
}
// Provision is a struct that represents a provision internally.
diff --git a/proto/lbm/fbridge/v1/tx.proto b/proto/lbm/fbridge/v1/tx.proto
index e1186ec588..6b63af8a5a 100644
--- a/proto/lbm/fbridge/v1/tx.proto
+++ b/proto/lbm/fbridge/v1/tx.proto
@@ -7,6 +7,9 @@ import "gogoproto/gogo.proto";
import "lbm/fbridge/v1/fbridge.proto";
service Msg {
+ // UpdateParams updates the x/fbridge parameters.
+ rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse);
+
// Submit a transfer request to the bridge module.
rpc Transfer(MsgTransfer) returns (MsgTransferResponse);
@@ -41,6 +44,18 @@ service Msg {
rpc SetBridgeStatus(MsgSetBridgeStatus) returns (MsgSetBridgeStatusResponse);
}
+message MsgUpdateParams {
+ // the authority address
+ string authority = 1;
+
+ // params defines the x/fbridge parameters to update.
+ //
+ // NOTE: All parameters must be supplied.
+ Params params = 2 [(gogoproto.nullable) = false];
+}
+
+message MsgUpdateParamsResponse {}
+
// MsgTransfer is input values required for bridge transfer
message MsgTransfer {
// the sender address on the source chain
diff --git a/simapp/app.go b/simapp/app.go
index 9b064b19b2..1a2a2ef53e 100644
--- a/simapp/app.go
+++ b/simapp/app.go
@@ -373,7 +373,7 @@ func NewSimApp(
// If evidence needs to be handled for the app, set routes in router here and seal
app.EvidenceKeeper = *evidenceKeeper
- app.FbridgeKeeper = fbridgekeeper.NewKeeper(appCodec, keys[fbridgetypes.StoreKey], memKeys[fbridgetypes.MemStoreKey], app.AccountKeeper, app.BankKeeper, "stake", fbridgetypes.DefaultAuthority().String())
+ app.FbridgeKeeper = fbridgekeeper.NewKeeper(appCodec, keys[fbridgetypes.StoreKey], memKeys[fbridgetypes.MemStoreKey], app.AccountKeeper, app.BankKeeper, fbridgetypes.DefaultAuthority().String())
/**** Module Options ****/
diff --git a/x/fbridge/keeper/auth_test.go b/x/fbridge/keeper/auth_test.go
index fb773014e3..de6d33001b 100644
--- a/x/fbridge/keeper/auth_test.go
+++ b/x/fbridge/keeper/auth_test.go
@@ -12,7 +12,7 @@ import (
func TestAssignRole(t *testing.T) {
key, memKey, ctx, encCfg, authKeeper, bankKeeper, addrs := testutil.PrepareFbridgeTest(t, 3)
auth := types.DefaultAuthority()
- k := NewKeeper(encCfg.Codec, key, memKey, authKeeper, bankKeeper, "stake", auth.String())
+ k := NewKeeper(encCfg.Codec, key, memKey, authKeeper, bankKeeper, auth.String())
err := k.InitGenesis(ctx, types.DefaultGenesisState())
require.NoError(t, err)
@@ -61,7 +61,7 @@ func TestAssignRole(t *testing.T) {
func TestBridgeHaltAndResume(t *testing.T) {
key, memKey, ctx, encCfg, authKeeper, bankKeeper, addrs := testutil.PrepareFbridgeTest(t, 3)
auth := types.DefaultAuthority()
- k := NewKeeper(encCfg.Codec, key, memKey, authKeeper, bankKeeper, "stake", auth.String())
+ k := NewKeeper(encCfg.Codec, key, memKey, authKeeper, bankKeeper, auth.String())
err := k.InitGenesis(ctx, types.DefaultGenesisState())
require.NoError(t, err)
for _, addr := range addrs {
diff --git a/x/fbridge/keeper/genesis.go b/x/fbridge/keeper/genesis.go
index 486f35ea68..479abedd8d 100644
--- a/x/fbridge/keeper/genesis.go
+++ b/x/fbridge/keeper/genesis.go
@@ -8,7 +8,10 @@ import (
)
func (k Keeper) InitGenesis(ctx sdk.Context, gs *types.GenesisState) error {
- k.SetParams(ctx, gs.Params)
+ if err := k.SetParams(ctx, gs.Params); err != nil {
+ return err
+ }
+
k.setNextSequence(ctx, gs.SendingState.NextSeq)
for _, info := range gs.SendingState.SeqToBlocknum {
k.setSeqToBlocknum(ctx, info.Seq, info.Blocknum)
diff --git a/x/fbridge/keeper/keeper.go b/x/fbridge/keeper/keeper.go
index a226a1809e..07efe19e5c 100644
--- a/x/fbridge/keeper/keeper.go
+++ b/x/fbridge/keeper/keeper.go
@@ -19,9 +19,6 @@ type Keeper struct {
authKeeper types.AccountKeeper
bankKeeper types.BankKeeper
- // the target denom for the bridge
- targetDenom string
-
// authority can give a role to a specific address like guardian
authority string
}
@@ -31,7 +28,7 @@ func NewKeeper(
key, memKey sdk.StoreKey,
authKeeper types.AccountKeeper,
bankKeeper types.BankKeeper,
- targetDenom, authority string,
+ authority string,
) Keeper {
if addr := authKeeper.GetModuleAddress(types.ModuleName); addr == nil {
panic(errors.New("fbridge module account has not been set"))
@@ -50,13 +47,12 @@ func NewKeeper(
}
return Keeper{
- storeKey: key,
- memKey: memKey,
- cdc: cdc,
- authKeeper: authKeeper,
- bankKeeper: bankKeeper,
- targetDenom: targetDenom,
- authority: authority,
+ storeKey: key,
+ memKey: memKey,
+ cdc: cdc,
+ authKeeper: authKeeper,
+ bankKeeper: bankKeeper,
+ authority: authority,
}
}
diff --git a/x/fbridge/keeper/keeper_test.go b/x/fbridge/keeper/keeper_test.go
index f1e5891058..dbdfb65969 100644
--- a/x/fbridge/keeper/keeper_test.go
+++ b/x/fbridge/keeper/keeper_test.go
@@ -25,28 +25,28 @@ func TestNewKeeper(t *testing.T) {
"fbridge module account has not been set": {
malleate: func() {
authKeeper.EXPECT().GetModuleAddress(types.ModuleName).Return(nil).Times(1)
- keeper.NewKeeper(encCfg.Codec, key, memKey, authKeeper, bankKeeper, "stake", types.DefaultAuthority().String())
+ keeper.NewKeeper(encCfg.Codec, key, memKey, authKeeper, bankKeeper, types.DefaultAuthority().String())
},
isPanic: true,
},
"fbridge authority must be the gov or foundation module account": {
malleate: func() {
authKeeper.EXPECT().GetModuleAddress(types.ModuleName).Return(authtypes.NewModuleAddress(types.ModuleName)).Times(1)
- keeper.NewKeeper(encCfg.Codec, key, memKey, authKeeper, bankKeeper, "stake", authtypes.NewModuleAddress("invalid").String())
+ keeper.NewKeeper(encCfg.Codec, key, memKey, authKeeper, bankKeeper, authtypes.NewModuleAddress("invalid").String())
},
isPanic: true,
},
"success - gov authority": {
malleate: func() {
authKeeper.EXPECT().GetModuleAddress(types.ModuleName).Return(authtypes.NewModuleAddress(types.ModuleName)).Times(1)
- keeper.NewKeeper(encCfg.Codec, key, memKey, authKeeper, bankKeeper, "stake", authtypes.NewModuleAddress(govtypes.ModuleName).String())
+ keeper.NewKeeper(encCfg.Codec, key, memKey, authKeeper, bankKeeper, authtypes.NewModuleAddress(govtypes.ModuleName).String())
},
isPanic: false,
},
"success - foundation authority": {
malleate: func() {
authKeeper.EXPECT().GetModuleAddress(types.ModuleName).Return(authtypes.NewModuleAddress(types.ModuleName)).Times(1)
- keeper.NewKeeper(encCfg.Codec, key, memKey, authKeeper, bankKeeper, "stake", authtypes.NewModuleAddress(foundation.ModuleName).String())
+ keeper.NewKeeper(encCfg.Codec, key, memKey, authKeeper, bankKeeper, authtypes.NewModuleAddress(foundation.ModuleName).String())
},
isPanic: false,
},
diff --git a/x/fbridge/keeper/msg_server.go b/x/fbridge/keeper/msg_server.go
index 5f6775f4bc..72fc696a00 100644
--- a/x/fbridge/keeper/msg_server.go
+++ b/x/fbridge/keeper/msg_server.go
@@ -2,6 +2,7 @@ package keeper
import (
"context"
+ "fmt"
sdk "github.com/Finschia/finschia-sdk/types"
sdkerrors "github.com/Finschia/finschia-sdk/types/errors"
@@ -18,6 +19,28 @@ func NewMsgServer(k Keeper) types.MsgServer {
return &msgServer{k}
}
+func (m msgServer) UpdateParams(goCtx context.Context, msg *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) {
+ ctx := sdk.UnwrapSDKContext(goCtx)
+
+ if msg.Authority != m.Keeper.GetAuthority() {
+ return nil, fmt.Errorf(
+ "invalid authority; expected %s, got %s",
+ m.Keeper.GetAuthority(), msg.Authority)
+ }
+
+ if err := m.Keeper.SetParams(ctx, msg.Params); err != nil {
+ return nil, err
+ }
+
+ if err := ctx.EventManager().EmitTypedEvent(&types.EventUpdateParams{
+ Params: msg.Params,
+ }); err != nil {
+ panic(err)
+ }
+
+ return &types.MsgUpdateParamsResponse{}, nil
+}
+
func (m msgServer) Transfer(goCtx context.Context, msg *types.MsgTransfer) (*types.MsgTransferResponse, error) {
ctx := sdk.UnwrapSDKContext(goCtx)
diff --git a/x/fbridge/keeper/params.go b/x/fbridge/keeper/params.go
index dcbfc093d7..41ecca2eef 100644
--- a/x/fbridge/keeper/params.go
+++ b/x/fbridge/keeper/params.go
@@ -5,10 +5,15 @@ import (
"github.com/Finschia/finschia-sdk/x/fbridge/types"
)
-func (k Keeper) SetParams(ctx sdk.Context, params types.Params) {
+func (k Keeper) SetParams(ctx sdk.Context, params types.Params) error {
+ if err := params.ValidateParams(); err != nil {
+ return err
+ }
+
store := ctx.KVStore(k.storeKey)
bz := k.cdc.MustMarshal(¶ms)
store.Set(types.KeyParams, bz)
+ return nil
}
func (k Keeper) GetParams(ctx sdk.Context) types.Params {
diff --git a/x/fbridge/keeper/params_test.go b/x/fbridge/keeper/params_test.go
new file mode 100644
index 0000000000..73be6d2d01
--- /dev/null
+++ b/x/fbridge/keeper/params_test.go
@@ -0,0 +1,119 @@
+package keeper
+
+import (
+ "testing"
+
+ "github.com/stretchr/testify/require"
+
+ "github.com/Finschia/finschia-sdk/x/fbridge/testutil"
+ "github.com/Finschia/finschia-sdk/x/fbridge/types"
+)
+
+func TestSetParams(t *testing.T) {
+ key, memKey, ctx, encCfg, authKeeper, bankKeeper, _ := testutil.PrepareFbridgeTest(t, 0)
+ keeper := NewKeeper(encCfg.Codec, key, memKey, authKeeper, bankKeeper, types.DefaultAuthority().String())
+
+ tcs := map[string]struct {
+ malleate func() types.Params
+ isErr bool
+ }{
+ "invalid guardian trust level": {
+ malleate: func() types.Params {
+ params := types.Params{}
+ params.GuardianTrustLevel = types.Fraction{Numerator: 4, Denominator: 3}
+ return params
+ },
+ isErr: true,
+ },
+ "invalid operator trust level": {
+ malleate: func() types.Params {
+ params := types.Params{}
+ params.GuardianTrustLevel = types.Fraction{Numerator: 2, Denominator: 3}
+ params.OperatorTrustLevel = types.Fraction{Numerator: 4, Denominator: 3}
+ return params
+ },
+ isErr: true,
+ },
+ "invalid judge trust level": {
+ malleate: func() types.Params {
+ params := types.Params{}
+ params.GuardianTrustLevel = types.Fraction{Numerator: 2, Denominator: 3}
+ params.OperatorTrustLevel = types.Fraction{Numerator: 2, Denominator: 3}
+ params.JudgeTrustLevel = types.Fraction{Numerator: 4, Denominator: 3}
+ return params
+ },
+ isErr: true,
+ },
+ "invalid proposal period": {
+ malleate: func() types.Params {
+ params := types.Params{}
+ params.GuardianTrustLevel = types.Fraction{Numerator: 2, Denominator: 3}
+ params.OperatorTrustLevel = types.Fraction{Numerator: 2, Denominator: 3}
+ params.JudgeTrustLevel = types.Fraction{Numerator: 2, Denominator: 3}
+ params.ProposalPeriod = 0
+ return params
+ },
+ isErr: true,
+ },
+ "invalid timelock period": {
+ malleate: func() types.Params {
+ params := types.Params{}
+ params.GuardianTrustLevel = types.Fraction{Numerator: 2, Denominator: 3}
+ params.OperatorTrustLevel = types.Fraction{Numerator: 2, Denominator: 3}
+ params.JudgeTrustLevel = types.Fraction{Numerator: 2, Denominator: 3}
+ params.ProposalPeriod = 10
+ params.TimelockPeriod = 0
+ return params
+ },
+ isErr: true,
+ },
+ "invalid target denom": {
+ malleate: func() types.Params {
+ params := types.Params{}
+ params.GuardianTrustLevel = types.Fraction{Numerator: 2, Denominator: 3}
+ params.OperatorTrustLevel = types.Fraction{Numerator: 2, Denominator: 3}
+ params.JudgeTrustLevel = types.Fraction{Numerator: 2, Denominator: 3}
+ params.ProposalPeriod = 10
+ params.TimelockPeriod = 20
+ params.TargetDenom = ""
+ return params
+ },
+ isErr: true,
+ },
+ "missing some fields": {
+ malleate: func() types.Params {
+ params := types.Params{}
+ params.GuardianTrustLevel = types.Fraction{Numerator: 2, Denominator: 3}
+ params.OperatorTrustLevel = types.Fraction{Numerator: 2, Denominator: 3}
+ params.JudgeTrustLevel = types.Fraction{Numerator: 2, Denominator: 3}
+ params.TimelockPeriod = 20
+ return params
+ },
+ isErr: true,
+ },
+ "valid": {
+ malleate: func() types.Params {
+ params := types.Params{}
+ params.GuardianTrustLevel = types.Fraction{Numerator: 2, Denominator: 3}
+ params.OperatorTrustLevel = types.Fraction{Numerator: 2, Denominator: 3}
+ params.JudgeTrustLevel = types.Fraction{Numerator: 2, Denominator: 3}
+ params.ProposalPeriod = 10
+ params.TimelockPeriod = 20
+ params.TargetDenom = "stake"
+ return params
+ },
+ isErr: false,
+ },
+ }
+
+ for name, tc := range tcs {
+ t.Run(name, func(t *testing.T) {
+ params := tc.malleate()
+ if tc.isErr {
+ require.Error(t, keeper.SetParams(ctx, params))
+ } else {
+ require.NoError(t, keeper.SetParams(ctx, params))
+ }
+ })
+ }
+}
diff --git a/x/fbridge/keeper/transfer.go b/x/fbridge/keeper/transfer.go
index 8e63588366..8dd492c499 100644
--- a/x/fbridge/keeper/transfer.go
+++ b/x/fbridge/keeper/transfer.go
@@ -17,7 +17,7 @@ import (
)
func (k Keeper) handleBridgeTransfer(ctx sdk.Context, sender sdk.AccAddress, amount sdk.Int) (uint64, error) {
- token := sdk.Coins{sdk.Coin{Denom: k.targetDenom, Amount: amount}}
+ token := sdk.Coins{sdk.Coin{Denom: k.GetParams(ctx).TargetDenom, Amount: amount}}
if err := k.bankKeeper.IsSendEnabledCoins(ctx, token...); err != nil {
return 0, err
}
diff --git a/x/fbridge/keeper/transfer_test.go b/x/fbridge/keeper/transfer_test.go
index 4466e3d06c..8d4fc4986d 100644
--- a/x/fbridge/keeper/transfer_test.go
+++ b/x/fbridge/keeper/transfer_test.go
@@ -23,7 +23,11 @@ func TestHandleBridgeTransfer(t *testing.T) {
bankKeeper.EXPECT().SendCoinsFromAccountToModule(ctx, sender, types.ModuleName, token).Return(nil)
bankKeeper.EXPECT().BurnCoins(ctx, types.ModuleName, token).Return(nil)
- k := NewKeeper(encCfg.Codec, key, memKey, authKeeper, bankKeeper, denom, types.DefaultAuthority().String())
+ k := NewKeeper(encCfg.Codec, key, memKey, authKeeper, bankKeeper, types.DefaultAuthority().String())
+ params := types.DefaultParams()
+ params.TargetDenom = denom
+ err := k.SetParams(ctx, params)
+ require.NoError(t, err)
targetSeq := uint64(2)
bz := make([]byte, 8)
binary.BigEndian.PutUint64(bz, targetSeq)
diff --git a/x/fbridge/types/codec.go b/x/fbridge/types/codec.go
index 745a212112..9dd9374b4d 100644
--- a/x/fbridge/types/codec.go
+++ b/x/fbridge/types/codec.go
@@ -13,6 +13,7 @@ import (
)
func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
+ legacy.RegisterAminoMsg(cdc, &MsgUpdateParams{}, "lbm-sdk/fbridge/MsgUpdateParams")
legacy.RegisterAminoMsg(cdc, &MsgTransfer{}, "lbm-sdk/MsgTransfer")
legacy.RegisterAminoMsg(cdc, &MsgProvision{}, "lbm-sdk/MsgProvision")
legacy.RegisterAminoMsg(cdc, &MsgHoldTransfer{}, "lbm-sdk/MsgHoldTransfer")
@@ -28,6 +29,7 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
func RegisterInterfaces(registrar types.InterfaceRegistry) {
registrar.RegisterImplementations(
(*sdk.Msg)(nil),
+ &MsgUpdateParams{},
&MsgTransfer{},
&MsgProvision{},
&MsgHoldTransfer{},
diff --git a/x/fbridge/types/event.pb.go b/x/fbridge/types/event.pb.go
index e82390f62a..4acb26aa67 100644
--- a/x/fbridge/types/event.pb.go
+++ b/x/fbridge/types/event.pb.go
@@ -23,6 +23,50 @@ var _ = math.Inf
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
+type EventUpdateParams struct {
+ Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"`
+}
+
+func (m *EventUpdateParams) Reset() { *m = EventUpdateParams{} }
+func (m *EventUpdateParams) String() string { return proto.CompactTextString(m) }
+func (*EventUpdateParams) ProtoMessage() {}
+func (*EventUpdateParams) Descriptor() ([]byte, []int) {
+ return fileDescriptor_a36aa6e56f2275b8, []int{0}
+}
+func (m *EventUpdateParams) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *EventUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ if deterministic {
+ return xxx_messageInfo_EventUpdateParams.Marshal(b, m, deterministic)
+ } else {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+ }
+}
+func (m *EventUpdateParams) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_EventUpdateParams.Merge(m, src)
+}
+func (m *EventUpdateParams) XXX_Size() int {
+ return m.Size()
+}
+func (m *EventUpdateParams) XXX_DiscardUnknown() {
+ xxx_messageInfo_EventUpdateParams.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_EventUpdateParams proto.InternalMessageInfo
+
+func (m *EventUpdateParams) GetParams() Params {
+ if m != nil {
+ return m.Params
+ }
+ return Params{}
+}
+
type EventTransfer struct {
// the sequence number of the bridge request
Seq uint64 `protobuf:"varint,1,opt,name=seq,proto3" json:"seq,omitempty"`
@@ -38,7 +82,7 @@ func (m *EventTransfer) Reset() { *m = EventTransfer{} }
func (m *EventTransfer) String() string { return proto.CompactTextString(m) }
func (*EventTransfer) ProtoMessage() {}
func (*EventTransfer) Descriptor() ([]byte, []int) {
- return fileDescriptor_a36aa6e56f2275b8, []int{0}
+ return fileDescriptor_a36aa6e56f2275b8, []int{1}
}
func (m *EventTransfer) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -103,7 +147,7 @@ func (m *EventSuggestRole) Reset() { *m = EventSuggestRole{} }
func (m *EventSuggestRole) String() string { return proto.CompactTextString(m) }
func (*EventSuggestRole) ProtoMessage() {}
func (*EventSuggestRole) Descriptor() ([]byte, []int) {
- return fileDescriptor_a36aa6e56f2275b8, []int{1}
+ return fileDescriptor_a36aa6e56f2275b8, []int{2}
}
func (m *EventSuggestRole) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -152,7 +196,7 @@ func (m *EventAddVoteForRole) Reset() { *m = EventAddVoteForRole{} }
func (m *EventAddVoteForRole) String() string { return proto.CompactTextString(m) }
func (*EventAddVoteForRole) ProtoMessage() {}
func (*EventAddVoteForRole) Descriptor() ([]byte, []int) {
- return fileDescriptor_a36aa6e56f2275b8, []int{2}
+ return fileDescriptor_a36aa6e56f2275b8, []int{3}
}
func (m *EventAddVoteForRole) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -219,7 +263,7 @@ func (m *EventProvision) Reset() { *m = EventProvision{} }
func (m *EventProvision) String() string { return proto.CompactTextString(m) }
func (*EventProvision) ProtoMessage() {}
func (*EventProvision) Descriptor() ([]byte, []int) {
- return fileDescriptor_a36aa6e56f2275b8, []int{3}
+ return fileDescriptor_a36aa6e56f2275b8, []int{4}
}
func (m *EventProvision) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -292,7 +336,7 @@ func (m *EventConfirmProvision) Reset() { *m = EventConfirmProvision{} }
func (m *EventConfirmProvision) String() string { return proto.CompactTextString(m) }
func (*EventConfirmProvision) ProtoMessage() {}
func (*EventConfirmProvision) Descriptor() ([]byte, []int) {
- return fileDescriptor_a36aa6e56f2275b8, []int{4}
+ return fileDescriptor_a36aa6e56f2275b8, []int{5}
}
func (m *EventConfirmProvision) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -343,7 +387,7 @@ func (m *EventClaim) Reset() { *m = EventClaim{} }
func (m *EventClaim) String() string { return proto.CompactTextString(m) }
func (*EventClaim) ProtoMessage() {}
func (*EventClaim) Descriptor() ([]byte, []int) {
- return fileDescriptor_a36aa6e56f2275b8, []int{5}
+ return fileDescriptor_a36aa6e56f2275b8, []int{6}
}
func (m *EventClaim) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -401,6 +445,7 @@ func (m *EventClaim) GetAmount() string {
}
func init() {
+ proto.RegisterType((*EventUpdateParams)(nil), "lbm.fbridge.v1.EventUpdateParams")
proto.RegisterType((*EventTransfer)(nil), "lbm.fbridge.v1.EventTransfer")
proto.RegisterType((*EventSuggestRole)(nil), "lbm.fbridge.v1.EventSuggestRole")
proto.RegisterType((*EventAddVoteForRole)(nil), "lbm.fbridge.v1.EventAddVoteForRole")
@@ -412,33 +457,68 @@ func init() {
func init() { proto.RegisterFile("lbm/fbridge/v1/event.proto", fileDescriptor_a36aa6e56f2275b8) }
var fileDescriptor_a36aa6e56f2275b8 = []byte{
- // 408 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x52, 0x3d, 0x6f, 0xd4, 0x40,
- 0x10, 0xf5, 0x12, 0xe7, 0x94, 0x4c, 0xc4, 0x29, 0x32, 0x01, 0x59, 0x56, 0xe4, 0x44, 0xae, 0x42,
- 0x81, 0x4d, 0x8e, 0x1e, 0x89, 0x20, 0x22, 0x41, 0x43, 0xb4, 0x20, 0x0a, 0x1a, 0x64, 0x9f, 0xc7,
- 0xce, 0x82, 0xbd, 0x63, 0x76, 0xf7, 0x2c, 0xe8, 0xa8, 0xa9, 0xf8, 0x59, 0x29, 0x53, 0x52, 0x21,
- 0x74, 0xf7, 0x47, 0x90, 0xd7, 0xf6, 0x49, 0x5c, 0x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0x81, 0x77, 0x02, 0x07,
- 0xa3, 0xf3, 0x93, 0xc8, 0xed, 0x49, 0x2e, 0x87, 0xf1, 0xd3, 0xeb, 0xdc, 0x9b, 0xc1, 0x84, 0x1a,
- 0x23, 0x48, 0xda, 0xa3, 0xa6, 0xb3, 0x60, 0xb3, 0x4c, 0xb7, 0xe3, 0xad, 0x55, 0xf0, 0x41, 0x19,
- 0xfd, 0x64, 0x30, 0xb5, 0x15, 0xae, 0x14, 0xb5, 0x42, 0x0b, 0x92, 0xdb, 0xfd, 0x8f, 0x9d, 0x87,
- 0x1a, 0x54, 0xa9, 0x21, 0xe5, 0xef, 0xf6, 0x9e, 0x11, 0x47, 0x8f, 0xe1, 0xa1, 0xed, 0xf2, 0x92,
- 0x64, 0x21, 0x54, 0x7d, 0x47, 0xa5, 0xe8, 0x33, 0x40, 0x2f, 0xad, 0x52, 0x51, 0x6f, 0xb7, 0xf2,
- 0xc5, 0x9b, 0x9b, 0x65, 0xc8, 0x6e, 0x97, 0x21, 0xfb, 0xbb, 0x0c, 0xd9, 0xaf, 0x55, 0xe8, 0xdc,
- 0xae, 0x42, 0xe7, 0xf7, 0x2a, 0x74, 0x3e, 0x3e, 0x2d, 0x85, 0xb9, 0x5e, 0x64, 0xf1, 0x9c, 0xea,
- 0xe4, 0x52, 0x48, 0x3d, 0xbf, 0x16, 0x69, 0x52, 0x0c, 0xc3, 0x13, 0x9d, 0x7f, 0x49, 0xbe, 0xad,
- 0x1f, 0xb0, 0xf9, 0xde, 0xa0, 0xce, 0x26, 0xf6, 0xf1, 0x3e, 0xfb, 0x17, 0x00, 0x00, 0xff, 0xff,
- 0x96, 0x66, 0x6c, 0xc3, 0x1e, 0x03, 0x00, 0x00,
+ // 439 bytes of a gzipped FileDescriptorProto
+ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x53, 0x3d, 0x6f, 0xd4, 0x40,
+ 0x10, 0x3d, 0x93, 0xcb, 0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x19, 0x38, 0x3f, 0x57, 0xc1, 0xe0, 0x66, 0x15,
+ 0x0c, 0x7e, 0xad, 0x82, 0xc1, 0x87, 0xc7, 0xb9, 0x34, 0x57, 0x8b, 0x34, 0x9a, 0x51, 0x19, 0x5f,
+ 0xc8, 0x4a, 0xcf, 0xae, 0xa4, 0x88, 0xe7, 0x76, 0x78, 0xa4, 0xb3, 0xcf, 0xf1, 0xd7, 0xf5, 0x5b,
+ 0x30, 0xdf, 0x6a, 0xd4, 0xe9, 0x88, 0xdf, 0xc1, 0x93, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x5d,
+ 0xc0, 0xfc, 0xbf, 0x69, 0x03, 0x00, 0x00,
+}
+
+func (m *EventUpdateParams) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *EventUpdateParams) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *EventUpdateParams) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ {
+ size, err := m.Params.MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintEvent(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0xa
+ return len(dAtA) - i, nil
}
func (m *EventTransfer) Marshal() (dAtA []byte, err error) {
@@ -707,6 +787,17 @@ func encodeVarintEvent(dAtA []byte, offset int, v uint64) int {
dAtA[offset] = uint8(v)
return base
}
+func (m *EventUpdateParams) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ l = m.Params.Size()
+ n += 1 + l + sovEvent(uint64(l))
+ return n
+}
+
func (m *EventTransfer) Size() (n int) {
if m == nil {
return 0
@@ -831,6 +922,89 @@ func sovEvent(x uint64) (n int) {
func sozEvent(x uint64) (n int) {
return sovEvent(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
+func (m *EventUpdateParams) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowEvent
+ }
+ if iNdEx >= l {
+ return 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 fmt.Errorf("proto: EventUpdateParams: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: EventUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowEvent
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthEvent
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthEvent
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipEvent(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthEvent
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
func (m *EventTransfer) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
diff --git a/x/fbridge/types/fbridge.pb.go b/x/fbridge/types/fbridge.pb.go
index e81d70a81b..e6d25ce279 100644
--- a/x/fbridge/types/fbridge.pb.go
+++ b/x/fbridge/types/fbridge.pb.go
@@ -134,6 +134,8 @@ type Params struct {
TimelockPeriod uint64 `protobuf:"varint,4,opt,name=timelock_period,json=timelockPeriod,proto3" json:"timelock_period,omitempty"`
// default period of the proposal to update the role
ProposalPeriod uint64 `protobuf:"varint,5,opt,name=proposal_period,json=proposalPeriod,proto3" json:"proposal_period,omitempty"`
+ // target denom of the bridge module. This is the base denom of Finschia normally.
+ TargetDenom string `protobuf:"bytes,6,opt,name=target_denom,json=targetDenom,proto3" json:"target_denom,omitempty"`
}
func (m *Params) Reset() { *m = Params{} }
@@ -204,6 +206,13 @@ func (m *Params) GetProposalPeriod() uint64 {
return 0
}
+func (m *Params) GetTargetDenom() string {
+ if m != nil {
+ return m.TargetDenom
+ }
+ return ""
+}
+
// Provision is a struct that represents a provision internally.
type ProvisionData struct {
// the sequence number of the bridge request
@@ -723,68 +732,69 @@ func init() {
func init() { proto.RegisterFile("lbm/fbridge/v1/fbridge.proto", fileDescriptor_62374d75fc6aa1ba) }
var fileDescriptor_62374d75fc6aa1ba = []byte{
- // 973 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x55, 0x4f, 0x6f, 0xe3, 0x44,
- 0x14, 0x8f, 0xb3, 0x6e, 0x49, 0x5e, 0xda, 0x34, 0x8c, 0xa2, 0xa5, 0x58, 0x4b, 0x12, 0x22, 0x21,
- 0xaa, 0x0a, 0x1c, 0x36, 0xdc, 0xb8, 0x25, 0xad, 0x5b, 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0xde, 0xfa, 0xd5, 0x7c, 0x9a, 0xff, 0x42, 0xe5, 0xf7, 0x73, 0xb6, 0x2d, 0x1f, 0xd3, 0x97, 0xff,
- 0x05, 0x00, 0x00, 0xff, 0xff, 0xfa, 0x2c, 0x09, 0x1f, 0x5e, 0x07, 0x00, 0x00,
+ // 990 bytes of a gzipped FileDescriptorProto
+ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x55, 0x4f, 0x8f, 0x22, 0x45,
+ 0x14, 0xa7, 0xd9, 0x1e, 0x84, 0xc7, 0x0c, 0x83, 0x15, 0xb2, 0x62, 0x67, 0x05, 0x24, 0x31, 0x4e,
+ 0x26, 0xda, 0xb8, 0x78, 0xf3, 0x06, 0x03, 0x33, 0x81, 0x28, 0x90, 0x1a, 0x66, 0x92, 0x35, 0x26,
+ 0xa4, 0xa1, 0x6b, 0xd8, 0x72, 0xe9, 0x2e, 0xac, 0x2e, 0x70, 0xd7, 0x0f, 0x60, 0xcc, 0x9c, 0xf6,
+ 0x0b, 0x90, 0xac, 0xf1, 0x93, 0x78, 0xdb, 0xe3, 0x1e, 0x8d, 0x87, 0xd5, 0xcc, 0x5c, 0xbc, 0xf8,
+ 0x1d, 0x4c, 0x55, 0x75, 0xf5, 0xc0, 0xc6, 0x64, 0xf7, 0x56, 0xef, 0xd5, 0xef, 0xfd, 0xde, 0xef,
+ 0xfd, 0xa9, 0x6e, 0x78, 0xb0, 0x98, 0x06, 0x8d, 0xab, 0x29, 0xa7, 0xfe, 0x9c, 0x34, 0xd6, 0x0f,
+ 0xcd, 0xd1, 0x5d, 0x72, 0x26, 0x18, 0x2a, 0x2c, 0xa6, 0x81, 0x6b, 0x5c, 0xeb, 0x87, 0x4e, 0x75,
+ 0xce, 0xd8, 0x7c, 0x41, 0x1a, 0xea, 0x76, 0xba, 0xba, 0x6a, 0x08, 0x1a, 0x90, 0x48, 0x78, 0xc1,
+ 0x52, 0x07, 0x38, 0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, 0x3b, 0xfb, 0xd7,
+ 0x9b, 0x5a, 0x56, 0x43, 0x06, 0x2c, 0x16, 0xf2, 0xc2, 0x82, 0xfd, 0xed, 0xf6, 0x22, 0x17, 0x3e,
+ 0x6c, 0xe3, 0x5e, 0xe7, 0xac, 0x3b, 0x39, 0x1f, 0xb7, 0xc6, 0x17, 0xe7, 0xff, 0x27, 0x46, 0x43,
+ 0xb5, 0x98, 0x63, 0x28, 0xed, 0xe2, 0x5b, 0x27, 0xe3, 0xde, 0x65, 0xd7, 0x74, 0x4d, 0x43, 0x5b,
+ 0x7a, 0x2c, 0x2e, 0xdc, 0xdf, 0xc5, 0xf6, 0x06, 0x31, 0x3a, 0xed, 0xa0, 0xeb, 0x4d, 0xad, 0xa0,
+ 0xd1, 0xbd, 0x78, 0x8c, 0x5a, 0x62, 0xbb, 0xff, 0xf2, 0xa6, 0x62, 0xbd, 0xba, 0xa9, 0x58, 0x7f,
+ 0xdf, 0x54, 0xac, 0xe7, 0xb7, 0x95, 0xd4, 0xab, 0xdb, 0x4a, 0xea, 0x8f, 0xdb, 0x4a, 0xea, 0xdb,
+ 0x2f, 0xde, 0xfa, 0xd5, 0x7c, 0x9a, 0xfc, 0x65, 0xd5, 0xf7, 0x73, 0x9a, 0x51, 0x8f, 0xe9, 0xcb,
+ 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0xfb, 0x54, 0x04, 0x35, 0x81, 0x07, 0x00, 0x00,
}
func (m *Params) Marshal() (dAtA []byte, err error) {
@@ -807,6 +817,13 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) {
_ = i
var l int
_ = l
+ if len(m.TargetDenom) > 0 {
+ i -= len(m.TargetDenom)
+ copy(dAtA[i:], m.TargetDenom)
+ i = encodeVarintFbridge(dAtA, i, uint64(len(m.TargetDenom)))
+ i--
+ dAtA[i] = 0x32
+ }
if m.ProposalPeriod != 0 {
i = encodeVarintFbridge(dAtA, i, uint64(m.ProposalPeriod))
i--
@@ -1208,6 +1225,10 @@ func (m *Params) Size() (n int) {
if m.ProposalPeriod != 0 {
n += 1 + sovFbridge(uint64(m.ProposalPeriod))
}
+ l = len(m.TargetDenom)
+ if l > 0 {
+ n += 1 + l + sovFbridge(uint64(l))
+ }
return n
}
@@ -1531,6 +1552,38 @@ func (m *Params) Unmarshal(dAtA []byte) error {
break
}
}
+ case 6:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field TargetDenom", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowFbridge
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthFbridge
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthFbridge
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.TargetDenom = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipFbridge(dAtA[iNdEx:])
diff --git a/x/fbridge/types/genesis.go b/x/fbridge/types/genesis.go
index 358f64b2fa..add124e461 100644
--- a/x/fbridge/types/genesis.go
+++ b/x/fbridge/types/genesis.go
@@ -32,7 +32,7 @@ func AuthorityCandiates() []sdk.AccAddress {
}
func ValidateGenesis(data GenesisState) error {
- if err := ValidateParams(data.Params); err != nil {
+ if err := data.Params.ValidateParams(); err != nil {
return err
}
diff --git a/x/fbridge/types/msgs.go b/x/fbridge/types/msgs.go
index 979176c073..12b0af12bc 100644
--- a/x/fbridge/types/msgs.go
+++ b/x/fbridge/types/msgs.go
@@ -3,6 +3,7 @@ package types
import sdk "github.com/Finschia/finschia-sdk/types"
var (
+ _ sdk.Msg = &MsgUpdateParams{}
_ sdk.Msg = &MsgTransfer{}
_ sdk.Msg = &MsgProvision{}
_ sdk.Msg = &MsgHoldTransfer{}
@@ -15,6 +16,16 @@ var (
_ sdk.Msg = &MsgSetBridgeStatus{}
)
+func (m MsgUpdateParams) ValidateBasic() error { return nil }
+
+func (m MsgUpdateParams) GetSigners() []sdk.AccAddress {
+ return []sdk.AccAddress{sdk.MustAccAddressFromBech32(m.Authority)}
+}
+
+func (m MsgUpdateParams) GetSignBytes() []byte {
+ return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&m))
+}
+
func (m MsgTransfer) ValidateBasic() error { return nil }
func (m MsgTransfer) GetSigners() []sdk.AccAddress {
diff --git a/x/fbridge/types/params.go b/x/fbridge/types/params.go
index 3ef148d1e8..d70df18bb8 100644
--- a/x/fbridge/types/params.go
+++ b/x/fbridge/types/params.go
@@ -3,6 +3,7 @@ package types
import (
"time"
+ sdktypes "github.com/Finschia/finschia-sdk/types"
sdkerrors "github.com/Finschia/finschia-sdk/types/errors"
)
@@ -13,30 +14,35 @@ func DefaultParams() Params {
JudgeTrustLevel: Fraction{Numerator: 1, Denominator: 1},
ProposalPeriod: uint64(time.Minute * 60),
TimelockPeriod: uint64(time.Hour * 24),
+ TargetDenom: sdktypes.DefaultBondDenom,
}
}
-func ValidateParams(params Params) error {
- if err := ValidateTrustLevel(params.GuardianTrustLevel); err != nil {
+func (p Params) ValidateParams() error {
+ if err := ValidateTrustLevel(p.GuardianTrustLevel); err != nil {
return sdkerrors.ErrInvalidRequest.Wrap("guardian trust level: " + err.Error())
}
- if err := ValidateTrustLevel(params.OperatorTrustLevel); err != nil {
+ if err := ValidateTrustLevel(p.OperatorTrustLevel); err != nil {
return sdkerrors.ErrInvalidRequest.Wrap("operator trust level: " + err.Error())
}
- if err := ValidateTrustLevel(params.JudgeTrustLevel); err != nil {
+ if err := ValidateTrustLevel(p.JudgeTrustLevel); err != nil {
return sdkerrors.ErrInvalidRequest.Wrap("judge trust level: " + err.Error())
}
- if params.ProposalPeriod == 0 {
+ if p.ProposalPeriod == 0 {
return sdkerrors.ErrInvalidRequest.Wrap("proposal period cannot be 0")
}
- if params.TimelockPeriod == 0 {
+ if p.TimelockPeriod == 0 {
return sdkerrors.ErrInvalidRequest.Wrap("timelock period cannot be 0")
}
+ if err := sdktypes.ValidateDenom(p.TargetDenom); err != nil {
+ return err
+ }
+
return nil
}
diff --git a/x/fbridge/types/tx.pb.go b/x/fbridge/types/tx.pb.go
index 150c4f9476..7e392c1392 100644
--- a/x/fbridge/types/tx.pb.go
+++ b/x/fbridge/types/tx.pb.go
@@ -29,6 +29,98 @@ var _ = math.Inf
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
+type MsgUpdateParams struct {
+ // the authority address
+ Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"`
+ // params defines the x/fbridge parameters to update.
+ //
+ // NOTE: All parameters must be supplied.
+ Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"`
+}
+
+func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} }
+func (m *MsgUpdateParams) String() string { return proto.CompactTextString(m) }
+func (*MsgUpdateParams) ProtoMessage() {}
+func (*MsgUpdateParams) Descriptor() ([]byte, []int) {
+ return fileDescriptor_54a336bc5ea063bb, []int{0}
+}
+func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *MsgUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ if deterministic {
+ return xxx_messageInfo_MsgUpdateParams.Marshal(b, m, deterministic)
+ } else {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+ }
+}
+func (m *MsgUpdateParams) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_MsgUpdateParams.Merge(m, src)
+}
+func (m *MsgUpdateParams) XXX_Size() int {
+ return m.Size()
+}
+func (m *MsgUpdateParams) XXX_DiscardUnknown() {
+ xxx_messageInfo_MsgUpdateParams.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_MsgUpdateParams proto.InternalMessageInfo
+
+func (m *MsgUpdateParams) GetAuthority() string {
+ if m != nil {
+ return m.Authority
+ }
+ return ""
+}
+
+func (m *MsgUpdateParams) GetParams() Params {
+ if m != nil {
+ return m.Params
+ }
+ return Params{}
+}
+
+type MsgUpdateParamsResponse struct {
+}
+
+func (m *MsgUpdateParamsResponse) Reset() { *m = MsgUpdateParamsResponse{} }
+func (m *MsgUpdateParamsResponse) String() string { return proto.CompactTextString(m) }
+func (*MsgUpdateParamsResponse) ProtoMessage() {}
+func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) {
+ return fileDescriptor_54a336bc5ea063bb, []int{1}
+}
+func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *MsgUpdateParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ if deterministic {
+ return xxx_messageInfo_MsgUpdateParamsResponse.Marshal(b, m, deterministic)
+ } else {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+ }
+}
+func (m *MsgUpdateParamsResponse) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_MsgUpdateParamsResponse.Merge(m, src)
+}
+func (m *MsgUpdateParamsResponse) XXX_Size() int {
+ return m.Size()
+}
+func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() {
+ xxx_messageInfo_MsgUpdateParamsResponse.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo
+
// MsgTransfer is input values required for bridge transfer
type MsgTransfer struct {
// the sender address on the source chain
@@ -43,7 +135,7 @@ func (m *MsgTransfer) Reset() { *m = MsgTransfer{} }
func (m *MsgTransfer) String() string { return proto.CompactTextString(m) }
func (*MsgTransfer) ProtoMessage() {}
func (*MsgTransfer) Descriptor() ([]byte, []int) {
- return fileDescriptor_54a336bc5ea063bb, []int{0}
+ return fileDescriptor_54a336bc5ea063bb, []int{2}
}
func (m *MsgTransfer) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -93,7 +185,7 @@ func (m *MsgTransferResponse) Reset() { *m = MsgTransferResponse{} }
func (m *MsgTransferResponse) String() string { return proto.CompactTextString(m) }
func (*MsgTransferResponse) ProtoMessage() {}
func (*MsgTransferResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_54a336bc5ea063bb, []int{1}
+ return fileDescriptor_54a336bc5ea063bb, []int{3}
}
func (m *MsgTransferResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -140,7 +232,7 @@ func (m *MsgProvision) Reset() { *m = MsgProvision{} }
func (m *MsgProvision) String() string { return proto.CompactTextString(m) }
func (*MsgProvision) ProtoMessage() {}
func (*MsgProvision) Descriptor() ([]byte, []int) {
- return fileDescriptor_54a336bc5ea063bb, []int{2}
+ return fileDescriptor_54a336bc5ea063bb, []int{4}
}
func (m *MsgProvision) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -204,7 +296,7 @@ func (m *MsgProvisionResponse) Reset() { *m = MsgProvisionResponse{} }
func (m *MsgProvisionResponse) String() string { return proto.CompactTextString(m) }
func (*MsgProvisionResponse) ProtoMessage() {}
func (*MsgProvisionResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_54a336bc5ea063bb, []int{3}
+ return fileDescriptor_54a336bc5ea063bb, []int{5}
}
func (m *MsgProvisionResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -245,7 +337,7 @@ func (m *MsgHoldTransfer) Reset() { *m = MsgHoldTransfer{} }
func (m *MsgHoldTransfer) String() string { return proto.CompactTextString(m) }
func (*MsgHoldTransfer) ProtoMessage() {}
func (*MsgHoldTransfer) Descriptor() ([]byte, []int) {
- return fileDescriptor_54a336bc5ea063bb, []int{4}
+ return fileDescriptor_54a336bc5ea063bb, []int{6}
}
func (m *MsgHoldTransfer) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -295,7 +387,7 @@ func (m *MsgHoldTransferResponse) Reset() { *m = MsgHoldTransferResponse
func (m *MsgHoldTransferResponse) String() string { return proto.CompactTextString(m) }
func (*MsgHoldTransferResponse) ProtoMessage() {}
func (*MsgHoldTransferResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_54a336bc5ea063bb, []int{5}
+ return fileDescriptor_54a336bc5ea063bb, []int{7}
}
func (m *MsgHoldTransferResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -336,7 +428,7 @@ func (m *MsgReleaseTransfer) Reset() { *m = MsgReleaseTransfer{} }
func (m *MsgReleaseTransfer) String() string { return proto.CompactTextString(m) }
func (*MsgReleaseTransfer) ProtoMessage() {}
func (*MsgReleaseTransfer) Descriptor() ([]byte, []int) {
- return fileDescriptor_54a336bc5ea063bb, []int{6}
+ return fileDescriptor_54a336bc5ea063bb, []int{8}
}
func (m *MsgReleaseTransfer) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -386,7 +478,7 @@ func (m *MsgReleaseTransferResponse) Reset() { *m = MsgReleaseTransferRe
func (m *MsgReleaseTransferResponse) String() string { return proto.CompactTextString(m) }
func (*MsgReleaseTransferResponse) ProtoMessage() {}
func (*MsgReleaseTransferResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_54a336bc5ea063bb, []int{7}
+ return fileDescriptor_54a336bc5ea063bb, []int{9}
}
func (m *MsgReleaseTransferResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -427,7 +519,7 @@ func (m *MsgRemoveProvision) Reset() { *m = MsgRemoveProvision{} }
func (m *MsgRemoveProvision) String() string { return proto.CompactTextString(m) }
func (*MsgRemoveProvision) ProtoMessage() {}
func (*MsgRemoveProvision) Descriptor() ([]byte, []int) {
- return fileDescriptor_54a336bc5ea063bb, []int{8}
+ return fileDescriptor_54a336bc5ea063bb, []int{10}
}
func (m *MsgRemoveProvision) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -477,7 +569,7 @@ func (m *MsgRemoveProvisionResponse) Reset() { *m = MsgRemoveProvisionRe
func (m *MsgRemoveProvisionResponse) String() string { return proto.CompactTextString(m) }
func (*MsgRemoveProvisionResponse) ProtoMessage() {}
func (*MsgRemoveProvisionResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_54a336bc5ea063bb, []int{9}
+ return fileDescriptor_54a336bc5ea063bb, []int{11}
}
func (m *MsgRemoveProvisionResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -518,7 +610,7 @@ func (m *MsgClaimBatch) Reset() { *m = MsgClaimBatch{} }
func (m *MsgClaimBatch) String() string { return proto.CompactTextString(m) }
func (*MsgClaimBatch) ProtoMessage() {}
func (*MsgClaimBatch) Descriptor() ([]byte, []int) {
- return fileDescriptor_54a336bc5ea063bb, []int{10}
+ return fileDescriptor_54a336bc5ea063bb, []int{12}
}
func (m *MsgClaimBatch) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -568,7 +660,7 @@ func (m *MsgClaimBatchResponse) Reset() { *m = MsgClaimBatchResponse{} }
func (m *MsgClaimBatchResponse) String() string { return proto.CompactTextString(m) }
func (*MsgClaimBatchResponse) ProtoMessage() {}
func (*MsgClaimBatchResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_54a336bc5ea063bb, []int{11}
+ return fileDescriptor_54a336bc5ea063bb, []int{13}
}
func (m *MsgClaimBatchResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -609,7 +701,7 @@ func (m *MsgClaim) Reset() { *m = MsgClaim{} }
func (m *MsgClaim) String() string { return proto.CompactTextString(m) }
func (*MsgClaim) ProtoMessage() {}
func (*MsgClaim) Descriptor() ([]byte, []int) {
- return fileDescriptor_54a336bc5ea063bb, []int{12}
+ return fileDescriptor_54a336bc5ea063bb, []int{14}
}
func (m *MsgClaim) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -659,7 +751,7 @@ func (m *MsgClaimResponse) Reset() { *m = MsgClaimResponse{} }
func (m *MsgClaimResponse) String() string { return proto.CompactTextString(m) }
func (*MsgClaimResponse) ProtoMessage() {}
func (*MsgClaimResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_54a336bc5ea063bb, []int{13}
+ return fileDescriptor_54a336bc5ea063bb, []int{15}
}
func (m *MsgClaimResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -706,7 +798,7 @@ func (m *MsgSuggestRole) Reset() { *m = MsgSuggestRole{} }
func (m *MsgSuggestRole) String() string { return proto.CompactTextString(m) }
func (*MsgSuggestRole) ProtoMessage() {}
func (*MsgSuggestRole) Descriptor() ([]byte, []int) {
- return fileDescriptor_54a336bc5ea063bb, []int{14}
+ return fileDescriptor_54a336bc5ea063bb, []int{16}
}
func (m *MsgSuggestRole) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -763,7 +855,7 @@ func (m *MsgSuggestRoleResponse) Reset() { *m = MsgSuggestRoleResponse{}
func (m *MsgSuggestRoleResponse) String() string { return proto.CompactTextString(m) }
func (*MsgSuggestRoleResponse) ProtoMessage() {}
func (*MsgSuggestRoleResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_54a336bc5ea063bb, []int{15}
+ return fileDescriptor_54a336bc5ea063bb, []int{17}
}
func (m *MsgSuggestRoleResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -805,7 +897,7 @@ func (m *MsgAddVoteForRole) Reset() { *m = MsgAddVoteForRole{} }
func (m *MsgAddVoteForRole) String() string { return proto.CompactTextString(m) }
func (*MsgAddVoteForRole) ProtoMessage() {}
func (*MsgAddVoteForRole) Descriptor() ([]byte, []int) {
- return fileDescriptor_54a336bc5ea063bb, []int{16}
+ return fileDescriptor_54a336bc5ea063bb, []int{18}
}
func (m *MsgAddVoteForRole) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -862,7 +954,7 @@ func (m *MsgAddVoteForRoleResponse) Reset() { *m = MsgAddVoteForRoleResp
func (m *MsgAddVoteForRoleResponse) String() string { return proto.CompactTextString(m) }
func (*MsgAddVoteForRoleResponse) ProtoMessage() {}
func (*MsgAddVoteForRoleResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_54a336bc5ea063bb, []int{17}
+ return fileDescriptor_54a336bc5ea063bb, []int{19}
}
func (m *MsgAddVoteForRoleResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -902,7 +994,7 @@ func (m *MsgSetBridgeStatus) Reset() { *m = MsgSetBridgeStatus{} }
func (m *MsgSetBridgeStatus) String() string { return proto.CompactTextString(m) }
func (*MsgSetBridgeStatus) ProtoMessage() {}
func (*MsgSetBridgeStatus) Descriptor() ([]byte, []int) {
- return fileDescriptor_54a336bc5ea063bb, []int{18}
+ return fileDescriptor_54a336bc5ea063bb, []int{20}
}
func (m *MsgSetBridgeStatus) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -952,7 +1044,7 @@ func (m *MsgSetBridgeStatusResponse) Reset() { *m = MsgSetBridgeStatusRe
func (m *MsgSetBridgeStatusResponse) String() string { return proto.CompactTextString(m) }
func (*MsgSetBridgeStatusResponse) ProtoMessage() {}
func (*MsgSetBridgeStatusResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_54a336bc5ea063bb, []int{19}
+ return fileDescriptor_54a336bc5ea063bb, []int{21}
}
func (m *MsgSetBridgeStatusResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -982,6 +1074,8 @@ func (m *MsgSetBridgeStatusResponse) XXX_DiscardUnknown() {
var xxx_messageInfo_MsgSetBridgeStatusResponse proto.InternalMessageInfo
func init() {
+ proto.RegisterType((*MsgUpdateParams)(nil), "lbm.fbridge.v1.MsgUpdateParams")
+ proto.RegisterType((*MsgUpdateParamsResponse)(nil), "lbm.fbridge.v1.MsgUpdateParamsResponse")
proto.RegisterType((*MsgTransfer)(nil), "lbm.fbridge.v1.MsgTransfer")
proto.RegisterType((*MsgTransferResponse)(nil), "lbm.fbridge.v1.MsgTransferResponse")
proto.RegisterType((*MsgProvision)(nil), "lbm.fbridge.v1.MsgProvision")
@@ -1007,54 +1101,59 @@ func init() {
func init() { proto.RegisterFile("lbm/fbridge/v1/tx.proto", fileDescriptor_54a336bc5ea063bb) }
var fileDescriptor_54a336bc5ea063bb = []byte{
- // 752 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0xcd, 0x4e, 0xdb, 0x4a,
- 0x14, 0x4e, 0x6e, 0x42, 0x04, 0x07, 0x6e, 0xe0, 0xce, 0x85, 0x10, 0x4c, 0x48, 0xb8, 0xbe, 0xfd,
- 0xa1, 0x48, 0x4d, 0x20, 0xad, 0x54, 0xa9, 0xbb, 0x06, 0x09, 0x15, 0x54, 0x8b, 0xca, 0xb4, 0x55,
- 0xd5, 0x45, 0x91, 0x13, 0x4f, 0x06, 0xab, 0xb6, 0x27, 0xf5, 0x4c, 0xa2, 0x54, 0xea, 0x2b, 0x54,
- 0xea, 0xc3, 0xf4, 0x21, 0x58, 0xb2, 0xac, 0xba, 0x40, 0x15, 0x3c, 0x44, 0xb7, 0x95, 0xcd, 0x64,
- 0xb0, 0x8d, 0x9d, 0x80, 0xba, 0x9b, 0xc9, 0xf7, 0x73, 0xbe, 0x93, 0x99, 0x33, 0x09, 0x2c, 0xdb,
- 0x6d, 0xa7, 0xd1, 0x6d, 0x7b, 0x96, 0x49, 0x70, 0x63, 0xb0, 0xdd, 0xe0, 0xc3, 0x7a, 0xcf, 0xa3,
- 0x9c, 0xa2, 0xa2, 0xdd, 0x76, 0xea, 0x02, 0xa8, 0x0f, 0xb6, 0x95, 0x45, 0x42, 0x09, 0x0d, 0xa0,
- 0x86, 0xbf, 0xba, 0x64, 0x29, 0x95, 0x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 0xc5, 0x96, 0xcb, 0x09, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
@@ -1069,6 +1168,8 @@ const _ = grpc.SupportPackageIsVersion4
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type MsgClient interface {
+ // UpdateParams updates the x/fbridge parameters.
+ UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error)
// Submit a transfer request to the bridge module.
Transfer(ctx context.Context, in *MsgTransfer, opts ...grpc.CallOption) (*MsgTransferResponse, error)
// Submit a provision to the bridge module.
@@ -1102,6 +1203,15 @@ func NewMsgClient(cc grpc1.ClientConn) 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, "/lbm.fbridge.v1.Msg/UpdateParams", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
func (c *msgClient) Transfer(ctx context.Context, in *MsgTransfer, opts ...grpc.CallOption) (*MsgTransferResponse, error) {
out := new(MsgTransferResponse)
err := c.cc.Invoke(ctx, "/lbm.fbridge.v1.Msg/Transfer", in, out, opts...)
@@ -1194,6 +1304,8 @@ func (c *msgClient) SetBridgeStatus(ctx context.Context, in *MsgSetBridgeStatus,
// MsgServer is the server API for Msg service.
type MsgServer interface {
+ // UpdateParams updates the x/fbridge parameters.
+ UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error)
// Submit a transfer request to the bridge module.
Transfer(context.Context, *MsgTransfer) (*MsgTransferResponse, error)
// Submit a provision to the bridge module.
@@ -1223,6 +1335,9 @@ type MsgServer interface {
type UnimplementedMsgServer struct {
}
+func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented")
+}
func (*UnimplementedMsgServer) Transfer(ctx context.Context, req *MsgTransfer) (*MsgTransferResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Transfer not implemented")
}
@@ -1258,6 +1373,24 @@ func RegisterMsgServer(s grpc1.Server, 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: "/lbm.fbridge.v1.Msg/UpdateParams",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
func _Msg_Transfer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MsgTransfer)
if err := dec(in); err != nil {
@@ -1442,6 +1575,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{
ServiceName: "lbm.fbridge.v1.Msg",
HandlerType: (*MsgServer)(nil),
Methods: []grpc.MethodDesc{
+ {
+ MethodName: "UpdateParams",
+ Handler: _Msg_UpdateParams_Handler,
+ },
{
MethodName: "Transfer",
Handler: _Msg_Transfer_Handler,
@@ -1487,6 +1624,69 @@ var _Msg_serviceDesc = grpc.ServiceDesc{
Metadata: "lbm/fbridge/v1/tx.proto",
}
+func (m *MsgUpdateParams) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *MsgUpdateParams) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ {
+ size, err := m.Params.MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintTx(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0x12
+ if len(m.Authority) > 0 {
+ i -= len(m.Authority)
+ copy(dAtA[i:], m.Authority)
+ i = encodeVarintTx(dAtA, i, uint64(len(m.Authority)))
+ i--
+ dAtA[i] = 0xa
+ }
+ return len(dAtA) - i, nil
+}
+
+func (m *MsgUpdateParamsResponse) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ return len(dAtA) - i, nil
+}
+
func (m *MsgTransfer) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
@@ -2126,6 +2326,30 @@ func encodeVarintTx(dAtA []byte, offset int, v uint64) int {
dAtA[offset] = uint8(v)
return base
}
+func (m *MsgUpdateParams) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ l = len(m.Authority)
+ if l > 0 {
+ n += 1 + l + sovTx(uint64(l))
+ }
+ l = m.Params.Size()
+ n += 1 + l + sovTx(uint64(l))
+ return n
+}
+
+func (m *MsgUpdateParamsResponse) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ return n
+}
+
func (m *MsgTransfer) Size() (n int) {
if m == nil {
return 0
@@ -2402,6 +2626,171 @@ func sovTx(x uint64) (n int) {
func sozTx(x uint64) (n int) {
return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
+func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowTx
+ }
+ if iNdEx >= l {
+ return 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 fmt.Errorf("proto: MsgUpdateParams: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowTx
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthTx
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthTx
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Authority = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowTx
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthTx
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthTx
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipTx(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthTx
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowTx
+ }
+ if iNdEx >= l {
+ return 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 fmt.Errorf("proto: MsgUpdateParamsResponse: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ default:
+ iNdEx = preIndex
+ skippy, err := skipTx(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthTx
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
func (m *MsgTransfer) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
From 5e40d34c0b06d9c70d40052607645201a074695e Mon Sep 17 00:00:00 2001
From: Jaeseung Lee <41176085+tkxkd0159@users.noreply.github.com>
Date: Thu, 9 May 2024 01:39:32 +0900
Subject: [PATCH 07/10] chore(x/fbridge): add the event of `SetBridgeStatus`
(#1369)
---
CHANGELOG.md | 1 +
docs/core/proto-docs.md | 17 ++
proto/lbm/fbridge/v1/event.proto | 7 +
x/fbridge/keeper/msg_server.go | 7 +
x/fbridge/types/event.pb.go | 268 +++++++++++++++++++++++++++----
5 files changed, 271 insertions(+), 29 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 950af9a8e9..400e0e5534 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -60,6 +60,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (types) [\#1314](https://github.com/Finschia/finschia-sdk/pull/1314) replace IsEqual with Equal
* (x/fswap) [\#1363](https://github.com/Finschia/finschia-sdk/pull/1363) introduce new event for MakeSwapProposal
* (x/fbridge) [\#1366](https://github.com/Finschia/finschia-sdk/pull/1366) Set target denom as module parameters
+* (x/fbridge) [\#1369](https://github.com/Finschia/finschia-sdk/pull/1369) Add the event of `SetBridgeStatus`
### Bug Fixes
* chore(deps) [\#1141](https://github.com/Finschia/finschia-sdk/pull/1141) Bump github.com/cosmos/ledger-cosmos-go from 0.12.2 to 0.13.2 to fix ledger signing issue
diff --git a/docs/core/proto-docs.md b/docs/core/proto-docs.md
index c9fd2b24ec..7d18b80a33 100644
--- a/docs/core/proto-docs.md
+++ b/docs/core/proto-docs.md
@@ -774,6 +774,7 @@
- [EventClaim](#lbm.fbridge.v1.EventClaim)
- [EventConfirmProvision](#lbm.fbridge.v1.EventConfirmProvision)
- [EventProvision](#lbm.fbridge.v1.EventProvision)
+ - [EventSetBridgeStatus](#lbm.fbridge.v1.EventSetBridgeStatus)
- [EventSuggestRole](#lbm.fbridge.v1.EventSuggestRole)
- [EventTransfer](#lbm.fbridge.v1.EventTransfer)
- [EventUpdateParams](#lbm.fbridge.v1.EventUpdateParams)
@@ -11691,6 +11692,22 @@ VoteOption enumerates the valid vote options for a given role proposal.
+
+
+### EventSetBridgeStatus
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| `guardian` | [string](#string) | | the guardian address who modifies the bridge status (a.k.a. bridge switch) |
+| `status` | [BridgeStatus](#lbm.fbridge.v1.BridgeStatus) | | the new status of the guardian's bridge switch |
+
+
+
+
+
+
### EventSuggestRole
diff --git a/proto/lbm/fbridge/v1/event.proto b/proto/lbm/fbridge/v1/event.proto
index 610039eb5b..0977ff2728 100644
--- a/proto/lbm/fbridge/v1/event.proto
+++ b/proto/lbm/fbridge/v1/event.proto
@@ -62,3 +62,10 @@ message EventClaim {
// the amount of token to be claimed
string amount = 4;
}
+
+message EventSetBridgeStatus {
+ // the guardian address who modifies the bridge status (a.k.a. bridge switch)
+ string guardian = 1;
+ // the new status of the guardian's bridge switch
+ BridgeStatus status = 2;
+}
\ No newline at end of file
diff --git a/x/fbridge/keeper/msg_server.go b/x/fbridge/keeper/msg_server.go
index 72fc696a00..49d2e4ac8c 100644
--- a/x/fbridge/keeper/msg_server.go
+++ b/x/fbridge/keeper/msg_server.go
@@ -164,5 +164,12 @@ func (m msgServer) SetBridgeStatus(goCtx context.Context, msg *types.MsgSetBridg
return nil, err
}
+ if err := ctx.EventManager().EmitTypedEvent(&types.EventSetBridgeStatus{
+ Guardian: msg.Guardian,
+ Status: msg.Status,
+ }); err != nil {
+ panic(err)
+ }
+
return &types.MsgSetBridgeStatusResponse{}, nil
}
diff --git a/x/fbridge/types/event.pb.go b/x/fbridge/types/event.pb.go
index 4acb26aa67..1bd20fe730 100644
--- a/x/fbridge/types/event.pb.go
+++ b/x/fbridge/types/event.pb.go
@@ -444,6 +444,60 @@ func (m *EventClaim) GetAmount() string {
return ""
}
+type EventSetBridgeStatus struct {
+ // the guardian address who modifies the bridge status (a.k.a. bridge switch)
+ Guardian string `protobuf:"bytes,1,opt,name=guardian,proto3" json:"guardian,omitempty"`
+ // the new status of the guardian's bridge switch
+ Status BridgeStatus `protobuf:"varint,2,opt,name=status,proto3,enum=lbm.fbridge.v1.BridgeStatus" json:"status,omitempty"`
+}
+
+func (m *EventSetBridgeStatus) Reset() { *m = EventSetBridgeStatus{} }
+func (m *EventSetBridgeStatus) String() string { return proto.CompactTextString(m) }
+func (*EventSetBridgeStatus) ProtoMessage() {}
+func (*EventSetBridgeStatus) Descriptor() ([]byte, []int) {
+ return fileDescriptor_a36aa6e56f2275b8, []int{7}
+}
+func (m *EventSetBridgeStatus) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *EventSetBridgeStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ if deterministic {
+ return xxx_messageInfo_EventSetBridgeStatus.Marshal(b, m, deterministic)
+ } else {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+ }
+}
+func (m *EventSetBridgeStatus) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_EventSetBridgeStatus.Merge(m, src)
+}
+func (m *EventSetBridgeStatus) XXX_Size() int {
+ return m.Size()
+}
+func (m *EventSetBridgeStatus) XXX_DiscardUnknown() {
+ xxx_messageInfo_EventSetBridgeStatus.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_EventSetBridgeStatus proto.InternalMessageInfo
+
+func (m *EventSetBridgeStatus) GetGuardian() string {
+ if m != nil {
+ return m.Guardian
+ }
+ return ""
+}
+
+func (m *EventSetBridgeStatus) GetStatus() BridgeStatus {
+ if m != nil {
+ return m.Status
+ }
+ return StatusEmpty
+}
+
func init() {
proto.RegisterType((*EventUpdateParams)(nil), "lbm.fbridge.v1.EventUpdateParams")
proto.RegisterType((*EventTransfer)(nil), "lbm.fbridge.v1.EventTransfer")
@@ -452,40 +506,44 @@ func init() {
proto.RegisterType((*EventProvision)(nil), "lbm.fbridge.v1.EventProvision")
proto.RegisterType((*EventConfirmProvision)(nil), "lbm.fbridge.v1.EventConfirmProvision")
proto.RegisterType((*EventClaim)(nil), "lbm.fbridge.v1.EventClaim")
+ proto.RegisterType((*EventSetBridgeStatus)(nil), "lbm.fbridge.v1.EventSetBridgeStatus")
}
func init() { proto.RegisterFile("lbm/fbridge/v1/event.proto", fileDescriptor_a36aa6e56f2275b8) }
var fileDescriptor_a36aa6e56f2275b8 = []byte{
- // 439 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x53, 0x3d, 0x6f, 0xd4, 0x40,
- 0x10, 0x3d, 0x93, 0xcb, 0x29, 0x99, 0x88, 0x53, 0x30, 0x21, 0xb2, 0xac, 0xc8, 0x89, 0x5c, 0x85,
- 0x02, 0x9b, 0x1c, 0xd4, 0x48, 0x04, 0x11, 0x29, 0x34, 0x9c, 0xcc, 0x47, 0x41, 0x83, 0xd6, 0xe7,
- 0x39, 0x67, 0xc1, 0xf6, 0x98, 0xdd, 0x3d, 0x0b, 0x3a, 0x6a, 0x2a, 0x7e, 0x56, 0xca, 0x94, 0x54,
- 0x08, 0xdd, 0xfd, 0x11, 0xe4, 0xf1, 0xfa, 0x24, 0xae, 0xa0, 0x4b, 0x37, 0xcf, 0xef, 0x63, 0xde,
- 0x58, 0x5a, 0xf0, 0x8b, 0xb4, 0x8c, 0xe7, 0xa9, 0x92, 0x59, 0x8e, 0x71, 0x73, 0x16, 0x63, 0x83,
- 0x95, 0x89, 0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0xde,
+ 0xf2, 0xea, 0x17, 0x30, 0xea, 0x56, 0xcf, 0xf5, 0x84, 0xfe, 0xe5, 0x95, 0x66, 0xba, 0x51, 0xc6,
+ 0x2b, 0x6f, 0x98, 0xcc, 0x04, 0xab, 0xec, 0xa6, 0x36, 0xd8, 0xdc, 0x69, 0x45, 0x2c, 0x9a, 0x3f,
+ 0xfc, 0xfb, 0x62, 0xfc, 0xee, 0x94, 0x58, 0xee, 0xe4, 0xc5, 0xf5, 0x32, 0x70, 0x6e, 0x96, 0x81,
+ 0xf3, 0x73, 0x19, 0x38, 0xdf, 0x56, 0x41, 0xef, 0x66, 0x15, 0xf4, 0xbe, 0xaf, 0x82, 0xde, 0xdb,
+ 0x87, 0xb9, 0xd0, 0x8b, 0x26, 0x8d, 0x66, 0x58, 0xc6, 0x17, 0xa2, 0x52, 0xb3, 0x85, 0x60, 0xf1,
+ 0xdc, 0x16, 0x0f, 0x54, 0xf6, 0x21, 0xfe, 0xb4, 0x79, 0x75, 0xfa, 0x73, 0xcd, 0x55, 0x3a, 0xa0,
+ 0x17, 0xf7, 0xe8, 0x57, 0x00, 0x00, 0x00, 0xff, 0xff, 0x04, 0x84, 0xa9, 0x5c, 0xd3, 0x03, 0x00,
+ 0x00,
}
func (m *EventUpdateParams) Marshal() (dAtA []byte, err error) {
@@ -776,6 +834,41 @@ func (m *EventClaim) MarshalToSizedBuffer(dAtA []byte) (int, error) {
return len(dAtA) - i, nil
}
+func (m *EventSetBridgeStatus) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *EventSetBridgeStatus) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *EventSetBridgeStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ if m.Status != 0 {
+ i = encodeVarintEvent(dAtA, i, uint64(m.Status))
+ i--
+ dAtA[i] = 0x10
+ }
+ if len(m.Guardian) > 0 {
+ i -= len(m.Guardian)
+ copy(dAtA[i:], m.Guardian)
+ i = encodeVarintEvent(dAtA, i, uint64(len(m.Guardian)))
+ i--
+ dAtA[i] = 0xa
+ }
+ return len(dAtA) - i, nil
+}
+
func encodeVarintEvent(dAtA []byte, offset int, v uint64) int {
offset -= sovEvent(v)
base := offset
@@ -916,6 +1009,22 @@ func (m *EventClaim) Size() (n int) {
return n
}
+func (m *EventSetBridgeStatus) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ l = len(m.Guardian)
+ if l > 0 {
+ n += 1 + l + sovEvent(uint64(l))
+ }
+ if m.Status != 0 {
+ n += 1 + sovEvent(uint64(m.Status))
+ }
+ return n
+}
+
func sovEvent(x uint64) (n int) {
return (math_bits.Len64(x|1) + 6) / 7
}
@@ -1804,6 +1913,107 @@ func (m *EventClaim) Unmarshal(dAtA []byte) error {
}
return nil
}
+func (m *EventSetBridgeStatus) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowEvent
+ }
+ if iNdEx >= l {
+ return 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 fmt.Errorf("proto: EventSetBridgeStatus: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: EventSetBridgeStatus: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Guardian", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowEvent
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthEvent
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthEvent
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Guardian = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 2:
+ if wireType != 0 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType)
+ }
+ m.Status = 0
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowEvent
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ m.Status |= BridgeStatus(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ default:
+ iNdEx = preIndex
+ skippy, err := skipEvent(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthEvent
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
func skipEvent(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
From 0e07aec4d2f29e70e8ef643ad789251cec5cf01d Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Thu, 9 May 2024 06:58:33 +0000
Subject: [PATCH 08/10] chore(deps): Bump github.com/rs/zerolog from 1.31.0 to
1.32.0 (#1226)
Bumps [github.com/rs/zerolog](https://github.com/rs/zerolog) from 1.31.0 to 1.32.0.
Commits
[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/rs/zerolog&package-manager=go_modules&previous-version=1.31.0&new-version=1.32.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
You can trigger a rebase of this PR by commenting `@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
> **Note**
> Automatic rebases have been disabled on this pull request as it has been open for over 30 days.
---
go.mod | 2 +-
go.sum | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/go.mod b/go.mod
index 32bcb98842..56a02dafe7 100644
--- a/go.mod
+++ b/go.mod
@@ -35,7 +35,7 @@ require (
github.com/prometheus/client_golang v1.17.0
github.com/prometheus/common v0.45.0
github.com/regen-network/cosmos-proto v0.3.1
- github.com/rs/zerolog v1.31.0
+ github.com/rs/zerolog v1.32.0
github.com/spf13/cast v1.5.1
github.com/spf13/cobra v1.8.0
github.com/spf13/pflag v1.0.5
diff --git a/go.sum b/go.sum
index 6d880b970e..f096332b56 100644
--- a/go.sum
+++ b/go.sum
@@ -585,8 +585,8 @@ github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU=
github.com/rs/cors v1.10.1 h1:L0uuZVXIKlI1SShY2nhFfo44TYvDPQ1w4oFkUJNfhyo=
github.com/rs/cors v1.10.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU=
github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
-github.com/rs/zerolog v1.31.0 h1:FcTR3NnLWW+NnTwwhFWiJSZr4ECLpqCm6QsEnyvbV4A=
-github.com/rs/zerolog v1.31.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss=
+github.com/rs/zerolog v1.32.0 h1:keLypqrlIjaFsbmJOBdB/qvyF8KEtCWHwobLp5l/mQ0=
+github.com/rs/zerolog v1.32.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss=
github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
From 9af2cefbd45960214f18ba31392d8831c5e8e018 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Thu, 9 May 2024 06:59:10 +0000
Subject: [PATCH 09/10] chore(deps): Bump github.com/stretchr/testify from
1.8.4 to 1.9.0 (#1263)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.8.4 to 1.9.0.
Release notes
Sourced from github.com/stretchr/testify's releases.
v1.9.0
What's Changed
... (truncated)
Commits
bb548d0
Merge pull request #1552 from stretchr/dependabot/go_modules/github.com/stret...
814075f
build(deps): bump github.com/stretchr/objx from 0.5.1 to 0.5.2
e045612
Merge pull request #1339 from bogdandrutu/uintptr
5b6926d
Merge pull request #1385 from hslatman/not-implements
9f97d67
Merge pull request #1550 from stretchr/release-notes
bcb0d3f
Include the auto-release notes in releases
fb770f8
Merge pull request #1247 from ccoVeille/typos
85d8bb6
fix typos in comments, tests and github templates
e2741fa
Merge pull request #1548 from arjunmahishi/msgAndArgs
6e59f20
http_assertions: assert that the msgAndArgs actually works in tests
- Additional commits viewable in compare view
[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/stretchr/testify&package-manager=go_modules&previous-version=1.8.4&new-version=1.9.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
You can trigger a rebase of this PR by commenting `@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
> **Note**
> Automatic rebases have been disabled on this pull request as it has been open for over 30 days.
---
go.mod | 2 +-
go.sum | 5 +++--
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/go.mod b/go.mod
index 56a02dafe7..fd151cd3c5 100644
--- a/go.mod
+++ b/go.mod
@@ -40,7 +40,7 @@ require (
github.com/spf13/cobra v1.8.0
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.17.0
- github.com/stretchr/testify v1.8.4
+ github.com/stretchr/testify v1.9.0
github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15
github.com/tendermint/go-amino v0.16.0
github.com/tendermint/tendermint v0.34.24
diff --git a/go.sum b/go.sum
index f096332b56..d98ccec098 100644
--- a/go.sum
+++ b/go.sum
@@ -639,8 +639,8 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
-github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
+github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
@@ -649,8 +649,9 @@ github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
-github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
+github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
+github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
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=
From d577299c4390b92d6e34ecdfbc9841c97ba8c173 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Thu, 9 May 2024 06:59:48 +0000
Subject: [PATCH 10/10] chore(deps): Bump github.com/golang/protobuf from 1.5.3
to 1.5.4 (#1270)
Bumps [github.com/golang/protobuf](https://github.com/golang/protobuf) from 1.5.3 to 1.5.4.
Release notes
Sourced from github.com/golang/protobuf's releases.
v1.5.4
Notable changes
- update descriptor.proto to latest version
Commits
[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/golang/protobuf&package-manager=go_modules&previous-version=1.5.3&new-version=1.5.4)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
You can trigger a rebase of this PR by commenting `@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
> **Note**
> Automatic rebases have been disabled on this pull request as it has been open for over 30 days.
---
go.mod | 4 ++--
go.sum | 12 ++++--------
2 files changed, 6 insertions(+), 10 deletions(-)
diff --git a/go.mod b/go.mod
index fd151cd3c5..5d74c28029 100644
--- a/go.mod
+++ b/go.mod
@@ -19,7 +19,7 @@ require (
github.com/gogo/gateway v1.1.0
github.com/gogo/protobuf v1.3.3
github.com/golang/mock v1.6.0
- github.com/golang/protobuf v1.5.3
+ github.com/golang/protobuf v1.5.4
github.com/gorilla/handlers v1.5.2
github.com/gorilla/mux v1.8.1
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0
@@ -49,7 +49,7 @@ require (
golang.org/x/exp v0.0.0-20230905200255-921286631fa9
google.golang.org/genproto/googleapis/api v0.0.0-20230920204549-e6e6cdab5c13
google.golang.org/grpc v1.59.0
- google.golang.org/protobuf v1.32.0
+ google.golang.org/protobuf v1.33.0
gopkg.in/yaml.v2 v2.4.0
)
diff --git a/go.sum b/go.sum
index d98ccec098..6d41284d06 100644
--- a/go.sum
+++ b/go.sum
@@ -269,9 +269,8 @@ github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvq
github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
-github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
-github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
-github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
+github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
+github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM=
@@ -289,7 +288,6 @@ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
-github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI=
github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw=
@@ -1098,10 +1096,8 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD
google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4=
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
google.golang.org/protobuf v1.25.1-0.20200805231151-a709e31e5d12/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
-google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
-google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
-google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I=
-google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
+google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
+google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=