示例#1
0
        public Models.ContractTransaction CreateProfile(Models.Profile profile)
        {
            var _profile       = ModelProfileToServceProfile(profile);
            var result         = client.createProfile(_profile);
            var citizenProfile = ServiceProfileToModelProfile(_profile);

            Models.ContractTransaction transaction = prepareDeployObject(citizenProfile);
            return(transaction);
        }
示例#2
0
        private Models.ContractTransaction prepareTxObject(string bindingid, BC.Offchain.Repository.Models.Profile CitizenProfile)
        {
            var _dto = CitizenProfile;

            _dto.TransactedTime = DateTime.Now;
            _dto.TransactionID  = Guid.NewGuid().ToString();

            Models.TransactionConfirmation _transactionConfirmation = new Models.TransactionConfirmation()
            {
                BlockHash        = "0xfa4e2a31506c1f930efc7701ff6ddc1451d08a38a7a9267fe263766b4c7ea2d0",
                BlockNumber      = "1",
                TransactionHash  = "",
                Name             = "Fake Contract",
                ProxyId          = "Fake Contract_Proxy ID",
                TransactionIndex = "1"
            };
            Models.ContractTransaction _txInformation = new Models.ContractTransaction(bindingid, " Enterprise Smart Contract transacted.....", _dto, _transactionConfirmation);
            return(_txInformation);
        }
示例#3
0
 private Models.ContractTransaction prepareDeployObject(Models.Profile citizenProfile)
 {
     Models.ConstructorConfirmation _deployConfirmation = new Models.ConstructorConfirmation()
     {
         NewContractOrTokenId = Guid.NewGuid().ToString(),
         Name = "Smart Contract instance by ESC Template",
         TransactionConfirmation = new Models.TransactionConfirmation()
         {
             BlockHash        = "0xfa4e2a31506c1f930efc7701ff6ddc1451d08a38a7a9267fe263766b4c7ea2d0",
             BlockNumber      = "1",
             LedgerAddress    = "",
             TransactionHash  = "",
             Name             = "Fake Contract",
             ProxyId          = "Fake Contract_Proxy ID",
             TransactionIndex = "1"
         }
     };
     Models.ContractTransaction _txInformation = new Models.ContractTransaction(citizenProfile, _deployConfirmation);
     return(_txInformation);
 }