-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix personal transactions RPC request (#1923)
- Loading branch information
1 parent
e3fae8d
commit 2ef267d
Showing
22 changed files
with
350 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package common | ||
|
||
import "github.com/ethereum/go-ethereum/common" | ||
|
||
// CustomQueries are Ten-specific queries that are not supported by the Ethereum RPC API but that we wish to support | ||
// through the same interface. | ||
// | ||
// We currently use the eth_getStorageAt method to route these queries through the Ethereum RPC API. | ||
// | ||
// In order to match the eth_getStorageAt method signature, we require that all custom queries use an incrementing "address" | ||
// to specify the method we are calling (e.g. 0x000...001 is getUserID, 0x000...002 is listPrivateTransactions). | ||
// | ||
// The signature is: eth_getStorageAt(method, params, nil) where: | ||
// - method is the address of the custom query as an address (e.g. 0x000...001) | ||
// - params is a JSON string with the parameters for the query (this complies with the eth_getStorageAt method signature since position gets encoded as a hex string) | ||
// | ||
// NOTE: Private custom queries must also include "address" as a top-level field in the params json object to indicate | ||
// the account the query is being made for. | ||
|
||
// CustomQuery methods | ||
const ( | ||
UserIDRequestCQMethod = "0x0000000000000000000000000000000000000001" | ||
ListPrivateTransactionsCQMethod = "0x0000000000000000000000000000000000000002" | ||
) | ||
|
||
type ListPrivateTransactionsQueryParams struct { | ||
Address common.Address `json:"address"` | ||
Pagination QueryPagination `json:"pagination"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.