-
Notifications
You must be signed in to change notification settings - Fork 2
feat: ICoordinator #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
9e71b20
34e4f72
7c2f67f
e4eac14
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,8 @@ syntax = "proto3"; | |
| import "gogoproto/gogo.proto"; | ||
| import "google/protobuf/any.proto"; | ||
| import "cross/core/auth/Auth.proto"; | ||
| import "cross/core/tx/Tx.proto"; | ||
| import "cross/core/xcc/XCC.proto"; | ||
|
|
||
| message PacketData { | ||
| option (gogoproto.goproto_getters) = false; | ||
|
|
@@ -27,7 +29,7 @@ message HeaderField { | |
| } | ||
|
|
||
| message PacketDataCall { | ||
| option (gogoproto.equal) = false; | ||
| option (gogoproto.equal) = false; | ||
|
|
||
| message ResolvedContractTransaction { | ||
| option (gogoproto.equal) = false; | ||
|
|
@@ -44,11 +46,11 @@ message PacketDataCall { | |
| } | ||
|
|
||
| message PacketAcknowledgementCall { | ||
| option (gogoproto.equal) = false; | ||
| option (gogoproto.equal) = false; | ||
|
|
||
| enum CommitStatus { | ||
| option (gogoproto.goproto_enum_prefix) = false; | ||
|
|
||
| COMMIT_STATUS_UNKNOWN = 0; | ||
| COMMIT_STATUS_OK = 1; | ||
| COMMIT_STATUS_FAILED = 2; | ||
|
|
@@ -57,6 +59,39 @@ message PacketAcknowledgementCall { | |
| CommitStatus status = 1; | ||
| } | ||
|
|
||
| message ReturnValue { | ||
| bytes value = 1; | ||
| message QueryCoordinatorStateRequest { | ||
| bytes tx_id = 1 [(gogoproto.casttype) = "github.com/datachainlab/cross/x/core/types.TxID"]; | ||
| } | ||
|
|
||
| message QueryCoordinatorStateResponse { | ||
| CoordinatorState coodinator_state = 1 [(gogoproto.nullable) = false]; | ||
| } | ||
|
|
||
| message CoordinatorState { | ||
| option (gogoproto.equal) = false; | ||
|
|
||
| Tx.CommitProtocol commit_protocol = 1; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In the original proto, the field was named |
||
| repeated ChannelInfo channels = 2 [(gogoproto.nullable) = false]; | ||
|
|
||
| enum CoordinatorPhase { | ||
| option (gogoproto.goproto_enum_prefix) = false; | ||
|
|
||
| COORDINATOR_PHASE_UNKNOWN = 0; | ||
| COORDINATOR_PHASE_PREPARE = 1; | ||
| COORDINATOR_PHASE_COMMIT = 2; | ||
| } | ||
|
|
||
| CoordinatorPhase phase = 3; | ||
|
|
||
| enum CoordinatorDecision { | ||
| option (gogoproto.goproto_enum_prefix) = false; | ||
|
|
||
| COORDINATOR_DECISION_UNKNOWN = 0; | ||
| COORDINATOR_DECISION_COMMIT = 1; | ||
| COORDINATOR_DECISION_ABORT = 2; | ||
| } | ||
|
|
||
| CoordinatorDecision decision = 4; | ||
| repeated uint32 confirmed_txs = 5 [(gogoproto.casttype) = "github.com/datachainlab/cross/x/core/types.TxIndex"]; | ||
| repeated uint32 acks = 6 [(gogoproto.casttype) = "github.com/datachainlab/cross/x/core/types.TxIndex"]; | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| syntax = "proto3"; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Built with reference to the proto of the cross repository |
||
|
|
||
| import "gogoproto/gogo.proto"; | ||
|
|
||
| option go_package = "github.com/datachainlab/cross/x/core/xcc/types"; | ||
| option (gogoproto.goproto_getters_all) = false; | ||
|
|
||
| message ChannelInfo { | ||
| string port = 1; | ||
| string channel = 2; | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
| pragma solidity ^0.8.20; | ||
|
|
||
| import { | ||
| QueryCoordinatorStateRequest, | ||
| QueryCoordinatorStateResponse | ||
| } from "src/proto/cross/core/atomic/simple/AtomicSimple.sol"; | ||
|
|
||
| interface ICoordinator { | ||
| function coordinatorState(QueryCoordinatorStateRequest.Data calldata req) | ||
| external | ||
| view | ||
| returns (QueryCoordinatorStateResponse.Data memory); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Built with reference to the proto of the cross repository