-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Description Adds the on-chain upgrade handler for the upcoming version 2.0 of Desmos --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] added `!` to the type prefix if API or client breaking change - [x] targeted the correct branch (see [PR Targeting](https://github.com/desmos-labs/desmos/blob/master/CONTRIBUTING.md#pr-targeting)) - [ ] provided a link to the relevant issue or specification - [ ] followed the guidelines for [building modules](https://docs.cosmos.network/v0.44/building-modules/intro.html) - [ ] included the necessary unit and integration [tests](https://github.com/desmos-labs/desmos/blob/master/CONTRIBUTING.md#testing) - [ ] added a changelog entry to `CHANGELOG.md` - [ ] included comments for [documenting Go code](https://blog.golang.org/godoc) - [ ] updated the relevant documentation or specification - [ ] reviewed "Files changed" and left comments if necessary - [x] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [x] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [x] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable)
- Loading branch information
Showing
14 changed files
with
4,262 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,9 +22,9 @@ jobs: | |
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
env: | ||
GENESIS_DESMOS_VERSION: "v0.17.2" | ||
GENESIS_URL: "https://raw.githubusercontent.com/desmos-labs/morpheus/master/morpheus-apollo-2/genesis.json" | ||
UPGRADE_NAME: "desmos-v0.17.4-upgrade" | ||
GENESIS_DESMOS_VERSION: "v1.0.4" | ||
GENESIS_URL: "https://raw.githubusercontent.com/RiccardoM/desmos-states/master/morpheus-apollo-22003141.json" | ||
UPGRADE_NAME: "v2.0.0" | ||
steps: | ||
- name: Checkout 🛎️ | ||
uses: actions/checkout@v2 | ||
|
@@ -34,27 +34,16 @@ jobs: | |
with: | ||
go-version: 1.15 | ||
|
||
- name: Compute diff 📜 | ||
uses: technote-space/[email protected] | ||
with: | ||
PATTERNS: | | ||
**/**.go | ||
go.mod | ||
go.sum | ||
- name: Install Desmos 🔧 | ||
run: make clean install | ||
if: env.GIT_DIFF | ||
|
||
- name: Start testnet ⛓ | ||
run: | | ||
make upgrade-testnet-start \ | ||
GENESIS_VERSION="$GENESIS_DESMOS_VERSION" \ | ||
GENESIS_URL="$GENESIS_URL" \ | ||
UPGRADE_NAME="$UPGRADE_NAME" | ||
if: env.GIT_DIFF | ||
- name: Submit upgrade ✅ | ||
run: | | ||
./contrib/upgrade_testnet/submit_upgrade_proposal.sh 4 $UPGRADE_NAME 50 | ||
if: env.GIT_DIFF | ||
./contrib/upgrade_testnet/submit_upgrade_proposal.sh 4 $UPGRADE_NAME 50 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
155 changes: 155 additions & 0 deletions
155
proto/desmos/profiles/legacy/v100/models_app_links.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,155 @@ | ||
syntax = "proto3"; | ||
package desmos.profiles.legacy.v100; | ||
|
||
option go_package = "github.com/desmos-labs/desmos/x/profiles/legacy/v100"; | ||
|
||
import "gogoproto/gogo.proto"; | ||
import "google/protobuf/timestamp.proto"; | ||
|
||
// ApplicationLink contains the data of a link to a centralized application | ||
message ApplicationLink { | ||
option (gogoproto.goproto_getters) = false; | ||
option (gogoproto.equal) = true; | ||
|
||
// User to which the link is associated | ||
string user = 1 [ (gogoproto.moretags) = "yaml:\"user\"" ]; | ||
|
||
// Data contains the details of this specific link | ||
Data data = 2 | ||
[ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"data\"" ]; | ||
|
||
// State of the link | ||
ApplicationLinkState state = 3 [ (gogoproto.moretags) = "yaml:\"state\"" ]; | ||
|
||
// OracleRequest represents the request that has been made to the oracle | ||
OracleRequest oracle_request = 4 [ | ||
(gogoproto.nullable) = false, | ||
(gogoproto.moretags) = "yaml:\"oracle_request\"" | ||
]; | ||
|
||
// Data coming from the result of the verification. | ||
// Only available when the state is STATE_SUCCESS | ||
Result result = 5 [ (gogoproto.moretags) = "yaml:\"result\"" ]; | ||
|
||
// CreationTime represents the time in which the link was created | ||
google.protobuf.Timestamp creation_time = 6 [ | ||
(gogoproto.stdtime) = true, | ||
(gogoproto.nullable) = false, | ||
(gogoproto.moretags) = "yaml:\"creation_time\"" | ||
]; | ||
} | ||
|
||
// Data contains the data associated to a specific user of a | ||
// generic centralized application | ||
message Data { | ||
option (gogoproto.goproto_getters) = false; | ||
option (gogoproto.equal) = true; | ||
|
||
// The application name (eg. Twitter, GitHub, etc) | ||
string application = 1 [ (gogoproto.moretags) = "yaml:\"application\"" ]; | ||
// Username on the application (eg. Twitter tag, GitHub profile, etc) | ||
string username = 2 [ (gogoproto.moretags) = "yaml:\"username\"" ]; | ||
} | ||
|
||
// OracleRequest represents a generic oracle request used to | ||
// verify the ownership of a centralized application account | ||
message OracleRequest { | ||
option (gogoproto.goproto_getters) = false; | ||
|
||
option (gogoproto.equal) = true; | ||
|
||
// ID is the ID of the request | ||
int64 id = 1 | ||
[ (gogoproto.customname) = "ID", (gogoproto.moretags) = "yaml:\"id\"" ]; | ||
|
||
// OracleScriptID is ID of an oracle script | ||
int64 oracle_script_id = 2 [ | ||
(gogoproto.customname) = "OracleScriptID", | ||
(gogoproto.moretags) = "yaml:\"oracle_script_id\"" | ||
]; | ||
|
||
// CallData contains the data used to perform the oracle request | ||
CallData call_data = 3 [ | ||
(gogoproto.nullable) = false, | ||
(gogoproto.moretags) = "yaml:\"call_data\"" | ||
]; | ||
|
||
// ClientID represents the ID of the client that has called the oracle script | ||
string client_id = 4 [ | ||
(gogoproto.customname) = "ClientID", | ||
(gogoproto.moretags) = "yaml:\"client_id\"" | ||
]; | ||
|
||
// CallData contains the data sent to a single oracle request in order to | ||
// verify the ownership of a centralized application by a Desmos profile | ||
message CallData { | ||
option (gogoproto.equal) = true; | ||
|
||
// The application for which the ownership should be verified | ||
string application = 1 [ (gogoproto.moretags) = "yaml:\"application\"" ]; | ||
|
||
// The hex encoded call data that should be used to verify the application | ||
// account ownership | ||
string call_data = 2 [ (gogoproto.moretags) = "yaml:\"call_data\"" ]; | ||
} | ||
} | ||
|
||
// ApplicationLinkState defines if an application link is in the following | ||
// states: STARTED, ERRORED, SUCCESSFUL, TIMED_OUT | ||
enum ApplicationLinkState { | ||
option (gogoproto.goproto_enum_prefix) = false; | ||
|
||
// A link has just been initialized | ||
APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED = 0 | ||
[ (gogoproto.enumvalue_customname) = "ApplicationLinkStateInitialized" ]; | ||
// A link has just started being verified | ||
APPLICATION_LINK_STATE_VERIFICATION_STARTED = 1 | ||
[ (gogoproto.enumvalue_customname) = "AppLinkStateVerificationStarted" ]; | ||
// A link has errored during the verification process | ||
APPLICATION_LINK_STATE_VERIFICATION_ERROR = 2 | ||
[ (gogoproto.enumvalue_customname) = "AppLinkStateVerificationError" ]; | ||
// A link has being verified successfully | ||
APPLICATION_LINK_STATE_VERIFICATION_SUCCESS = 3 | ||
[ (gogoproto.enumvalue_customname) = "AppLinkStateVerificationSuccess" ]; | ||
// A link has timed out while waiting for the verification | ||
APPLICATION_LINK_STATE_TIMED_OUT = 4 | ||
[ (gogoproto.enumvalue_customname) = "AppLinkStateVerificationTimedOut" ]; | ||
} | ||
|
||
// Result represents a verification result | ||
message Result { | ||
option (gogoproto.goproto_getters) = false; | ||
option (gogoproto.equal) = true; | ||
|
||
// sum is the oneof that specifies whether this represents a success or | ||
// failure result | ||
oneof sum { | ||
// Success represents a successful verification | ||
Success success = 1; | ||
|
||
// Failed represents a failed verification | ||
Failed failed = 2; | ||
} | ||
|
||
// Success is the result of an application link that has been successfully | ||
// verified | ||
message Success { | ||
option (gogoproto.goproto_getters) = false; | ||
option (gogoproto.equal) = true; | ||
|
||
// Value that has be signed by the profile | ||
string value = 1 [ (gogoproto.moretags) = "yaml:\"value\"" ]; | ||
// Signature that has been produced by signing the value | ||
string signature = 2 [ (gogoproto.moretags) = "yaml:\"signature\"" ]; | ||
} | ||
|
||
// Failed is the result of an application link that has not been verified | ||
// successfully | ||
message Failed { | ||
option (gogoproto.goproto_getters) = false; | ||
option (gogoproto.equal) = true; | ||
|
||
// Error that is associated with the failure | ||
string error = 1 [ (gogoproto.moretags) = "yaml:\"error\"" ]; | ||
} | ||
} |
Oops, something went wrong.