ED-190/deps: update dmt_client (#29)

* ED-190/deps: update dmt_client

* ED-190/fix: Update to shortcut methods
This commit is contained in:
Yaroslav Rogov 2021-07-28 11:01:25 +03:00 committed by GitHub
parent a6471d4074
commit f1bf192df6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -34,18 +34,14 @@ apply_domain_fixture() ->
-spec apply_domain_fixture([dmsl_domain_thrift:'DomainObject'()]) -> ok.
apply_domain_fixture(Fixture) ->
#'Snapshot'{version = Head} = dmt_client:checkout({head, #'Head'{}}),
Commit = #'Commit'{ops = [{insert, #'InsertOp'{object = F}} || F <- Fixture]},
%% logger:error("Fixture: ~p~nCommit: ~p", [Fixture, Commit]),
_NextRevision = dmt_client:commit(Head, Commit),
_NextRevision = dmt_client:insert(Fixture),
ok.
-spec cleanup() -> ok.
cleanup() ->
#'Snapshot'{domain = Domain, version = Head} = dmt_client:checkout({head, #'Head'{}}),
#'Snapshot'{domain = Domain, version = Head} = dmt_client:checkout(latest),
Objects = maps:values(Domain),
Commit = #'Commit'{ops = [{remove, #'RemoveOp'{object = O}} || O <- Objects]},
_NextRevision = dmt_client:commit(Head, Commit),
_NextRevision = dmt_client:remove(Head, Objects),
ok.
-spec construct_domain_fixture() -> [dmsl_domain_thrift:'DomainObject'()].