Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
jolestar committed Jan 3, 2019
1 parent b7d13a2 commit 303f4fa
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ public boolean isContractCreation() {

public ECKey getKey() {
byte[] hash = getRawHash();
return ECKey.recoverFromSignature(signature.v, signature, hash);
return ECKey.recoverFromSignature(0, signature, hash);
}

public synchronized byte[] getSender() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -787,4 +787,13 @@ public void unsignedChainIdTransactionTest() {
Transaction copyTx = new Transaction(tx.getNonce(), tx.getGasPrice(), tx.getGasLimit(), tx.getReceiveAddress(), tx.getValue(), tx.getData(), tx.getChainId());
assertArrayEquals(rlpUnsignedTx, copyTx.getEncoded());
}

@Test
public void testGetKeyFromSignature() {
ECKey sender = new ECKey();
BlockchainImpl blockchain = ImportLightTest.createBlockchain(GenesisLoader.loadGenesis(
getClass().getResourceAsStream("/genesis/genesis-light.json")));
Transaction tx = createTx(blockchain, sender, new byte[32], new byte[0], 100);
Assert.assertNotNull(tx.getKey());
}
}

0 comments on commit 303f4fa

Please sign in to comment.