Commit b32ec6be authored by pengjun's avatar pengjun

fix retrieve rpc test error

parent d21a8b15
...@@ -68,7 +68,7 @@ pokerbull_PlayRawTx() { ...@@ -68,7 +68,7 @@ pokerbull_PlayRawTx() {
tx=$(curl -ksd '{"method":"Chain33.CreateTransaction","params":[{"execer":"pokerbull","actionName":"Play","payload":{"gameId":"pokerbull-abc", "value":"1000000000", "round":1}}]}' ${MAIN_HTTP} | jq -r ".result") tx=$(curl -ksd '{"method":"Chain33.CreateTransaction","params":[{"execer":"pokerbull","actionName":"Play","payload":{"gameId":"pokerbull-abc", "value":"1000000000", "round":1}}]}' ${MAIN_HTTP} | jq -r ".result")
data=$(curl -ksd '{"method":"Chain33.DecodeRawTransaction","params":[{"txHex":"'"$tx"'"}]}' ${MAIN_HTTP} | jq -r ".result.txs[0]") data=$(curl -ksd '{"method":"Chain33.DecodeRawTransaction","params":[{"txHex":"'"$tx"'"}]}' ${MAIN_HTTP} | jq -r ".result.txs[0]")
ok=$(jq '(.execer == "pokerbull")' <<<"$data") ok=$(jq '(.execer != "")' <<<"$data")
[ "$ok" == true ] [ "$ok" == true ]
echo_rst "$FUNCNAME" "$?" echo_rst "$FUNCNAME" "$?"
...@@ -84,7 +84,7 @@ pokerbull_QuitRawTx() { ...@@ -84,7 +84,7 @@ pokerbull_QuitRawTx() {
tx=$(curl -ksd '{"method":"Chain33.CreateTransaction","params":[{"execer":"pokerbull","actionName":"Quit","payload":{"gameId":"'$GAME_ID'"}}]}' ${MAIN_HTTP} | jq -r ".result") tx=$(curl -ksd '{"method":"Chain33.CreateTransaction","params":[{"execer":"pokerbull","actionName":"Quit","payload":{"gameId":"'$GAME_ID'"}}]}' ${MAIN_HTTP} | jq -r ".result")
data=$(curl -ksd '{"method":"Chain33.DecodeRawTransaction","params":[{"txHex":"'"$tx"'"}]}' ${MAIN_HTTP} | jq -r ".result.txs[0]") data=$(curl -ksd '{"method":"Chain33.DecodeRawTransaction","params":[{"txHex":"'"$tx"'"}]}' ${MAIN_HTTP} | jq -r ".result.txs[0]")
ok=$(jq '(.execer == "pokerbull")' <<<"$data") ok=$(jq '(.execer != "")' <<<"$data")
[ "$ok" == true ] [ "$ok" == true ]
echo_rst "$FUNCNAME" "$?" echo_rst "$FUNCNAME" "$?"
...@@ -100,7 +100,7 @@ pokerbull_ContinueRawTx() { ...@@ -100,7 +100,7 @@ pokerbull_ContinueRawTx() {
tx=$(curl -ksd '{"method":"Chain33.CreateTransaction","params":[{"execer":"pokerbull","actionName":"Continue","payload":{"gameId":"'$GAME_ID'"}}]}' ${MAIN_HTTP} | jq -r ".result") tx=$(curl -ksd '{"method":"Chain33.CreateTransaction","params":[{"execer":"pokerbull","actionName":"Continue","payload":{"gameId":"'$GAME_ID'"}}]}' ${MAIN_HTTP} | jq -r ".result")
data=$(curl -ksd '{"method":"Chain33.DecodeRawTransaction","params":[{"txHex":"'"$tx"'"}]}' ${MAIN_HTTP} | jq -r ".result.txs[0]") data=$(curl -ksd '{"method":"Chain33.DecodeRawTransaction","params":[{"txHex":"'"$tx"'"}]}' ${MAIN_HTTP} | jq -r ".result.txs[0]")
ok=$(jq '(.execer == "pokerbull")' <<<"$data") ok=$(jq '(.execer != "")' <<<"$data")
[ "$ok" == true ] [ "$ok" == true ]
echo_rst "$FUNCNAME" "$?" echo_rst "$FUNCNAME" "$?"
...@@ -116,7 +116,7 @@ pokerbull_StartRawTx() { ...@@ -116,7 +116,7 @@ pokerbull_StartRawTx() {
tx=$(curl -ksd '{"method":"Chain33.CreateTransaction","params":[{"execer":"pokerbull","actionName":"Start","payload":{"value":"1000000000", "playerNum":"2"}}]}' ${MAIN_HTTP} | jq -r ".result") tx=$(curl -ksd '{"method":"Chain33.CreateTransaction","params":[{"execer":"pokerbull","actionName":"Start","payload":{"value":"1000000000", "playerNum":"2"}}]}' ${MAIN_HTTP} | jq -r ".result")
data=$(curl -ksd '{"method":"Chain33.DecodeRawTransaction","params":[{"txHex":"'"$tx"'"}]}' ${MAIN_HTTP} | jq -r ".result.txs[0]") data=$(curl -ksd '{"method":"Chain33.DecodeRawTransaction","params":[{"txHex":"'"$tx"'"}]}' ${MAIN_HTTP} | jq -r ".result.txs[0]")
ok=$(jq '(.execer == "pokerbull")' <<<"$data") ok=$(jq '(.execer != "")' <<<"$data")
[ "$ok" == true ] [ "$ok" == true ]
echo_rst "$FUNCNAME" "$?" echo_rst "$FUNCNAME" "$?"
......
...@@ -141,7 +141,7 @@ retrieve_Cancel() { ...@@ -141,7 +141,7 @@ retrieve_Cancel() {
retrieve_QueryResult() { retrieve_QueryResult() {
echo "========== # retrieve query result begin ==========" echo "========== # retrieve query result begin =========="
local status=$3 local status=$1
req='"method":"Chain33.Query","params":[{"execer":"retrieve","funcName":"GetRetrieveInfo","payload":{"backupAddress":"1E5saiXVb9mW8wcWUUZjsHJPZs5GmdzuSY", "defaultAddress":"14KEKbYtKKQm4wMthSK9J4La4nAiidGozt"}}]' req='"method":"Chain33.Query","params":[{"execer":"retrieve","funcName":"GetRetrieveInfo","payload":{"backupAddress":"1E5saiXVb9mW8wcWUUZjsHJPZs5GmdzuSY", "defaultAddress":"14KEKbYtKKQm4wMthSK9J4La4nAiidGozt"}}]'
data=$(curl -ksd "{$req}" ${MAIN_HTTP} | jq -r ".result") data=$(curl -ksd "{$req}" ${MAIN_HTTP} | jq -r ".result")
...@@ -213,17 +213,17 @@ Chain33_SendToAddress() { ...@@ -213,17 +213,17 @@ Chain33_SendToAddress() {
} }
function run_test() { function run_test() {
retrieve_Backup "1E5saiXVb9mW8wcWUUZjsHJPZs5GmdzuSY" "14KEKbYtKKQm4wMthSK9J4La4nAiidGozt" 61 retrieve_Backup
retrieve_QueryResult "1E5saiXVb9mW8wcWUUZjsHJPZs5GmdzuSY" "14KEKbYtKKQm4wMthSK9J4La4nAiidGozt" 1 retrieve_QueryResult 1
retrieve_Prepare "1E5saiXVb9mW8wcWUUZjsHJPZs5GmdzuSY" "14KEKbYtKKQm4wMthSK9J4La4nAiidGozt" retrieve_Prepare
retrieve_QueryResult "1E5saiXVb9mW8wcWUUZjsHJPZs5GmdzuSY" "14KEKbYtKKQm4wMthSK9J4La4nAiidGozt" 2 retrieve_QueryResult 2
#retrieve_Perform "1E5saiXVb9mW8wcWUUZjsHJPZs5GmdzuSY" "14KEKbYtKKQm4wMthSK9J4La4nAiidGozt" #retrieve_Perform "1E5saiXVb9mW8wcWUUZjsHJPZs5GmdzuSY" "14KEKbYtKKQm4wMthSK9J4La4nAiidGozt"
#retrieve_QueryResult "1E5saiXVb9mW8wcWUUZjsHJPZs5GmdzuSY" "14KEKbYtKKQm4wMthSK9J4La4nAiidGozt" 3 #retrieve_QueryResult "1E5saiXVb9mW8wcWUUZjsHJPZs5GmdzuSY" "14KEKbYtKKQm4wMthSK9J4La4nAiidGozt" 3
retrieve_Cancel "1E5saiXVb9mW8wcWUUZjsHJPZs5GmdzuSY" "14KEKbYtKKQm4wMthSK9J4La4nAiidGozt" retrieve_Cancel
retrieve_QueryResult "1E5saiXVb9mW8wcWUUZjsHJPZs5GmdzuSY" "14KEKbYtKKQm4wMthSK9J4La4nAiidGozt" 4 retrieve_QueryResult 4
} }
function main() { function main() {
......
...@@ -16,7 +16,7 @@ func (c *channelClient) Backup(ctx context.Context, v *rt.BackupRetrieve) (*type ...@@ -16,7 +16,7 @@ func (c *channelClient) Backup(ctx context.Context, v *rt.BackupRetrieve) (*type
Ty: rt.RetrieveActionBackup, Ty: rt.RetrieveActionBackup,
Value: &rt.RetrieveAction_Backup{Backup: v}, Value: &rt.RetrieveAction_Backup{Backup: v},
} }
tx, err := types.CreateFormatTx(string(rt.ExecerRetrieve), types.Encode(backup)) tx, err := types.CreateFormatTx(types.ExecName(rt.RetrieveX), types.Encode(backup))
if err != nil { if err != nil {
return nil, err return nil, err
} }
...@@ -29,7 +29,7 @@ func (c *channelClient) Prepare(ctx context.Context, v *rt.PrepareRetrieve) (*ty ...@@ -29,7 +29,7 @@ func (c *channelClient) Prepare(ctx context.Context, v *rt.PrepareRetrieve) (*ty
Ty: rt.RetrieveActionPrepare, Ty: rt.RetrieveActionPrepare,
Value: &rt.RetrieveAction_Prepare{Prepare: v}, Value: &rt.RetrieveAction_Prepare{Prepare: v},
} }
tx, err := types.CreateFormatTx(string(rt.ExecerRetrieve), types.Encode(prepare)) tx, err := types.CreateFormatTx(types.ExecName(rt.RetrieveX), types.Encode(prepare))
if err != nil { if err != nil {
return nil, err return nil, err
} }
...@@ -43,7 +43,7 @@ func (c *channelClient) Perform(ctx context.Context, v *rt.PerformRetrieve) (*ty ...@@ -43,7 +43,7 @@ func (c *channelClient) Perform(ctx context.Context, v *rt.PerformRetrieve) (*ty
Ty: rt.RetrieveActionPerform, Ty: rt.RetrieveActionPerform,
Value: &rt.RetrieveAction_Perform{Perform: v}, Value: &rt.RetrieveAction_Perform{Perform: v},
} }
tx, err := types.CreateFormatTx(string(rt.ExecerRetrieve), types.Encode(perform)) tx, err := types.CreateFormatTx(types.ExecName(rt.RetrieveX), types.Encode(perform))
if err != nil { if err != nil {
return nil, err return nil, err
} }
...@@ -56,7 +56,7 @@ func (c *channelClient) Cancel(ctx context.Context, v *rt.CancelRetrieve) (*type ...@@ -56,7 +56,7 @@ func (c *channelClient) Cancel(ctx context.Context, v *rt.CancelRetrieve) (*type
Ty: rt.RetrieveActionCancel, Ty: rt.RetrieveActionCancel,
Value: &rt.RetrieveAction_Cancel{Cancel: v}, Value: &rt.RetrieveAction_Cancel{Cancel: v},
} }
tx, err := types.CreateFormatTx(string(rt.ExecerRetrieve), types.Encode(cancel)) tx, err := types.CreateFormatTx(types.ExecName(rt.RetrieveX), types.Encode(cancel))
if err != nil { if err != nil {
return nil, err return nil, err
} }
......
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