mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
clef: more tests for signer
This commit is contained in:
parent
1b84db0169
commit
a9e2b0f77e
1 changed files with 9 additions and 1 deletions
|
|
@ -28,7 +28,15 @@ init()
|
||||||
function testTx(){
|
function testTx(){
|
||||||
if( accts && accts.length > 0) {
|
if( accts && accts.length > 0) {
|
||||||
var a = accts[0]
|
var a = accts[0]
|
||||||
eth.signTransaction({from: a, to: a, value: 1, nonce: 1, gas: 1, gasPrice: 1})
|
var txdata = eth.signTransaction({from: a, to: a, value: 1, nonce: 1, gas: 1, gasPrice: 1})
|
||||||
|
var v = parseInt(txdata.tx.v)
|
||||||
|
console.log("V value: ", v)
|
||||||
|
if (v == 37 || v == 38){
|
||||||
|
console.log("Mainnet 155-protected chainid was used")
|
||||||
|
}
|
||||||
|
if (v == 27 || v == 28){
|
||||||
|
throw new Error("Mainnet chainid was used, but without replay protection!")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function testSignText(){
|
function testSignText(){
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue