mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-17 09:23:48 +00:00
p2p/enr: update python test
This commit is contained in:
parent
08cdd66304
commit
9474f327a9
2 changed files with 1 additions and 4 deletions
|
|
@ -281,9 +281,6 @@ func (r *Record) verifySignature() error {
|
||||||
list = r.appendPairs(list)
|
list = r.appendPairs(list)
|
||||||
h := sha3.NewKeccak256()
|
h := sha3.NewKeccak256()
|
||||||
rlp.Encode(h, list)
|
rlp.Encode(h, list)
|
||||||
fmt.Printf("sig: %x\n", r.signature)
|
|
||||||
fmt.Printf("key: %x\n", key)
|
|
||||||
fmt.Printf("hash: %x\n", h.Sum(nil))
|
|
||||||
if !crypto.VerifySignature(key, h.Sum(nil), r.signature) {
|
if !crypto.VerifySignature(key, h.Sum(nil), r.signature) {
|
||||||
return errInvalidSig
|
return errInvalidSig
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -238,7 +238,7 @@ func TestNodeAddr(t *testing.T) {
|
||||||
// TestPythonInterop checks that we can decode and verify a record produced by the Python
|
// TestPythonInterop checks that we can decode and verify a record produced by the Python
|
||||||
// implementation.
|
// implementation.
|
||||||
func TestPythonInterop(t *testing.T) {
|
func TestPythonInterop(t *testing.T) {
|
||||||
enc, _ := hex.DecodeString("f896b840638a54215d80a6713c8d523a6adc4e6e73652d859103a36b700851cb0e61b66b8ebfc1a610c57d732ec6e0a8f06a9a7a28df5051ece514702ff9cdff0b11f454018664697363763582765f82696490736563703235366b312d6b656363616b83697034847f00000189736563703235366b31a103ca634cae0d49acb401d8a4c6b6fe8c55b70d115bf400769cc1400f3258cd3138")
|
enc, _ := hex.DecodeString("f896b840954dc36583c1f4b69ab59b1375f362f06ee99f3723cd77e64b6de6d211c27d7870642a79d4516997f94091325d2a7ca6215376971455fb221d34f35b277149a1018664697363763582765f82696490736563703235366b312d6b656363616b83697034847f00000189736563703235366b31a103ca634cae0d49acb401d8a4c6b6fe8c55b70d115bf400769cc1400f3258cd3138")
|
||||||
var r Record
|
var r Record
|
||||||
if err := rlp.DecodeBytes(enc, &r); err != nil {
|
if err := rlp.DecodeBytes(enc, &r); err != nil {
|
||||||
t.Fatalf("can't decode: %v", err)
|
t.Fatalf("can't decode: %v", err)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue