feat: Add Provider API for decrypted txs and include eon id for shutterised bid options#6
Conversation
| $ref: '#/definitions/googlerpcStatus' | ||
| parameters: | ||
| - name: txHash | ||
| description: Transaction hash to get the decrypted transaction for. |
There was a problem hiding this comment.
unclear if this is the hash of the plaintext or the encrypted transaction
There was a problem hiding this comment.
the txHash always refers to plaintext transaction hash as that is also used in bid and preconfirmations
| /v1/provider/get_decrypted_transaction: | ||
| get: | ||
| summary: GetDecryptedTransaction | ||
| description: GetDecryptedTransaction is called by the provider to get the decrypted transaction. |
There was a problem hiding this comment.
unclear what "the decrypted transaction" is
| v1GetDecryptedTransactionResponse: | ||
| type: object | ||
| properties: | ||
| decryptedTx: |
There was a problem hiding this comment.
maybe add a pattern to indicate that it should be (presumably) hex encoded
| ctx context.Context, | ||
| req *providerapiv1.GetDecryptedTransactionRequest, | ||
| ) (*providerapiv1.GetDecryptedTransactionResponse, error) { | ||
| txHashes := req.GetTxHash() |
| // DecryptedTransactionData represents the decrypted transaction data | ||
| type DecryptedTransactionData struct { | ||
| TxHash string `json:"tx_hash"` | ||
| Identity string `json:"identity"` |
There was a problem hiding this comment.
are we cleanly distinguishing identity, identity preimage, identity prefix, etc.? Which one is this?
| } | ||
|
|
||
| // GetDecryptedTxResponse represents the response from shutter sequencer endpoint | ||
| type GetDecryptedTxResponse struct { |
There was a problem hiding this comment.
GetDecryptedTransactionResponse for consistency
| } | ||
|
|
||
| // DecryptedTransactionData represents the decrypted transaction data | ||
| type DecryptedTransactionData struct { |
There was a problem hiding this comment.
GetDecryptedTransactionData maybe for consistency?
There was a problem hiding this comment.
this is used in the above struct, so should not matter, imo
| TxHash string `json:"tx_hash"` | ||
| Identity string `json:"identity"` | ||
| DecryptionKey string `json:"decryption_key"` | ||
| DecryptedTx string `json:"decrypted_tx"` // hex encoded |
There was a problem hiding this comment.
DecryptedTransaction (I don't care either way, just think it should be consistent)
| Timeout: 30 * time.Second, | ||
| } | ||
|
|
||
| reqHTTP, err := http.NewRequestWithContext(ctx, http.MethodGet, s.shutterSequencerEndpoint+"/get_decrypted_tx/"+txHashes, nil) |
There was a problem hiding this comment.
Have we already defined the API somewhere? If it's REST, it should probably be just /decrypted_tx without the get.
There was a problem hiding this comment.
the api is part of sequencer and yes, it is rest api, I updating it to just decrypted_tx
| rpc GetCommitmentInfo(GetCommitmentInfoRequest) returns (CommitmentInfoResponse) { | ||
| option (google.api.http) = {get: "/v1/provider/get_commitment_info"}; | ||
| } | ||
| // GetDecryptedTransaction |
There was a problem hiding this comment.
I'm confused why this exist, don't we already have the Swagger API definition?
There was a problem hiding this comment.
this proto file is used to auto generate the swagger definition and the bindings
No description provided.