Updated to generic padding function

This commit is contained in:
obscuren 2014-07-02 00:05:48 +02:00
parent d7e396a98c
commit fd1d0bbde7
1 changed files with 3 additions and 4 deletions

View File

@ -90,10 +90,9 @@ func (tx *Transaction) Signature(key []byte) []byte {
func (tx *Transaction) PublicKey() []byte {
hash := tx.Hash()
r := make([]byte, 32-len(tx.r))
s := make([]byte, 32-len(tx.s))
r = append(r, ethutil.CopyBytes(tx.r)...)
s = append(s, ethutil.CopyBytes(tx.s)...)
// TODO
r := ethutil.LeftPadBytes(tx.r, 32)
s := ethutil.LeftPadBytes(tx.s, 32)
sig := append(r, s...)
sig = append(sig, tx.v-27)