Commit be0beb4f authored by Jeremy Bokobza's avatar Jeremy Bokobza Committed by GitHub

Merge pull request #93 from dangershony/stratis-testnet

Remove the api version 
parents 6f2a97b7 76204b9f
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
<select name="network" formControlName="selectNetwork"> <select name="network" formControlName="selectNetwork">
<!--<option value="main">Main</option>--> <!--<option value="main">Main</option>-->
<option value="test">Testnet</option> <option value="test">Testnet</option>
<option value="stratistest">StratisTest</option>
</select> </select>
</div> </div>
<div class="form-group"> <div class="form-group">
......
...@@ -20,8 +20,8 @@ import { TransactionSending } from '../classes/transaction-sending'; ...@@ -20,8 +20,8 @@ import { TransactionSending } from '../classes/transaction-sending';
export class ApiService { export class ApiService {
constructor(private http: Http) {}; constructor(private http: Http) {};
private mockApiUrl = 'http://localhost:3000/api/v1'; private mockApiUrl = 'http://localhost:3000/api';
private webApiUrl = 'http://localhost:5000/api/v1'; private webApiUrl = 'http://localhost:5000/api';
private headers = new Headers({'Content-Type': 'application/json'}); private headers = new Headers({'Content-Type': 'application/json'});
/** /**
......
...@@ -5,7 +5,7 @@ using Stratis.Bitcoin.Notifications; ...@@ -5,7 +5,7 @@ using Stratis.Bitcoin.Notifications;
namespace Breeze.Api.Controllers namespace Breeze.Api.Controllers
{ {
[Route("api/v{version:apiVersion}/[controller]")] [Route("api/[controller]")]
public class NodeController : Controller public class NodeController : Controller
{ {
private readonly BlockNotification blockNotification; private readonly BlockNotification blockNotification;
......
...@@ -56,30 +56,11 @@ namespace Breeze.Api ...@@ -56,30 +56,11 @@ namespace Breeze.Api
.AddJsonOptions(options => NBitcoin.JsonConverters.Serializer.RegisterFrontConverters(options.SerializerSettings)) .AddJsonOptions(options => NBitcoin.JsonConverters.Serializer.RegisterFrontConverters(options.SerializerSettings))
.AddControllers(services); .AddControllers(services);
services.AddApiVersioning(options =>
{
options.DefaultApiVersion = new ApiVersion(1, 0);
});
// Register the Swagger generator, defining one or more Swagger documents // Register the Swagger generator, defining one or more Swagger documents
services.AddSwaggerGen(setup => services.AddSwaggerGen(setup =>
{ {
setup.SwaggerDoc("v1", new Info { Title = "Breeze.Api", Version = "v1" }); setup.SwaggerDoc("v1", new Info { Title = "Breeze.Api", Version = "v1" });
// FIXME: prepopulates the version in the URL of the Swagger UI found at http://localhost:5000/swagger
// temporary needed until Swashbuckle supports it out-of-the-box
setup.DocInclusionPredicate((version, apiDescription) =>
{
apiDescription.RelativePath = apiDescription.RelativePath.Replace("v{version}", version);
var versionParameter = apiDescription.ParameterDescriptions.SingleOrDefault(p => p.Name == "version");
if (versionParameter != null)
{
apiDescription.ParameterDescriptions.Remove(versionParameter);
}
return true;
});
//Set the comments path for the swagger json and ui. //Set the comments path for the swagger json and ui.
var basePath = PlatformServices.Default.Application.ApplicationBasePath; var basePath = PlatformServices.Default.Application.ApplicationBasePath;
var apiXmlPath = Path.Combine(basePath, "Breeze.Api.xml"); var apiXmlPath = Path.Combine(basePath, "Breeze.Api.xml");
......
...@@ -105,10 +105,7 @@ namespace Breeze.Wallet ...@@ -105,10 +105,7 @@ namespace Breeze.Wallet
public void ProcessBlock(Block block) public void ProcessBlock(Block block)
{ {
var hash = block.Header.GetHash(); this.walletManager.ProcessBlock(block);
var height = this.chain.GetBlock(hash).Height;
this.walletManager.ProcessBlock(height, block);
} }
public void ProcessTransaction(Transaction transaction) public void ProcessTransaction(Transaction transaction)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment