fixes for chain id in nametx sign functions

This commit is contained in:
Ethan Buchman
2015-05-30 01:54:25 -04:00
parent 19bd3bb2e2
commit 6eb8386c7c
6 changed files with 26 additions and 24 deletions
+2 -2
View File
@@ -107,7 +107,7 @@ func makeDefaultSendTxSigned(t *testing.T, typ string, addr []byte, amt uint64)
func makeDefaultCallTx(t *testing.T, typ string, addr, code []byte, amt, gasLim, fee uint64) *types.CallTx {
nonce := getNonce(t, typ, user[0].Address)
tx := types.NewCallTxWithNonce(user[0].PubKey, addr, code, amt, gasLim, fee, nonce)
tx := types.NewCallTxWithNonce(user[0].PubKey, addr, code, amt, gasLim, fee, nonce+1)
tx.Sign(chainID, user[0])
return tx
}
@@ -115,7 +115,7 @@ func makeDefaultCallTx(t *testing.T, typ string, addr, code []byte, amt, gasLim,
func makeDefaultNameTx(t *testing.T, typ string, name, value string, amt, fee uint64) *types.NameTx {
nonce := getNonce(t, typ, user[0].Address)
tx := types.NewNameTxWithNonce(user[0].PubKey, name, value, amt, fee, nonce+1)
tx.Sign(user[0])
tx.Sign(chainID, user[0])
return tx
}
+1 -1
View File
@@ -238,7 +238,7 @@ func testNameReg(t *testing.T, typ string) {
nonce := getNonce(t, typ, user[1].Address)
data2 := "this is not my beautiful house"
tx = types.NewNameTxWithNonce(user[1].PubKey, name, data2, amt, fee, nonce+1)
tx.Sign(user[1])
tx.Sign(chainID, user[1])
_, err := client.BroadcastTx(tx)
if err == nil {
t.Fatal("Expected error on NameTx")