# Example pre_posting_code that restricts non-GBP transactions, invoked by Vault # whenever we receive a new posting instruction towards a given account def pre_posting_code(postings, effective_date): if any(posting.denomination != 'GBP' for posting in postings): # here we do not instruct any hook directives, instead we raise an exception # to block the posting raise Rejected('Non-GBP transactions are not allowed', reason_code=RejectedReason.WRONG_DENOMINATION)