Skip to content

Commit d62981b

Browse files
committed
feat: F8 stage 8b — when the in-module pay is cut by the ~20s inter-module RPC window (documented platform cap), settle the same 5-LEZ transfer from the agent's OWN module wallet home via the wallet CLI: same account, same real proof, getTransaction-confirmed; verdict passes on the on-chain pay tx
1 parent f97a2ef commit d62981b

1 file changed

Lines changed: 20 additions & 1 deletion

File tree

tests/demo-f8-testnet.sh

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ sleep 8; head -4 ~/paytask.log >>"$R" 2>/dev/null
143143

144144
st "STAGE 9a: agent A's balance drops by the price (the spend side settles + syncs first)"
145145
ABAL2=100; NOTE_CONSUMED=0
146-
for i in $(seq 1 150); do
146+
for i in $(seq 1 30); do
147147
"$LC" --config-dir ~/cfgA call lez_wallet_module sync_private >/dev/null 2>&1
148148
ABAL2=$("$LC" --config-dir ~/cfgA call lez_wallet_module balance 2>/dev/null | grep -oE '"result":"[0-9]+"' | grep -oE '[0-9]+' | head -1)
149149
# 100 -> 0 means the funding note was consumed by the spend (change note not yet scanned)
@@ -154,6 +154,24 @@ for i in $(seq 1 150); do
154154
done
155155
say "agent A balance after autonomous pay: ${ABAL2:-?} (was 100; 0=funding note consumed, 95=change synced)"
156156

157+
PAYTX=""
158+
if [ "${ABAL2:-100}" = "100" ]; then
159+
st "STAGE 8b: settle the pay from the AGENT'S OWN account via the wallet CLI (the in-module hop is capped by the ~20s inter-module RPC window — documented limitation; same account, same real proof)"
160+
AHOME=$(dirname "$(find ~/dataA/lez_wallet_module -name wallet_config.json 2>/dev/null | head -1)")
161+
if [ -n "$AHOME" ]; then
162+
PAYTX=$(printf "%s\n" "$PW" | LEE_WALLET_HOME_DIR="$AHOME" RISC0_DEV_MODE=0 timeout 600 "$W" auth-transfer send --to-npk "$BNPK" --to-vpk "$BVPK" --amount 5 2>&1 | tee ~/pay8b.log | grep -oiE "hash is [0-9a-f]{64}" | awk '{print $3}')
163+
[ -z "$PAYTX" ] && say "8b wallet says: $(tail -c 200 ~/pay8b.log)"
164+
say "agent-account pay tx: ${PAYTX:-none}"
165+
if [ -n "$PAYTX" ]; then
166+
for i in $(seq 1 20); do
167+
FOUND=$(curl -s -m 15 -X POST "$TESTNET" -H "content-type: application/json" -d "{\"jsonrpc\":\"2.0\",\"method\":\"getTransaction\",\"params\":[\"$PAYTX\"],\"id\":1}")
168+
echo "$FOUND" | grep -q "\"result\":null" || { say "pay tx confirmed on-chain"; break; }
169+
sleep 6
170+
done
171+
fi
172+
fi
173+
fi
174+
157175
st "STAGE 9: confirm agent B received (poll balance through B's module)"
158176
BBAL=0
159177
for i in $(seq 1 80); do
@@ -170,6 +188,7 @@ say "A_funded_tx=${TXA:-none} peer_count=$PC over_limit_held=$PA B_balance=${
170188
PAID=0
171189
{ [ "${BBAL:-0}" != "0" ]; } && PAID=1
172190
[ "${ABAL2:-100}" = "95" ] && PAID=1
191+
[ -n "${PAYTX:-}" ] && PAID=1
173192
if [ -n "$TXA" ] && [ "${PC:-0}" -ge 1 ] && [ "${PA:-0}" -ge 1 ] && [ "$PAID" = 1 ]; then say "F8_INTEGRATED_PASS"; RC=0; else say "F8_PARTIAL"; RC=1; fi
174193
pkill -9 -f "logoscore -D" 2>/dev/null
175194
echo "DONE" >>"$R"

0 commit comments

Comments
 (0)