def commit(self): for t in ACCOUNT_TYPE.values(): self.adjust_account(t) self.restore_accounts()
def commit_adjustment(self, adjustment): assert self.is_adjusting() for account_type in ACCOUNT_TYPE.values(): self.adjust_account(account_type, adjustment) self.end_shadow_accounts()
def setup_accounts(self): self.accounts = {} for account_type in ACCOUNT_TYPE.values(): self.accounts[account_type] = Account(Currency('USD'), account_type)