Skip to content

Commit

Permalink
api: clarify that .encryption_envelope is EVM-style only
Browse files Browse the repository at this point in the history
  • Loading branch information
pro-wh committed Sep 3, 2024
1 parent d3a1292 commit 8400d2b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion api/spec/v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2916,7 +2916,7 @@ components:
encryption_envelope:
allOf: [$ref: '#/components/schemas/RuntimeTransactionEncryptionEnvelope']
description: |
The data relevant to the encrypted transaction. Only present for encrypted
The data relevant to the EVM encrypted transaction. Only present for encrypted
transactions in confidential EVM runtimes like Sapphire.
Note: The term "envelope" in this context refers to the [Oasis-style encryption envelopes](https://github.com/oasisprotocol/oasis-sdk/blob/c36a7ee194abf4ca28fdac0edbefe3843b39bf69/runtime-sdk/src/types/callformat.rs)
which differ slightly from [digital envelopes](hhttps://en.wikipedia.org/wiki/Hybrid_cryptosystem#Envelope_encryption).
Expand Down
22 changes: 11 additions & 11 deletions storage/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -1480,8 +1480,8 @@ func (c *StorageClient) RuntimeTransactions(ctx context.Context, p apiTypes.GetR
t := RuntimeTransaction{
Error: &TxError{},
}
var encryptionEnvelope RuntimeTransactionEncryptionEnvelope
var encryptionEnvelopeFormat *common.CallFormat
var evmEncryptionEnvelope RuntimeTransactionEncryptionEnvelope
var evmEncryptionEnvelopeFormat *common.CallFormat
var sender0PreimageContextIdentifier *string
var sender0PreimageContextVersion *int
var sender0PreimageData []byte
Expand Down Expand Up @@ -1517,12 +1517,12 @@ func (c *StorageClient) RuntimeTransactions(ctx context.Context, p apiTypes.GetR
&toPreimageData,
&t.Amount,
&t.AmountSymbol,
&encryptionEnvelopeFormat,
&encryptionEnvelope.PublicKey,
&encryptionEnvelope.DataNonce,
&encryptionEnvelope.Data,
&encryptionEnvelope.ResultNonce,
&encryptionEnvelope.Result,
&evmEncryptionEnvelopeFormat,
&evmEncryptionEnvelope.PublicKey,
&evmEncryptionEnvelope.DataNonce,
&evmEncryptionEnvelope.Data,
&evmEncryptionEnvelope.ResultNonce,
&evmEncryptionEnvelope.Result,
&t.Success,
&t.EvmFnName,
&t.EvmFnParams,
Expand All @@ -1547,9 +1547,9 @@ func (c *StorageClient) RuntimeTransactions(ctx context.Context, p apiTypes.GetR
t.Error.Code = *errorCode
}
}
if encryptionEnvelopeFormat != nil { // a rudimentary check to determine if the tx was encrypted
encryptionEnvelope.Format = *encryptionEnvelopeFormat
t.EncryptionEnvelope = &encryptionEnvelope
if evmEncryptionEnvelopeFormat != nil { // a rudimentary check to determine if the tx was encrypted
evmEncryptionEnvelope.Format = *evmEncryptionEnvelopeFormat
t.EncryptionEnvelope = &evmEncryptionEnvelope
}

// Render Ethereum-compatible address preimages.
Expand Down

0 comments on commit 8400d2b

Please sign in to comment.