public async Task InsertCredentials( Address administrator, VASPId vaspId, string credentials) { var contract = Web3.Eth.GetContract(ABI, RealAddress); var function = contract.GetFunction("insertCredentials"); var functionInput = new object[] { (byte[])vaspId, credentials }; var gas = await function.EstimateGasAsync ( from : administrator, gas : new HexBigInteger(1000000), value : new HexBigInteger(0), functionInput ); await function.SendTransactionAndWaitForReceiptAsync ( from : administrator, gas : gas, value : new HexBigInteger(0), receiptRequestCancellationToken : null, functionInput : functionInput ); }
public async Task DirectoryAdministratorAddedVASPCredentials( string credentialsExamplePath, string vaspId) { var vaspDirectory = _scenarioContext.GetContractByType <VASPDirectory>(); await vaspDirectory.InsertCredentialsAsync ( administrator : await _accounts.GetAdministratorAsync(), vaspId : VASPId.Parse(vaspId), credentials : await File.ReadAllTextAsync(credentialsExamplePath) ); }
// ReSharper disable once InconsistentNaming public async Task ICallTryGetCredentialsRefAndHashAsyncMethodOfVASPDirectoryClient( string vaspId, int minimalConfirmationLevel) { var vaspDirectory = _scenarioContext.GetContractByType <VASPDirectory>(); var vaspDirectoryClient = new EtherGate.VASPDirectoryClient(vaspDirectory.RealAddress, _web3); var callResult = await vaspDirectoryClient.TryGetCredentialsRefAndHashAsync ( vaspId : VASPId.Parse(vaspId), minimalConfirmationLevel : new ConfirmationLevel(minimalConfirmationLevel) ); _scenarioContext.SetCallResult(callResult); }
// ReSharper disable once InconsistentNaming public async Task ICallVASPIsRegisteredAsyncMethodOfVASPRegistryClient( string vaspId, int minimalConfirmationLevel) { var vaspDirectory = _scenarioContext.GetContractByType <VASPDirectory>(); var vaspDirectoryClient = new VASPDirectoryClient ( vaspDirectory.RealAddress, _estimateGasPriceStrategy, _web3 ); var callResult = await vaspDirectoryClient.VASPIsRegisteredAsync ( vaspId : VASPId.Parse(vaspId), minimalConfirmationLevel : new ConfirmationLevel(minimalConfirmationLevel) ); _scenarioContext.SetCallResult(callResult); }