Client/Mockup: mockup context migration command
Context
Testing migration is hard. If only we could easily diff the context before and after the migration.
-> With this MR, you can (using the persistent mockup mode)
This MR introduces a new migrate mockup command that does just this: migrate a given context to another protocol, according to the migration specified in init_storage.ml.
Manually testing the MR
This MR sits on top of master but it was tested on proto-proposal (so with a non-trivial migration). Demo script:
> mkdir /tmp/mockup
> ./tezos-client --base-dir /tmp/mockup --protocol PsDELPH1 create mockup
> cp -r /tmp/mockup /tmp/save
> ./tezos-client -M mockup --base-dir /tmp/mockup migrate mockup to ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK
> diff /tmp/mockup/mockup/context.json /tmp/save/mockup/context.json
Result:
1c1
< { "protocol_hash": "ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK",
---
> { "protocol_hash": "PsDELPH1Kxsxt8f9eWbxQeRxkjfbxoqM52jvs5Y5fBxWWh4ifpo",
43287d43286
< [ "sapling", [ [ "next", "00" ] ] ],
43290c43289
< "02000000080000000400000004000050000000001000000000000000010000000000000000002080fa7e80c4f509ffffffffffffffff80a0d9e61d03e8c8d00700000101808092f40180a0c21e00000006d0a54cecb80b00000006d0a54cb5ee32fa01a0a907000000000012c000000007d000001b58000001f400010000000000000001" ],
---
> "02000000080000000400000004000000400000001000000000000000010000000000000000002080fa7e80c4f509ffffffffffffffff80a0d9e61d03e8c8d00700000101808092f40180a0c21e00000006d0a54cecb80b00000006d0a54cb5ee32fa01a0a90700000000001e0000000007d000001b58000001f400010000000000000001" ],
43292c43291
< [ "version", "616c7068615f63757272656e74" ],
---
> [ "version", "64656c7068695f303037" ],
43294c43293
< [ [ "current_period", "000000000000000000" ],
---
> [ [ "current_period_kind", "00" ],
43333,43334c43332
< [ "participation_ema", "00001b58" ],
< [ "pred_period_kind", "03" ] ] ] ] } }
\ Pas de fin de ligne à la fin du fichier
---
> [ "participation_ema", "00001b58" ] ] ] ] } }
Checklist
-
Document the interface of any function added or modified (see the coding guidelines) -
Provide automatic testing (see the testing guide). -
Add item in the Development Versionsection ofCHANGES.md(only for new features and bug fixes).
Reviewers
Edited by Ilias Garnier