mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-02 22:32:55 +00:00
Added secret to address method
This commit is contained in:
parent
7c91159449
commit
5757f5df2a
1 changed files with 9 additions and 0 deletions
|
|
@ -59,6 +59,15 @@ func (lib *PEthereum) IsContract(address string) bool {
|
||||||
return lib.GetStateObject(address).IsContract()
|
return lib.GetStateObject(address).IsContract()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (lib *PEthereum) SecretToAddress(key string) string {
|
||||||
|
pair, err := ethchain.NewKeyPairFromSec(ethutil.FromHex(key))
|
||||||
|
if err != nil {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
return ethutil.Hex(pair.Address())
|
||||||
|
}
|
||||||
|
|
||||||
func (lib *PEthereum) Transact(key, recipient, valueStr, gasStr, gasPriceStr, dataStr string) (*PReceipt, error) {
|
func (lib *PEthereum) Transact(key, recipient, valueStr, gasStr, gasPriceStr, dataStr string) (*PReceipt, error) {
|
||||||
return lib.createTx(key, recipient, valueStr, gasStr, gasPriceStr, dataStr, "")
|
return lib.createTx(key, recipient, valueStr, gasStr, gasPriceStr, dataStr, "")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue