Ejemplo n.º 1
0
        public static TreeEvent FromProtoTreeEvent(Com.Daml.Ledger.Api.V1.TreeEvent treeEvent)
        {
            if (treeEvent.KindCase == Com.Daml.Ledger.Api.V1.TreeEvent.KindOneofCase.Created)
            {
                return(CreatedEvent.FromProto(treeEvent.Created));
            }

            if (treeEvent.KindCase == Com.Daml.Ledger.Api.V1.TreeEvent.KindOneofCase.Exercised)
            {
                return(ExercisedEvent.FromProto(treeEvent.Exercised));
            }

            throw new UnsupportedEventTypeException($"Event is neither created not exercised: {treeEvent}");
        }
Ejemplo n.º 2
0
        public static IEvent FromProtoEvent(Com.DigitalAsset.Ledger.Api.V1.Event ledgerEvent)
        {
            if (ledgerEvent.EventCase == Com.DigitalAsset.Ledger.Api.V1.Event.EventOneofCase.Created)
            {
                return(CreatedEvent.FromProto(ledgerEvent.Created));
            }

            if (ledgerEvent.EventCase == Com.DigitalAsset.Ledger.Api.V1.Event.EventOneofCase.Archived)
            {
                return(ArchivedEvent.FromProto(ledgerEvent.Archived));
            }

            throw new UnsupportedEventTypeException(ledgerEvent.ToString());
        }
Ejemplo n.º 3
0
 public static GetActiveContractsResponse FromProto(Com.DigitalAsset.Ledger.Api.V1.GetActiveContractsResponse response)
 {
     return(new GetActiveContractsResponse(response.Offset, (from c in response.ActiveContracts select CreatedEvent.FromProto(c)).ToList(), response.WorkflowId));
 }