Commit ca62b8c0 authored by pengjun's avatar pengjun Committed by vipwzw

#653 add pokerbull unit test

parent 91390fe4
...@@ -41,7 +41,9 @@ func TestJRPCChannel(t *testing.T) { ...@@ -41,7 +41,9 @@ func TestJRPCChannel(t *testing.T) {
{fn: testStartRawTxCmd}, {fn: testStartRawTxCmd},
{fn: testContinueRawTxCmd}, {fn: testContinueRawTxCmd},
{fn: testQuitRawTxCmd}, {fn: testQuitRawTxCmd},
{fn: testPlayRawTxCmd},
} }
for _, testCase := range testCases { for _, testCase := range testCases {
err := testCase.fn(t, jrpcClient) err := testCase.fn(t, jrpcClient)
assert.Nil(t, err) assert.Nil(t, err)
...@@ -93,6 +95,17 @@ func testContinueRawTxCmd(t *testing.T, jrpc *jsonclient.JSONClient) error { ...@@ -93,6 +95,17 @@ func testContinueRawTxCmd(t *testing.T, jrpc *jsonclient.JSONClient) error {
return jrpc.Call("Chain33.CreateTransaction", params, &res) return jrpc.Call("Chain33.CreateTransaction", params, &res)
} }
func testPlayRawTxCmd(t *testing.T, jrpc *jsonclient.JSONClient) error {
payload := &pty.PBGamePlay{GameId: "123", Round:1, Value:5, Address: []string{"a", "b"}}
params := &rpctypes.CreateTxIn{
Execer: types.ExecName(pty.PokerBullX),
ActionName: pty.CreatePlayTx,
Payload: types.MustPBToJSON(payload),
}
var res string
return jrpc.Call("Chain33.CreateTransaction", params, &res)
}
func testQuitRawTxCmd(t *testing.T, jrpc *jsonclient.JSONClient) error { func testQuitRawTxCmd(t *testing.T, jrpc *jsonclient.JSONClient) error {
payload := &pty.PBGameQuit{GameId: "123"} payload := &pty.PBGameQuit{GameId: "123"}
params := &rpctypes.CreateTxIn{ params := &rpctypes.CreateTxIn{
......
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