cosmos-sdk/x/ibc/applications/transfer/keeper/relay_model/account.tla

37 lines
959 B
Plaintext
Raw Normal View History

Model-based tests for relay functions of ICS-20 token transfer (#8145) * start on MBT for ICS20: setting and checking bank balances * add bank struct for subtracting banks * reconstruct ibc denominations in the bank * add some static tests with bank changes tracking * small fixes * better error handling * add Jsonatr transform from Apalache conterexample into OnRecvPacket test * add example Apalache CE and transformed test * changed apalache-to-recv-test.json to output arrays instead of records * add datastructures for parsing TLA+ tests * remove accidentally committed code * add conversion from TLA+ structs to Go structs * encode abstract ids into addresses via hashes * first run of auto-generated MBT tests * first run of auto-generated MBT tests: fix ports and channels * fix small inconsistencies * fix mbt_relay_test by not setting the bank balances in every iteration * add test for onTimeoutPacket * add handling of OnRecvAcknowledgement to mbt relay test * add handling of SendTransfer * add relay-test.json * revert manual changes in relay-test.json * fix handling of denominations for SendTransfer * setup two test channels A-B, B-C; fix escrow address encoding * a test for all handlers passing * generalize denom handling to arbitrary length + failing denom test * rename test function * MBT test for unsecrow tokens * add model-based generated tests * add model-based tests (prev commit: addded model) * transformed json tests with jsonatr * modify mbt_relay_test.go to execute all MBT tests * cleanup * move jsonatr transforms into another dir * add MBT_README.md Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
2020-12-11 09:35:44 -08:00
-------------------------- MODULE account ----------------------------
(**
The accounts interface; please ignore the definition bodies.
*)
EXTENDS identifiers
CONSTANT
AccountIds
\* a non-account
NullAccount == "NullAccount"
\* All accounts
Accounts == { NullAccount }
\* Make an escrow account for the given port and channel
MakeEscrowAccount(port, channel) == NullAccount
\* Make an account from the accound id
MakeAccount(accountId) == NullAccount
\* Type constraints for accounts
AccountTypeOK ==
/\ NullAccount \in Accounts
/\ \A p \in Identifiers, c \in Identifiers:
MakeEscrowAccount(p, c) \in Accounts
/\ \A a \in Identifiers:
MakeAccount(a) \in Accounts
=============================================================================
\* Modification History
\* Last modified Thu Nov 19 18:21:10 CET 2020 by c
\* Last modified Thu Nov 05 14:44:18 CET 2020 by andrey
\* Created Thu Nov 05 13:22:40 CET 2020 by andrey