Skip to content

Commit

Permalink
Review: add todo to avoid custom query in enclave layer
Browse files Browse the repository at this point in the history
  • Loading branch information
BedrockSquirrel committed Jul 4, 2024
1 parent 7e6c1c9 commit c05cafc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions go/enclave/enclave.go
Original file line number Diff line number Diff line change
Expand Up @@ -855,6 +855,8 @@ func (e *enclaveImpl) GetTotalContractCount(ctx context.Context) (*big.Int, comm
return e.storage.GetContractCount(ctx)
}

// GetCustomQuery is a generic query method for queries that don't match the eth API.
// todo: get rid of this method and use specific methods for each query (e.g. GetPersonalTransactions)
func (e *enclaveImpl) GetCustomQuery(ctx context.Context, encryptedParams common.EncryptedParamsGetStorageAt) (*responses.PrivateQueryResponse, common.SystemError) {
// ensure the enclave is running
if e.stopControl.IsStopping() {
Expand Down
1 change: 1 addition & 0 deletions tools/walletextension/rpcapi/blockchain_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ func (api *BlockChainAPI) GetStorageAt(ctx context.Context, address gethcommon.A
if err != nil {
return nil, fmt.Errorf("unable to extract address from custom query params: %w", err)
}
// todo: we should be calling something like `ten_getPrivateTransactions` here, this custom query stuff only needs to be in the gateway layer
resp, err := ExecAuthRPC[any](ctx, api.we, &ExecCfg{account: userAddr}, "eth_getStorageAt", address.Hex(), params, nil)
if err != nil {
return nil, fmt.Errorf("unable to execute custom query: %w", err)
Expand Down

0 comments on commit c05cafc

Please sign in to comment.