Example #1
0
        private void ConvertThroughProto(Identifier source)
        {
            Com.DigitalAsset.Ledger.Api.V1.Identifier protoValue = source.ToProto();
            var test = Identifier.FromProto(protoValue);

            Assert.IsTrue(source == test);
        }
Example #2
0
#pragma warning disable CS0612
        public static Identifier FromProto(Com.DigitalAsset.Ledger.Api.V1.Identifier identifier)
        {
            if (!string.IsNullOrEmpty(identifier.ModuleName) && !string.IsNullOrEmpty(identifier.EntityName))
            {
                return(new Identifier(identifier.PackageId, identifier.ModuleName, identifier.EntityName));
            }

            throw new ArgumentException($"Invalid identifier {identifier}: both module_name and entity_name must be set.");
        }