forked from cerc-io/laconicd-deprecated
implement eth_exportAccount (#331)
This commit is contained in:
@@ -264,6 +264,19 @@ func (e *PublicEthAPI) GetTransactionLogs(txHash common.Hash) ([]*ethtypes.Log,
|
||||
return e.backend.GetTransactionLogs(txHash)
|
||||
}
|
||||
|
||||
// ExportAccount exports an account's balance, code, and storage at the given block number
|
||||
// TODO: deprecate this once the export genesis command works
|
||||
func (e *PublicEthAPI) ExportAccount(address common.Address, blockNumber BlockNumber) (string, error) {
|
||||
ctx := e.cliCtx.WithHeight(blockNumber.Int64())
|
||||
|
||||
res, _, err := ctx.QueryWithData(fmt.Sprintf("custom/%s/%s/%s", types.ModuleName, evm.QueryExportAccount, address.Hex()), nil)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
return string(res), nil
|
||||
}
|
||||
|
||||
// Sign signs the provided data using the private key of address via Geth's signature standard.
|
||||
func (e *PublicEthAPI) Sign(address common.Address, data hexutil.Bytes) (hexutil.Bytes, error) {
|
||||
// TODO: Change this functionality to find an unlocked account by address
|
||||
|
||||
Reference in New Issue
Block a user