Commit 58a60ac9 authored by mdj33's avatar mdj33 Committed by vipwzw

fix relay ut

parent 196101f2
...@@ -176,6 +176,7 @@ func (s *suiteRelay) TestExec_2() { ...@@ -176,6 +176,7 @@ func (s *suiteRelay) TestExec_2() {
} }
tx := &types.Transaction{} tx := &types.Transaction{}
tx.Execer = []byte(ty.RelayX)
tx.To = s.addrRelay tx.To = s.addrRelay
tx.Payload = types.Encode(sell) tx.Payload = types.Encode(sell)
tx.Sign(types.SECP256K1, privTo) tx.Sign(types.SECP256K1, privTo)
...@@ -211,7 +212,7 @@ func (s *suiteRelay) TestExec_3() { ...@@ -211,7 +212,7 @@ func (s *suiteRelay) TestExec_3() {
Value: &ty.RelayAction_ConfirmTx{ConfirmTx: order}, Value: &ty.RelayAction_ConfirmTx{ConfirmTx: order},
} }
tx := &types.Transaction{} tx := &types.Transaction{Execer:[]byte("relay")}
tx.To = s.addrRelay tx.To = s.addrRelay
tx.Payload = types.Encode(sell) tx.Payload = types.Encode(sell)
tx.Sign(types.SECP256K1, privFrom) tx.Sign(types.SECP256K1, privFrom)
...@@ -283,6 +284,7 @@ func (s *suiteRelay) TestExec_4() { ...@@ -283,6 +284,7 @@ func (s *suiteRelay) TestExec_4() {
Value: &ty.RelayAction_Verify{Verify: order}, Value: &ty.RelayAction_Verify{Verify: order},
} }
tx := &types.Transaction{} tx := &types.Transaction{}
tx.Execer = []byte(ty.RelayX)
tx.To = s.addrRelay tx.To = s.addrRelay
tx.Payload = types.Encode(sell) tx.Payload = types.Encode(sell)
tx.Sign(types.SECP256K1, privFrom) tx.Sign(types.SECP256K1, privFrom)
......
...@@ -171,6 +171,7 @@ func (s *suiteRelayDB) TestRelayCreate_1() { ...@@ -171,6 +171,7 @@ func (s *suiteRelayDB) TestRelayCreate_1() {
} }
tx := &types.Transaction{} tx := &types.Transaction{}
tx.Execer = []byte(ty.RelayX)
tx.To = s.addrRelay tx.To = s.addrRelay
tx.Nonce = 1 //for different order id tx.Nonce = 1 //for different order id
tx.Sign(types.SECP256K1, privFrom) tx.Sign(types.SECP256K1, privFrom)
...@@ -204,6 +205,7 @@ func (s *suiteRelayDB) TestRevokeCreate_1aUnlock() { ...@@ -204,6 +205,7 @@ func (s *suiteRelayDB) TestRevokeCreate_1aUnlock() {
} }
tx := &types.Transaction{} tx := &types.Transaction{}
tx.Execer = []byte(ty.RelayX)
tx.To = s.addrRelay tx.To = s.addrRelay
tx.Sign(types.SECP256K1, privFrom) tx.Sign(types.SECP256K1, privFrom)
...@@ -225,6 +227,7 @@ func (s *suiteRelayDB) TestRevokeCreate_1bCancel() { ...@@ -225,6 +227,7 @@ func (s *suiteRelayDB) TestRevokeCreate_1bCancel() {
} }
tx := &types.Transaction{} tx := &types.Transaction{}
tx.Execer = []byte(ty.RelayX)
tx.To = s.addrRelay tx.To = s.addrRelay
tx.Sign(types.SECP256K1, privFrom) tx.Sign(types.SECP256K1, privFrom)
...@@ -304,6 +307,7 @@ func (s *suiteAccept) setupRelayCreate() { ...@@ -304,6 +307,7 @@ func (s *suiteAccept) setupRelayCreate() {
} }
tx := &types.Transaction{} tx := &types.Transaction{}
tx.Execer = []byte(ty.RelayX)
tx.To = s.addrRelay tx.To = s.addrRelay
tx.Nonce = 2 //for different order id tx.Nonce = 2 //for different order id
tx.Sign(types.SECP256K1, privFrom) tx.Sign(types.SECP256K1, privFrom)
...@@ -353,6 +357,7 @@ func (s *suiteAccept) TestRelayAccept() { ...@@ -353,6 +357,7 @@ func (s *suiteAccept) TestRelayAccept() {
} }
tx := &types.Transaction{} tx := &types.Transaction{}
tx.Execer = []byte(ty.RelayX)
tx.To = s.addrRelay tx.To = s.addrRelay
tx.Sign(types.SECP256K1, privTo) tx.Sign(types.SECP256K1, privTo)
...@@ -384,6 +389,7 @@ func (s *suiteAccept) TestRevokeAccept_1() { ...@@ -384,6 +389,7 @@ func (s *suiteAccept) TestRevokeAccept_1() {
} }
tx := &types.Transaction{} tx := &types.Transaction{}
tx.Execer = []byte(ty.RelayX)
tx.To = s.addrRelay tx.To = s.addrRelay
tx.Sign(types.SECP256K1, privFrom) tx.Sign(types.SECP256K1, privFrom)
...@@ -405,6 +411,7 @@ func (s *suiteAccept) TestRevokeAccept_2() { ...@@ -405,6 +411,7 @@ func (s *suiteAccept) TestRevokeAccept_2() {
} }
tx := &types.Transaction{} tx := &types.Transaction{}
tx.Execer = []byte(ty.RelayX)
tx.To = s.addrRelay tx.To = s.addrRelay
tx.Sign(types.SECP256K1, privFrom) tx.Sign(types.SECP256K1, privFrom)
...@@ -426,6 +433,7 @@ func (s *suiteAccept) TestRevokeAccept_3() { ...@@ -426,6 +433,7 @@ func (s *suiteAccept) TestRevokeAccept_3() {
} }
tx := &types.Transaction{} tx := &types.Transaction{}
tx.Execer = []byte(ty.RelayX)
tx.To = s.addrRelay tx.To = s.addrRelay
tx.Sign(types.SECP256K1, privTo) tx.Sign(types.SECP256K1, privTo)
...@@ -502,6 +510,7 @@ func (s *suiteConfirm) setupRelayCreate() { ...@@ -502,6 +510,7 @@ func (s *suiteConfirm) setupRelayCreate() {
} }
tx := &types.Transaction{} tx := &types.Transaction{}
tx.Execer = []byte(ty.RelayX)
tx.To = s.addrRelay tx.To = s.addrRelay
tx.Nonce = 3 //for different order id tx.Nonce = 3 //for different order id
tx.Sign(types.SECP256K1, privFrom) tx.Sign(types.SECP256K1, privFrom)
...@@ -552,6 +561,7 @@ func (s *suiteConfirm) setupAccept() { ...@@ -552,6 +561,7 @@ func (s *suiteConfirm) setupAccept() {
} }
tx := &types.Transaction{} tx := &types.Transaction{}
tx.Execer = []byte(ty.RelayX)
tx.To = s.addrRelay tx.To = s.addrRelay
tx.Sign(types.SECP256K1, privTo) tx.Sign(types.SECP256K1, privTo)
...@@ -583,6 +593,7 @@ func (s *suiteConfirm) TestConfirm_1() { ...@@ -583,6 +593,7 @@ func (s *suiteConfirm) TestConfirm_1() {
} }
tx := &types.Transaction{} tx := &types.Transaction{}
tx.Execer = []byte(ty.RelayX)
tx.To = s.addrRelay tx.To = s.addrRelay
tx.Sign(types.SECP256K1, privFrom) tx.Sign(types.SECP256K1, privFrom)
...@@ -601,6 +612,7 @@ func (s *suiteConfirm) TestConfirm_2() { ...@@ -601,6 +612,7 @@ func (s *suiteConfirm) TestConfirm_2() {
} }
tx := &types.Transaction{} tx := &types.Transaction{}
tx.Execer = []byte(ty.RelayX)
tx.To = s.addrRelay tx.To = s.addrRelay
tx.Sign(types.SECP256K1, privTo) tx.Sign(types.SECP256K1, privTo)
...@@ -632,6 +644,7 @@ func (s *suiteConfirm) TestRevokeConfirm_1() { ...@@ -632,6 +644,7 @@ func (s *suiteConfirm) TestRevokeConfirm_1() {
} }
tx := &types.Transaction{} tx := &types.Transaction{}
tx.Execer = []byte(ty.RelayX)
tx.To = s.addrRelay tx.To = s.addrRelay
tx.Sign(types.SECP256K1, privFrom) tx.Sign(types.SECP256K1, privFrom)
...@@ -653,6 +666,7 @@ func (s *suiteConfirm) TestRevokeConfirm_2() { ...@@ -653,6 +666,7 @@ func (s *suiteConfirm) TestRevokeConfirm_2() {
} }
tx := &types.Transaction{} tx := &types.Transaction{}
tx.Execer = []byte(ty.RelayX)
tx.To = s.addrRelay tx.To = s.addrRelay
tx.Sign(types.SECP256K1, privFrom) tx.Sign(types.SECP256K1, privFrom)
...@@ -729,6 +743,7 @@ func (s *suiteVerify) setupRelayCreate() { ...@@ -729,6 +743,7 @@ func (s *suiteVerify) setupRelayCreate() {
} }
tx := &types.Transaction{} tx := &types.Transaction{}
tx.Execer = []byte(ty.RelayX)
tx.To = s.addrRelay tx.To = s.addrRelay
tx.Nonce = 4 //for different order id tx.Nonce = 4 //for different order id
tx.Sign(types.SECP256K1, privFrom) tx.Sign(types.SECP256K1, privFrom)
...@@ -761,6 +776,7 @@ func (s *suiteVerify) setupAccept() { ...@@ -761,6 +776,7 @@ func (s *suiteVerify) setupAccept() {
} }
tx := &types.Transaction{} tx := &types.Transaction{}
tx.Execer = []byte(ty.RelayX)
tx.To = s.addrRelay tx.To = s.addrRelay
tx.Sign(types.SECP256K1, privTo) tx.Sign(types.SECP256K1, privTo)
...@@ -792,6 +808,7 @@ func (s *suiteVerify) setupConfirm() { ...@@ -792,6 +808,7 @@ func (s *suiteVerify) setupConfirm() {
} }
tx := &types.Transaction{} tx := &types.Transaction{}
tx.Execer = []byte(ty.RelayX)
tx.To = s.addrRelay tx.To = s.addrRelay
tx.Sign(types.SECP256K1, privTo) tx.Sign(types.SECP256K1, privTo)
...@@ -877,6 +894,7 @@ func (s *suiteVerify) TestVerify() { ...@@ -877,6 +894,7 @@ func (s *suiteVerify) TestVerify() {
} }
tx := &types.Transaction{} tx := &types.Transaction{}
tx.Execer = []byte(ty.RelayX)
tx.To = s.addrRelay tx.To = s.addrRelay
tx.Sign(types.SECP256K1, privTo) tx.Sign(types.SECP256K1, privTo)
...@@ -960,6 +978,7 @@ func (s *suiteVerifyCli) setupRelayCreate() { ...@@ -960,6 +978,7 @@ func (s *suiteVerifyCli) setupRelayCreate() {
} }
tx := &types.Transaction{} tx := &types.Transaction{}
tx.Execer = []byte(ty.RelayX)
tx.To = s.addrRelay tx.To = s.addrRelay
tx.Nonce = 5 //for different order id tx.Nonce = 5 //for different order id
tx.Sign(types.SECP256K1, privFrom) tx.Sign(types.SECP256K1, privFrom)
...@@ -992,6 +1011,7 @@ func (s *suiteVerifyCli) setupAccept() { ...@@ -992,6 +1011,7 @@ func (s *suiteVerifyCli) setupAccept() {
} }
tx := &types.Transaction{} tx := &types.Transaction{}
tx.Execer = []byte(ty.RelayX)
tx.To = s.addrRelay tx.To = s.addrRelay
tx.Sign(types.SECP256K1, privTo) tx.Sign(types.SECP256K1, privTo)
...@@ -1023,6 +1043,7 @@ func (s *suiteVerifyCli) setupConfirm() { ...@@ -1023,6 +1043,7 @@ func (s *suiteVerifyCli) setupConfirm() {
} }
tx := &types.Transaction{} tx := &types.Transaction{}
tx.Execer = []byte(ty.RelayX)
tx.To = s.addrRelay tx.To = s.addrRelay
tx.Sign(types.SECP256K1, privTo) tx.Sign(types.SECP256K1, privTo)
...@@ -1081,7 +1102,8 @@ func (s *suiteVerifyCli) TestVerify() { ...@@ -1081,7 +1102,8 @@ func (s *suiteVerifyCli) TestVerify() {
BlockHash: "000000000003ba27aa200b1cecaad478d2b00432346c3f1f3986da1afd33e506", BlockHash: "000000000003ba27aa200b1cecaad478d2b00432346c3f1f3986da1afd33e506",
} }
tx := &types.Transaction{} tx := &types.Transaction{Execer:[]byte(ty.RelayX)}
tx.To = s.addrRelay tx.To = s.addrRelay
tx.Sign(types.SECP256K1, privTo) tx.Sign(types.SECP256K1, privTo)
...@@ -1134,7 +1156,7 @@ func (s *suiteSaveBtcHeader) SetupSuite() { ...@@ -1134,7 +1156,7 @@ func (s *suiteSaveBtcHeader) SetupSuite() {
relay.SetChild(relay) relay.SetChild(relay)
s.relay = relay s.relay = relay
tx := &types.Transaction{} tx := &types.Transaction{Execer:[]byte(ty.RelayX)}
tx.To = "addr" tx.To = "addr"
tx.Sign(types.SECP256K1, privFrom) tx.Sign(types.SECP256K1, privFrom)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment