Skip to content

Commit

Permalink
Rename field
Browse files Browse the repository at this point in the history
  • Loading branch information
ferranbt committed Jun 3, 2024
1 parent ed2a50f commit 8a669dc
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions core/types/confidential.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type ConfidentialComputeRecord struct {
ConfidentialInputsHash common.Hash

// Envelope signals whether this CCR was signed using EIP-712
Envelope bool
IsEIP712 bool

ChainID *big.Int
V, R, S *big.Int
Expand All @@ -33,7 +33,7 @@ func (tx *ConfidentialComputeRecord) copy() TxData {
Gas: tx.Gas,
KettleAddress: tx.KettleAddress,
ConfidentialInputsHash: tx.ConfidentialInputsHash,
Envelope: tx.Envelope,
IsEIP712: tx.IsEIP712,

Value: new(big.Int),
GasPrice: new(big.Int),
Expand Down
8 changes: 4 additions & 4 deletions core/types/transaction_marshalling.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ type txJSON struct {
BlobVersionedHashes []common.Hash `json:"blobVersionedHashes,omitempty"`
KettleAddress *common.Address `json:"kettleAddress,omitempty"`
ConfidentialInputsHash *common.Hash `json:"confidentialInputsHash,omitempty"`
Envelope *bool `json:"envelope,omitempty"`
IsEIP712 *bool `json:"iseip712,omitempty"`
ConfidentialInputs *hexutil.Bytes `json:"confidentialInputs,omitempty"`
RequestRecord *json.RawMessage `json:"requestRecord,omitempty"`
ConfidentialComputeResult *hexutil.Bytes `json:"confidentialComputeResult,omitempty"`
Expand Down Expand Up @@ -147,7 +147,7 @@ func (tx *Transaction) MarshalJSON() ([]byte, error) {
enc.V = (*hexutil.Big)(itx.V)
enc.R = (*hexutil.Big)(itx.R)
enc.S = (*hexutil.Big)(itx.S)
enc.Envelope = &itx.Envelope
enc.IsEIP712 = &itx.IsEIP712

case *SuaveTransaction:
requestRecord, err := NewTx(&itx.ConfidentialComputeRequest).MarshalJSON()
Expand Down Expand Up @@ -500,8 +500,8 @@ func (tx *Transaction) UnmarshalJSON(input []byte) error {
return errors.New("missing required field 'chainId' in transaction")
}
itx.ChainID = (*big.Int)(dec.ChainID)
if dec.Envelope != nil {
itx.Envelope = *dec.Envelope
if dec.IsEIP712 != nil {
itx.IsEIP712 = *dec.IsEIP712
}
if dec.V == nil {
return errors.New("missing required field 'r' in transaction")
Expand Down
4 changes: 2 additions & 2 deletions core/types/transaction_signing.go
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ func (s suaveSigner) Hash(tx *Transaction) common.Hash {
txdata.ConfidentialComputeResult,
})
case *ConfidentialComputeRequest:
if txdata.Envelope {
if txdata.IsEIP712 {
// EIP-712 signature used during signing
hash, err := txdata.ConfidentialComputeRecord.EIP712Hash()
if err != nil {
Expand All @@ -381,7 +381,7 @@ func (s suaveSigner) Hash(tx *Transaction) common.Hash {
tx.Data(),
})
case *ConfidentialComputeRecord:
if txdata.Envelope {
if txdata.IsEIP712 {
// EIP-712 signature using during recovery
hash, err := txdata.EIP712Hash()
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion suave/sdk/sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func (c *Contract) SendTransaction(method string, args []interface{}, confidenti
}
if c.client.useEIP712 {
record.ChainID = signer.ChainID()
record.Envelope = true
record.IsEIP712 = true
}

computeRequest, err := types.SignTx(types.NewTx(&types.ConfidentialComputeRequest{
Expand Down

0 comments on commit 8a669dc

Please sign in to comment.