用例本身要能在 raw 里留下"转发次数 + 台账 state/owner/nonce/绑定/回执", 否则审核只能看到 PASS 字样,无法核对状态链与许可归属。
This commit is contained in:
@@ -3,6 +3,7 @@ package v071
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
"os"
|
||||
@@ -106,6 +107,19 @@ func (a *ds01Authority) dispatchRow(t *testing.T) (state, owner string) {
|
||||
return state, owner
|
||||
}
|
||||
|
||||
func (a *ds01Authority) dispatchEvidence(t *testing.T) string {
|
||||
t.Helper()
|
||||
var state, owner, nonce, receipt, binding string
|
||||
var epoch int64
|
||||
if err := a.pool.QueryRow(context.Background(),
|
||||
`SELECT state, dispatch_owner, dispatch_epoch, dispatch_nonce, binding_digest,
|
||||
COALESCE(marker_receipt::text,'')
|
||||
FROM library_index_restore_dispatch`).Scan(&state, &owner, &epoch, &nonce, &binding, &receipt); err != nil {
|
||||
t.Fatalf("read dispatch evidence: %v", err)
|
||||
}
|
||||
return fmt.Sprintf("state=%s owner=%q epoch=%d nonce=%s binding=%s receipt=%s", state, owner, epoch, nonce, binding, receipt)
|
||||
}
|
||||
|
||||
func (a *ds01Authority) dispatchRows(t *testing.T) int {
|
||||
t.Helper()
|
||||
var count int
|
||||
@@ -212,6 +226,7 @@ func TestDS01PreparedEffectResumesToTerminalState(t *testing.T) {
|
||||
if state, owner := authority.dispatchRow(t); state != libraryrelease.RestoreDispatchPrepared || owner != "" {
|
||||
t.Fatalf("after boundary refusal row = %s/%s", state, owner)
|
||||
}
|
||||
t.Logf("boundary refusal: forwards=%d ledger=%s", wire.dispatch, authority.dispatchEvidence(t))
|
||||
ledger := outcome.Backup.WriteSet
|
||||
change := indexChangeOf(t, ledger, "chunk-target")
|
||||
requireIndexEffect(t, fx, ledger, change, "restore-claimed", false)
|
||||
@@ -223,6 +238,7 @@ func TestDS01PreparedEffectResumesToTerminalState(t *testing.T) {
|
||||
if wire.dispatch != 1 {
|
||||
t.Fatalf("marker create forwarded %d times, want exactly 1", wire.dispatch)
|
||||
}
|
||||
t.Logf("resume: forwards=%d ledger=%s", wire.dispatch, authority.dispatchEvidence(t))
|
||||
if state, _ := authority.dispatchRow(t); state != libraryrelease.RestoreDispatchMarkerConfirmed {
|
||||
t.Fatalf("terminal dispatch state = %s", state)
|
||||
}
|
||||
@@ -295,6 +311,7 @@ func TestDS01DispatchingMissingStaysHeldWithZeroWrites(t *testing.T) {
|
||||
if state, _ := authority.dispatchRow(t); state != libraryrelease.RestoreDispatchDispatching {
|
||||
t.Fatalf("state regressed to %s", state)
|
||||
}
|
||||
t.Logf("dispatching+missing: forwards=%d ledger=%s", wire.dispatch, authority.dispatchEvidence(t))
|
||||
}
|
||||
|
||||
// A11(单元级):收尾检查拒绝仍停在 dispatching 的 effect,即使内容看起来已恢复。
|
||||
|
||||
Reference in New Issue
Block a user