Updated to generic padding function
This commit is contained in:
parent
d7e396a98c
commit
fd1d0bbde7
|
@ -90,10 +90,9 @@ func (tx *Transaction) Signature(key []byte) []byte {
|
||||||
func (tx *Transaction) PublicKey() []byte {
|
func (tx *Transaction) PublicKey() []byte {
|
||||||
hash := tx.Hash()
|
hash := tx.Hash()
|
||||||
|
|
||||||
r := make([]byte, 32-len(tx.r))
|
// TODO
|
||||||
s := make([]byte, 32-len(tx.s))
|
r := ethutil.LeftPadBytes(tx.r, 32)
|
||||||
r = append(r, ethutil.CopyBytes(tx.r)...)
|
s := ethutil.LeftPadBytes(tx.s, 32)
|
||||||
s = append(s, ethutil.CopyBytes(tx.s)...)
|
|
||||||
|
|
||||||
sig := append(r, s...)
|
sig := append(r, s...)
|
||||||
sig = append(sig, tx.v-27)
|
sig = append(sig, tx.v-27)
|
||||||
|
|
Loading…
Reference in New Issue