Skip to content

Commit 7404133

Browse files
Addressed PR comments
1 parent 5acd7db commit 7404133

2 files changed

Lines changed: 4 additions & 20 deletions

File tree

transact/transact.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,10 @@ func NewClient(opts *ClientOptions) (*Client, error) {
6262

6363
// HashOperation computes the EIP-712 digest of the given operation.
6464
// - op: The operation to hash.
65-
// - chainId: The chain ID of the blockchain network in which the operation is being executed.
65+
// - chainSelector: chainSelector of the blockchain network in which the operation is being executed.
66+
//
67+
// Fetches chainID corresponding to the chain selector from smartcontractkit/chain-selectors package.
6668
func (t *Client) HashOperation(op *types.Operation, chainSelector string) (common.Hash, error) {
67-
// Fetches chainID corresponding to the chain selector from smartcontractkit/chain-selectors package.
6869
chainSelectorUint, err := strconv.ParseUint(chainSelector, 10, 64)
6970
if err != nil {
7071
return common.Hash{}, fmt.Errorf("failed to parse chain selector: %w", err)
@@ -98,6 +99,7 @@ func (t *Client) HashOperation(op *types.Operation, chainSelector string) (commo
9899
// - ctx: The context for the request.
99100
// - op: The operation to sign.
100101
// - signer: The signer to use for signing the operation. See signer.Signer for details.
102+
// - chainSelector: chainSelector of the blockchain network in which the operation is being executed.
101103
//
102104
// Fetches chainID corresponding to the chain selector from smartcontractkit/chain-selectors package.
103105
func (t *Client) SignOperation(

transact/types/types.go

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,6 @@ func (op *Operation) EIP712Message() apitypes.TypedDataMessage {
8383
// ChainId is parsed as int64 because go-ethereum's apitypes.TypedDataDomain
8484
// uses math.HexOrDecimal256 type for ChainID, whose constructor accepts
8585
// only int64.
86-
//
87-
// -------------------------------
88-
// Non-EVM Chains Compatibility
89-
// -------------------------------
90-
//
91-
// ChainId being int64 instead of string, makes this EIP-712 domain
92-
// incompatible with non-EVM chains and we'll need to explore other methods
93-
// to encode Operations, generate hash and sign them for Solana, Cosmos
94-
// Aptos and Sui chain families.
9586
func (op *Operation) TypedData(chainId string) (*apitypes.TypedData, error) {
9687
chainIdInt, err := strconv.ParseInt(chainId, 10, 64)
9788
if err != nil {
@@ -126,15 +117,6 @@ func (op *Operation) TypedData(chainId string) (*apitypes.TypedData, error) {
126117
//
127118
// ChainId is int64 because go-ethereum's apitypes.TypedDataDomain uses uses
128119
// math.HexOrDecimal256 type for ChainID, whose constructor accepts only int64.
129-
//
130-
// -------------------------------
131-
// Non-EVM Chains Compatibility
132-
// -------------------------------
133-
//
134-
// ChainId being int64 instead of string makes this EIP-712 domain
135-
// incompatible with non-EVM chains, and we'll need to explore other methods
136-
// to encode Operations, generate hashes, and sign them for Solana, Cosmos,
137-
// Aptos, and Sui chain families.
138120
type EIP712Domain struct {
139121
Name string `json:"name"`
140122
Version string `json:"version"`

0 commit comments

Comments
 (0)