-
Notifications
You must be signed in to change notification settings - Fork 2
feat: IInitiator #17
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
feat: IInitiator #17
Changes from all commits
67093af
5732fae
f784749
cc98902
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,4 @@ | |
|
|
||
| set -e | ||
|
|
||
| npm run fmt:sol | ||
|
|
||
| git add -A | ||
| npx lint-staged | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| { | ||
| "*.sol": ["npm run fmt:sol"] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,7 +7,7 @@ | |
| "postinstall": "husky && forge build", | ||
| "clean": "rm -rf build", | ||
| "test": "forge test -vvv", | ||
| "lint:sol": "solhint -f table 'src/**/*.sol' 'test/**/*.sol' 'script/**/*.sol'", | ||
| "lint:sol": "solhint -f table --max-warnings 0 'src/**/*.sol' 'test/**/*.sol' 'script/**/*.sol'", | ||
|
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. Treat solhint warnings as errors. |
||
| "fmt:sol": "forge fmt", | ||
| "coverage:sol": "forge coverage --report lcov" | ||
| }, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| 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 "google/protobuf/any.proto"; | ||
| import "gogoproto/gogo.proto"; | ||
| import "ibc/core/client/v1/client.proto"; | ||
| import "cross/core/tx/Tx.proto"; | ||
| import "cross/core/auth/Auth.proto"; | ||
|
|
||
| option go_package = "github.com/datachainlab/cross/x/core/initiator/types"; | ||
| option (gogoproto.goproto_getters_all) = false; | ||
|
|
||
| message MsgInitiateTx { | ||
| option (gogoproto.equal) = false; | ||
| option (gogoproto.goproto_getters) = false; | ||
|
|
||
| string chain_id = 1; | ||
| uint64 nonce = 2; | ||
|
|
||
| Tx.CommitProtocol commit_protocol = 3; | ||
|
|
||
| repeated ContractTransaction contract_transactions = 4 [(gogoproto.nullable) = false]; | ||
|
|
||
| repeated Account signers = 5 [(gogoproto.nullable) = false]; | ||
|
|
||
| ibc.core.client.v1.Height timeout_height = 6 | ||
| [(gogoproto.moretags) = "yaml:\"timeout_height\"", (gogoproto.nullable) = false]; | ||
|
|
||
| uint64 timeout_timestamp = 7 | ||
| [(gogoproto.moretags) = "yaml:\"timeout_timestamp\""]; | ||
| } | ||
|
|
||
| message MsgInitiateTxResponse { | ||
| option (gogoproto.equal) = false; | ||
| option (gogoproto.goproto_getters) = false; | ||
|
|
||
| bytes txID = 1 [(gogoproto.casttype) = "github.com/datachainlab/cross/x/core/types.TxID"]; | ||
|
|
||
| enum InitiateTxStatus { | ||
| option (gogoproto.goproto_enum_prefix) = false; | ||
|
|
||
| INITIATE_TX_STATUS_UNKNOWN = 0; | ||
| INITIATE_TX_STATUS_PENDING = 1; | ||
| INITIATE_TX_STATUS_VERIFIED = 2; | ||
| } | ||
|
|
||
| InitiateTxStatus status = 2; | ||
| } | ||
|
|
||
| message QuerySelfXCCRequest {} | ||
|
|
||
| message QuerySelfXCCResponse { | ||
| google.protobuf.Any xcc = 1 [(gogoproto.nullable) = true]; | ||
| } | ||
|
|
||
| message ContractTransaction { | ||
| option (gogoproto.equal) = false; | ||
|
|
||
| google.protobuf.Any cross_chain_channel = 1 [(gogoproto.nullable) = true]; | ||
| repeated Account signers = 2 [(gogoproto.nullable) = false]; | ||
| bytes call_info = 3 [(gogoproto.casttype) = "github.com/datachainlab/cross/x/core/tx/types.ContractCallInfo"]; | ||
| ReturnValue return_value = 4; | ||
| repeated Link links = 5 [(gogoproto.nullable) = false]; | ||
| } | ||
|
|
||
| message Link { | ||
| uint32 src_index = 1; | ||
| } | ||
|
|
||
| message GenesisState {} | ||
|
|
||
| message InitiateTxState { | ||
| option (gogoproto.equal) = false; | ||
|
|
||
| MsgInitiateTxResponse.InitiateTxStatus status = 1; | ||
|
|
||
| MsgInitiateTx msg = 2 [(gogoproto.nullable) = false]; | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| 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"; | ||
| import "google/protobuf/any.proto"; | ||
| import "ibc/core/client/v1/client.proto"; | ||
| import "cross/core/auth/Auth.proto"; | ||
|
|
||
| option go_package = "github.com/datachainlab/cross/x/core/tx/types"; | ||
| option (gogoproto.goproto_getters_all) = false; | ||
|
|
||
| message Tx { | ||
| option (gogoproto.equal) = false; | ||
|
|
||
| bytes id = 1 [(gogoproto.casttype) = "github.com/datachainlab/cross/x/core/types.TxID"]; | ||
|
|
||
| enum CommitProtocol { | ||
| option (gogoproto.goproto_enum_prefix) = false; | ||
|
|
||
| COMMIT_PROTOCOL_UNKNOWN = 0; | ||
| COMMIT_PROTOCOL_SIMPLE = 1; | ||
| COMMIT_PROTOCOL_TPC = 2; | ||
| } | ||
|
|
||
| CommitProtocol commit_protocol = 2; | ||
|
|
||
| repeated ResolvedContractTransaction contract_transactions = 3 [(gogoproto.nullable) = false]; | ||
|
|
||
| ibc.core.client.v1.Height timeout_height = 4 | ||
| [(gogoproto.moretags) = "yaml:\"timeout_height\"", (gogoproto.nullable) = false]; | ||
|
|
||
| uint64 timeout_timestamp = 5 | ||
| [(gogoproto.moretags) = "yaml:\"timeout_timestamp\""]; | ||
| } | ||
|
|
||
| message ResolvedContractTransaction { | ||
| option (gogoproto.equal) = false; | ||
|
|
||
| google.protobuf.Any cross_chain_channel = 1 [(gogoproto.nullable) = true]; | ||
| repeated Account signers = 2 [(gogoproto.nullable) = false]; | ||
| bytes call_info = 3 [(gogoproto.casttype) = "ContractCallInfo"]; | ||
| ReturnValue return_value = 4; | ||
| repeated google.protobuf.Any call_results = 5 [(gogoproto.nullable) = false]; | ||
| } | ||
|
|
||
| message ReturnValue { | ||
| bytes value = 1; | ||
| } | ||
|
|
||
| message ConstantValueCallResult { | ||
| google.protobuf.Any cross_chain_channel = 1 [(gogoproto.nullable) = false]; | ||
| bytes k = 2; | ||
| bytes v = 3; | ||
| } | ||
|
|
||
| message ContractCallResult { | ||
| bytes data = 1; | ||
| repeated google.protobuf.Any events = 2 [(gogoproto.nullable) = false]; | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
| pragma solidity ^0.8.20; | ||
|
|
||
| import {MsgInitiateTx, MsgInitiateTxResponse, QuerySelfXCCResponse} from "../proto/cross/core/initiator/Initiator.sol"; | ||
|
|
||
| interface IInitiator { | ||
| event TxInitiated(bytes txId, address indexed proposer); | ||
|
|
||
mattsu6666 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| function initiateTx(MsgInitiateTx.Data calldata msg_) external returns (MsgInitiateTxResponse.Data memory resp); | ||
|
|
||
| function selfXCC() external view returns (QuerySelfXCCResponse.Data memory resp); | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.
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.
There was a bug where files without stage were committed, so fixed it by using
lint-staged.