core, core/types: refactored tx chain id checking

Refactored explicit chain id checking in to the Sender deriviation method
This commit is contained in:
Jeffrey Wilcke
2016-11-14 15:59:31 +01:00
parent ca73dea3b9
commit 6c9c1e6712
4 changed files with 48 additions and 12 deletions

View File

@ -1226,11 +1226,8 @@ func TestEIP155Transition(t *testing.T) {
block.AddTx(tx)
}
})
errExp := "Invalid transaction chain id. Current chain id: 1 tx chain id: 2"
_, err := blockchain.InsertChain(blocks)
if err == nil {
t.Error("expected transaction chain id error")
} else if err.Error() != errExp {
t.Error("expected:", errExp, "got:", err)
if err != types.ErrInvalidChainId {
t.Error("expected error:", types.ErrInvalidChainId)
}
}