aboutsummaryrefslogtreecommitdiffstats
path: root/ethpub
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-05-05 19:09:29 +0800
committerobscuren <geffobscura@gmail.com>2014-05-05 19:09:29 +0800
commit5757f5df2a5ffc4207ab2be5f1280d4f2e95d303 (patch)
treed3a8f9f35c8c280b00a67245bcb285220669a6d9 /ethpub
parent7c91159449c528daa099aec5a3744aa8a6b5a826 (diff)
downloadgo-tangerine-5757f5df2a5ffc4207ab2be5f1280d4f2e95d303.tar
go-tangerine-5757f5df2a5ffc4207ab2be5f1280d4f2e95d303.tar.gz
go-tangerine-5757f5df2a5ffc4207ab2be5f1280d4f2e95d303.tar.bz2
go-tangerine-5757f5df2a5ffc4207ab2be5f1280d4f2e95d303.tar.lz
go-tangerine-5757f5df2a5ffc4207ab2be5f1280d4f2e95d303.tar.xz
go-tangerine-5757f5df2a5ffc4207ab2be5f1280d4f2e95d303.tar.zst
go-tangerine-5757f5df2a5ffc4207ab2be5f1280d4f2e95d303.zip
Added secret to address method
Diffstat (limited to 'ethpub')
-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, "")
}