aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ethpub/pub.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/ethpub/pub.go b/ethpub/pub.go
index 5f23018f7..f9d2ebc72 100644
--- a/ethpub/pub.go
+++ b/ethpub/pub.go
@@ -59,6 +59,15 @@ func (lib *PEthereum) IsContract(address string) bool {
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) {
return lib.createTx(key, recipient, valueStr, gasStr, gasPriceStr, dataStr, "")
}