-
Notifications
You must be signed in to change notification settings - Fork 2
feat: IAuthenticator #18
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
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
f323f24
feat: IAuthenticator
YukiTsuchida f2fc4c3
refactor: remove redundant comments from Auth.proto for clarity
YukiTsuchida d0d2f79
refactor: remove outdated comments from MsgSignTx for clarity
YukiTsuchida f1c7a4c
Refactor MsgIBCSignTx library to MsgExtSignTx with updated struct and…
YukiTsuchida fd752a0
refactor: remove IBC signing references from IAuthenticator interface
YukiTsuchida cf6d29e
Merge branch 'def-interface-initiator' into def-interface-authenticator
YukiTsuchida 30ff557
refactor: update TxSigned event to use AuthType.AuthMode and remove S…
YukiTsuchida File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
| @@ -1,26 +1,75 @@ | ||
| syntax = "proto3"; | ||
|
|
||
| import "gogoproto/gogo.proto"; | ||
| import "google/protobuf/any.proto"; | ||
| import "gogoproto/gogo.proto"; | ||
| import "ibc/core/client/v1/client.proto"; | ||
|
|
||
| option go_package = "github.com/datachainlab/cross/x/core/auth/types"; | ||
| option (gogoproto.goproto_getters_all) = false; | ||
|
|
||
| message MsgSignTx { | ||
| option (gogoproto.equal) = false; | ||
| option (gogoproto.goproto_getters) = false; | ||
|
|
||
| bytes txID = 1 [(gogoproto.casttype) = "github.com/datachainlab/cross/x/core/types.TxID"]; | ||
| repeated bytes signers = 2 [(gogoproto.casttype) = "AccountID"]; | ||
| ibc.core.client.v1.Height timeout_height = 3 | ||
| [(gogoproto.moretags) = "yaml:\"timeout_height\"", (gogoproto.nullable) = false]; | ||
| uint64 timeout_timestamp = 4 | ||
| [(gogoproto.moretags) = "yaml:\"timeout_timestamp\""]; | ||
| } | ||
|
|
||
| message MsgSignTxResponse { | ||
| option (gogoproto.equal) = false; | ||
| option (gogoproto.goproto_getters) = false; | ||
|
|
||
| bool tx_auth_completed = 1; | ||
| string log = 2; | ||
| } | ||
|
|
||
| message MsgExtSignTx { | ||
| option (gogoproto.equal) = false; | ||
| option (gogoproto.goproto_getters) = false; | ||
|
|
||
| bytes txID = 1 [(gogoproto.casttype) = "github.com/datachainlab/cross/x/core/types.TxID"]; | ||
| repeated Account signers = 2 [(gogoproto.nullable) = false]; | ||
| } | ||
|
|
||
| message MsgExtSignTxResponse { | ||
| option (gogoproto.equal) = false; | ||
| option (gogoproto.goproto_getters) = false; | ||
| } | ||
|
|
||
| message QueryTxAuthStateRequest { | ||
| bytes txID = 1 [(gogoproto.casttype) = "github.com/datachainlab/cross/x/core/types.TxID"]; | ||
| } | ||
|
|
||
| message QueryTxAuthStateResponse { | ||
| TxAuthState tx_auth_state = 1; | ||
| } | ||
|
|
||
| message Account { | ||
| option (gogoproto.equal) = true; | ||
| bytes id = 1 [(gogoproto.casttype) = "AccountID"]; | ||
| AuthType auth_type = 2 [(gogoproto.nullable) = false]; | ||
| } | ||
|
|
||
| message AuthType { | ||
| option (gogoproto.equal) = true; | ||
|
|
||
| enum AuthMode { | ||
| AUTH_MODE_UNSPECIFIED = 0; | ||
| AUTH_MODE_LOCAL = 1; | ||
| AUTH_MODE_CHANNEL = 2; | ||
| AUTH_MODE_EXTENSION = 3; | ||
| } | ||
| } | ||
|
|
||
| option (gogoproto.equal) = true; | ||
| AuthMode mode = 1; | ||
| google.protobuf.Any option = 2 [(gogoproto.nullable) = true]; // xcc or extension_type_url | ||
| } | ||
|
|
||
| message TxAuthState { | ||
| option (gogoproto.equal) = false; | ||
|
|
||
| repeated Account remaining_signers = 1 [(gogoproto.nullable) = false]; | ||
| } | ||
This file contains hidden or 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,30 @@ | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
| pragma solidity ^0.8.20; | ||
|
|
||
| import { | ||
| AuthType, | ||
| MsgSignTx, | ||
| MsgSignTxResponse, | ||
| MsgExtSignTx, | ||
| MsgExtSignTxResponse, | ||
| QueryTxAuthStateRequest, | ||
| QueryTxAuthStateResponse | ||
| } from "../proto/cross/core/auth/Auth.sol"; | ||
|
|
||
| interface IAuthenticator { | ||
YukiTsuchida marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| event TxSigned(address indexed signer, bytes32 indexed txId, AuthType.AuthMode method); | ||
|
|
||
| function signTx(MsgSignTx.Data calldata msg_) external returns (MsgSignTxResponse.Data memory); | ||
|
|
||
| // IBC signing is not supported | ||
| // function ibcSignTx(MsgIBCSignTx.Data calldata msg_) | ||
| // external | ||
| // returns (MsgIBCSignTxResponse.Data memory); | ||
|
|
||
| function extSignTx(MsgExtSignTx.Data calldata msg_) external returns (MsgExtSignTxResponse.Data memory); | ||
|
|
||
| function txAuthState(QueryTxAuthStateRequest.Data calldata req_) | ||
| external | ||
| view | ||
| returns (QueryTxAuthStateResponse.Data memory); | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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