예제 #1
0
        public async virtual Task TestAddGetOwnedAttributeAsync()
        {
            byte[] key             = Byte32Encoder.Encode("key");
            string transactionHash = await ID.AddAttributeAsync(AddressFrom, key, OwnedAttribute.GetAddress(), new HexBigInteger(3905820));

            Assert.NotNull(transactionHash);
            string attributeAddress = await ID.GetAttributeAsyncCall(key);

            Assert.NotNull(attributeAddress);
            Assert.AreEqual(OwnedAttribute.GetAddress(), attributeAddress);
        }
예제 #2
0
        public async virtual Task TestAddNotOwnedAttributeAsync()
        {
            string transactionHash = null;

            try
            {
                byte[] key = Byte32Encoder.Encode("key");
                transactionHash = await ID.AddAttributeAsync(AddressFrom, key, NotOwnedAttribute.GetAddress(), new HexBigInteger(3905820));
            }
            catch (RpcResponseException e)
            {
            }

            Assert.Null(transactionHash);
        }
예제 #3
0
        private async Task DeployAttributeOwnedCertificateAsync(string location, string hash)
        {
            string owner           = AddressFrom;
            string transactionHash = await
                                     CertificateService.DeployContractAsync(
                Web3, AddressFrom, location, hash, _attribute.GetAddress(),
                new HexBigInteger(3905820));

            TransactionReceipt receipt = await
                                         Web3.Eth.Transactions.GetTransactionReceipt.
                                         SendRequestAsync(transactionHash);

            _attributeOwnedCertificate = new CertificateService(Web3, receipt.ContractAddress);
        }