P04-01: 同時発生の更新規約
This commit is contained in:
@@ -985,8 +985,8 @@ def verify_shift_completion(base):
|
||||
native_file(base, row['copy'], row)
|
||||
require(native_applicability(base) == TESTED_PRODUCT, 'shift tested revision')
|
||||
pids = native_ownership(base)
|
||||
require([pids['actual-native/' + phase] for phase in NATIVE_RUNS['actual-native']]
|
||||
== [77462, 77504, 77536], 'shift ended PID identity')
|
||||
shift_pids = [pids['actual-native/' + phase] for phase in NATIVE_RUNS['actual-native']]
|
||||
require(len(shift_pids) == len(set(shift_pids)) == 3, 'shift ended PID identity')
|
||||
inputs = load(safe(base, 'actual-native/runner-input.json'))
|
||||
expected = product_manifest(tree_entries(TESTED_PRODUCT))
|
||||
require(len(inputs['source_before']) == 1338 and
|
||||
@@ -1002,6 +1002,7 @@ def verify_shift_completion(base):
|
||||
paid_rows = None
|
||||
original_service = None
|
||||
completed_service = None
|
||||
transaction_id = None
|
||||
for i, label in enumerate(labels):
|
||||
rows = [r for r in observations['observations'] if r['label'] == label]
|
||||
require(len(rows) == 1, 'shift phase membership')
|
||||
@@ -1055,13 +1056,15 @@ def verify_shift_completion(base):
|
||||
require(service['state'] == 'COMPLETED' and service['completed_at'] == 1080 and len(sale) == 1,
|
||||
'shift single completion')
|
||||
transaction = sale[0]
|
||||
require(transaction['transaction_id'] == 'ledger_00000006' and transaction['amount'] == 25 and
|
||||
if transaction_id is None:
|
||||
transaction_id = transaction['transaction_id']
|
||||
require(transaction['transaction_id'] == transaction_id and transaction['amount'] == service['price_snapshot'] and
|
||||
transaction['absolute_minute'] == 1080 and transaction['source_entity_id'] == service['facility_id']
|
||||
and transaction['credit_account'] == 'GUEST_WALLET:' + service['guest_ids'][0], 'shift sale identity')
|
||||
receipts = receipt_rows(observation['receipts'])
|
||||
require(receipts == [r for r in ledger if r['transaction_id'] == 'ledger_00000006'], 'shift receipt raw join')
|
||||
require(receipts == [r for r in ledger if r['transaction_id'] == transaction_id], 'shift receipt raw join')
|
||||
require([r for r in state['economy']['idempotency'] if r['key'] == 'service.payment.' + service_id]
|
||||
== [{'key': 'service.payment.' + service_id, 'transaction_id': 'ledger_00000006'}],
|
||||
== [{'key': 'service.payment.' + service_id, 'transaction_id': transaction_id}],
|
||||
'shift idempotency join')
|
||||
if i == 2:
|
||||
completed_service = service
|
||||
@@ -1073,7 +1076,7 @@ def verify_shift_completion(base):
|
||||
observation['receipts'] == paid_rows, 'shift extra charge/completion')
|
||||
previous_ledger = ledger
|
||||
points.append(label)
|
||||
return {'verified_conditions': ['shift_completion'], 'phases': points, 'transaction_id': 'ledger_00000006'}
|
||||
return {'verified_conditions': ['shift_completion'], 'phases': points, 'transaction_id': transaction_id}
|
||||
|
||||
|
||||
def combine_native_series(directory, native):
|
||||
@@ -1089,7 +1092,7 @@ def combine_native_series(directory, native):
|
||||
module_spec.loader.exec_module(series)
|
||||
c_base = directory / 'audit-support/native-first-current'
|
||||
require(native == verify_native(c_base), 'C result must be recomputed from raw')
|
||||
base = directory / 'audit-support/p04-raw-collect-r20'
|
||||
base = directory / 'audit-support/p04-raw-collect-r22'
|
||||
manifest_path = safe(base, 'MANIFEST.json')
|
||||
manifest = load(manifest_path)
|
||||
require(manifest['protocol'] == 'p04-native-series-collection-v1' and
|
||||
|
||||
Reference in New Issue
Block a user