public static async Task <ApiResponse> SubmitBlock(string blockData) { ApiResponse response = new ApiResponse(); try { BlockChainEngine engine = new BlockChainEngine(); await engine.SubmitBlock(blockData); } catch (ApiCustomException ex) { Logger.Singleton.Error(ex.Message); Logger.Singleton.Error("Api error code is:" + ex.ErrorCode.ToString()); Logger.Singleton.Error("Api error reason is:" + ex.InnerException.ToString()); response.Error = new ApiError(ex.ErrorCode, ex.Message); } catch (Exception ex) { Logger.Singleton.Error(ex.Message); Logger.Singleton.Error("Custom error code is:" + ex.HResult); Logger.Singleton.Error("Custom error reason is:" + ex.InnerException); response.Error = new ApiError(ex.HResult, ex.Message); } return(response); }
public async Task SubmitBlock() { BlockChainEngine engine = new BlockChainEngine(); await engine.SubmitBlock("1234567890ABCDEF"); }