Skip to content

Commit 221ebe5

Browse files
committed
test:fix oracle publish event tx time expired
1 parent 90168aa commit 221ebe5

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

plugin/dapp/oracle/cmd/test/test-rpc.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ oracle_AddPublisher() {
2323
}
2424

2525
oracle_publish_transaction() {
26-
req='{"method":"Chain33.CreateTransaction","params":[{"execer":"oracle","actionName":"EventPublish","payload":{"type":"football", "subType":"Premier League","time":1747814996,"content":"test","introduction":"test"}}]}'
26+
# time 参数必须是未来时刻
27+
timestamp=$(date +%s)
28+
timestamp=$((timestamp+3600))
29+
req='{"method":"Chain33.CreateTransaction","params":[{"execer":"oracle","actionName":"EventPublish","payload":{"type":"football", "subType":"Premier League","time":'$timestamp',"content":"test","introduction":"test"}}]}'
2730
chain33_Http "$req" ${MAIN_HTTP} '(.error|not) and (.result != null)' "$FUNCNAME" ".result"
2831
chain33_SignAndSendTx "$RETURN_RESP" "${oracle_publisher_key}" "${MAIN_HTTP}"
2932
eventId="${txhash}"

0 commit comments

Comments
 (0)