public Task <string> GetCreatorQueryAsyncTest([PexAssumeUnderTest] GenericContractService target, BlockParameter blockParameter) { Task <string> result = target.GetCreatorQueryAsync(blockParameter); Assert.IsNotNull(result); return(result); }
public Task <string> DeclineRequestAsyncTest([PexAssumeUnderTest] GenericContractService target, DeclineFunction declineFunction) { Task <string> result = target.DeclineRequestAsync(declineFunction); Assert.IsNotNull(result); return(result); }
public GenericContractService ConstructorTest(global::Nethereum.Web3.Web3 web3, string contractAddress) { GenericContractService target = new GenericContractService(web3, contractAddress); Assert.IsNotNull(target); return(target); }
public Task <string> ApproveRequestAsyncTest([PexAssumeUnderTest] GenericContractService target, ApproveFunction approveFunction) { Task <string> result = target.ApproveRequestAsync(approveFunction); Assert.IsNotNull(result); return(result); }
public Task <BigInteger> GetStatusQueryAsyncTest([PexAssumeUnderTest] GenericContractService target, BlockParameter blockParameter) { Task <BigInteger> result = target.GetStatusQueryAsync(blockParameter); Assert.IsNotNull(result); return(result); }
public Task <string> AddAttachmentHashRequestAsyncTest([PexAssumeUnderTest] GenericContractService target, string hash) { Task <string> result = target.AddAttachmentHashRequestAsync(hash); Assert.IsNotNull(result); return(result); }
public Task <byte[]> GetTokenQueryAsyncTest( [PexAssumeUnderTest] GenericContractService target, GetTokenFunction getTokenFunction, BlockParameter blockParameter ) { Task <byte[]> result = target.GetTokenQueryAsync(getTokenFunction, blockParameter); Assert.IsNotNull(result); return(result); }
public Task <BigInteger> GetCreateDateQueryAsyncTest( [PexAssumeUnderTest] GenericContractService target, GetCreateDateFunction getCreateDateFunction, BlockParameter blockParameter ) { Task <BigInteger> result = target.GetCreateDateQueryAsync(getCreateDateFunction, blockParameter); Assert.IsNotNull(result); return(result); }
public Task <TransactionReceipt> DeployContractAndWaitForReceiptAsyncTest( global::Nethereum.Web3.Web3 web3, GenericContractDeployment genericContractDeployment, CancellationTokenSource cancellationTokenSource ) { Task <TransactionReceipt> result = GenericContractService.DeployContractAndWaitForReceiptAsync (web3, genericContractDeployment, cancellationTokenSource); return(result); }
public Task <GenericContractService> DeployContractAndGetServiceAsyncTest( global::Nethereum.Web3.Web3 web3, GenericContractDeployment genericContractDeployment, CancellationTokenSource cancellationTokenSource ) { Task <GenericContractService> result = GenericContractService.DeployContractAndGetServiceAsync (web3, genericContractDeployment, cancellationTokenSource); Assert.IsNotNull(result); return(result); }
public Task <TransactionReceipt> ApproveRequestAndWaitForReceiptAsyncTest( [PexAssumeUnderTest] GenericContractService target, ApproveFunction approveFunction, CancellationTokenSource cancellationToken ) { Task <TransactionReceipt> result = target.ApproveRequestAndWaitForReceiptAsync(approveFunction, cancellationToken); Assert.IsNotNull(result); return(result); }
public Task <TransactionReceipt> AddAttachmentHashRequestAndWaitForReceiptAsyncTest( [PexAssumeUnderTest] GenericContractService target, string hash, CancellationTokenSource cancellationToken ) { Task <TransactionReceipt> result = target.AddAttachmentHashRequestAndWaitForReceiptAsync(hash, cancellationToken); Assert.IsNotNull(result); return(result); }
public void ApproveContract(Guid contractId, string contractAddress) { var web3 = new Web3(_account, _blockChainUrl); var approve = new ApproveFunction() { FromAddress = _account.Address, Gas = DefaultGasAmount }; var service = new GenericContractService(web3, contractAddress); _ = service.ApproveRequestAsync(approve); }
/// <summary> /// /// </summary> /// <param name="contractBindingModel"></param> /// <returns></returns> public async Task <ResponseModel> AddContract(ContractBindingModel contractBindingModel) { var amountToSend = new HexBigInteger(1000000000000000000); string keccak = Multihash.Encode(contractBindingModel.Token1 + contractBindingModel.Token2, HashType.KECCAK_256); byte[] keccak2 = Multihash.Encode(contractBindingModel.Token1 + contractBindingModel.Token2, HashType.KECCAK_256); var web3 = new Web3(_account, _blockChainUrl); var deployment = CreateGenericContract(Guid.NewGuid(), contractBindingModel); deployment.Gas = DefaultGasAmount; var transactionHash = await GenericContractService.DeployContractAsync(web3, deployment); //var addAttachment = await service.AddAttachmentHashRequestAndWaitForReceiptAsync(new AddAttachmentHashFunction //{ // FromAddress = _account.Address, // Hash = contractBindingModel.FileChecksum, // Gas = DefaultGasAmount //}); var contractId = transactionHash; var abi = _contractRepository.GetAbi(); var bin = _contractRepository.GetBin(); var responseModel = new ResponseModel(contractBindingModel.ContextId, contractId, bin, abi); _ = BenChainClientApi.Client.Signator.BenChainUpdateWithHttpMessagesAsync(new SignatoryModel { BenChainABI = abi, BenChainBytescode = bin, BenChainContractId = contractId, ContextId = contractBindingModel.ContextId }); return(responseModel); }
public Task <string> DeployContractAsyncTest(global::Nethereum.Web3.Web3 web3, GenericContractDeployment genericContractDeployment) { Task <string> result = GenericContractService.DeployContractAsync(web3, genericContractDeployment); return(result); }