Skip to content

Commit

Permalink
Merge pull request #13 from IliyanIlievPH/12
Browse files Browse the repository at this point in the history
Closes #12
  • Loading branch information
PaterSantyago committed Jul 21, 2020
2 parents c1c6337 + cf253d5 commit b2b8df9
Show file tree
Hide file tree
Showing 52 changed files with 452 additions and 3,004 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 2.2.207
dotnet-version: 3.1.302
- name: Install dependencies
run: dotnet restore
- name: Build solution
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 2.2.207
dotnet-version: 3.1.302
- name: Install dependencies
run: dotnet restore
- name: Build
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
<None Remove="MAVN.Service.PrivateBlockchainFacade.Client.xml" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Lykke.HttpClientGenerator" Version="2.5.0" />
<PackageReference Include="Lykke.SettingsReader" Version="5.2.0" />
<PackageReference Include="Lykke.HttpClientGenerator" Version="3.1.0" />
<PackageReference Include="Lykke.SettingsReader" Version="5.3.0" />
<PackageReference Include="MAVN.Numerics" Version="1.0.0" />
<PackageReference Include="Refit" Version="4.6.107" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="JetBrains.Annotations" Version="2019.1.1" />
<PackageReference Include="JetBrains.Annotations" Version="2020.1.0" />
<PackageReference Include="MAVN.Numerics" Version="1.0.0" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
<Version>1.0.0</Version>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Lykke.Common" Version="7.5.0" />
<PackageReference Include="MAVN.Job.QuorumTransactionWatcher.Contract" Version="1.1.0" />
<PackageReference Include="MAVN.Numerics" Version="1.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.2.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.1.5" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\contract\MAVN.Service.PrivateBlockchainFacade.Contract\MAVN.Service.PrivateBlockchainFacade.Contract.csproj" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
<Version>1.0.0</Version>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Lykke.RabbitMqBroker" Version="7.13.1" />
<PackageReference Include="Lykke.RabbitMqBroker" Version="7.13.3" />
<PackageReference Include="MAVN.Job.EthereumBridge.Contract" Version="1.1.0" />
<PackageReference Include="MAVN.Service.CrossChainTransfers.Contract" Version="1.1.0" />
<PackageReference Include="MAVN.Service.CrossChainWalletLinker.Contract" Version="1.1.0" />
<PackageReference Include="MAVN.Service.CustomerProfile.Contract" Version="1.3.0" />
<PackageReference Include="MAVN.Service.CustomerProfile.Contract" Version="2.2.0" />
<PackageReference Include="MAVN.Service.QuorumOperationExecutor.Client" Version="1.1.0" />
<PackageReference Include="MAVN.Service.QuorumTransactionSigner.Client" Version="1.0.1" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
using System;
using System.Data.SqlClient;
using System;
using System.Threading.Tasks;
using MAVN.Common.MsSql;
using MAVN.Persistence.PostgreSQL.Legacy;
using MAVN.Service.PrivateBlockchainFacade.Domain.Deduplication;
using MAVN.Service.PrivateBlockchainFacade.MsSqlRepositories.Contexts;
using MAVN.Service.PrivateBlockchainFacade.MsSqlRepositories.Entities;
using MAVN.Service.PrivateBlockchainFacade.MsSqlRepositories.Entities.Deduplication;
using Microsoft.EntityFrameworkCore;
using Npgsql;

namespace MAVN.Service.PrivateBlockchainFacade.MsSqlRepositories
{
public class BonusRewardDeduplicationLogRepository : IDeduplicationLogRepository<BonusRewardDeduplicationLogEntity>
{
private readonly MsSqlContextFactory<PbfContext> _contextFactory;
private readonly PostgreSQLContextFactory<PbfContext> _contextFactory;

public BonusRewardDeduplicationLogRepository(MsSqlContextFactory<PbfContext> contextFactory)
public BonusRewardDeduplicationLogRepository(PostgreSQLContextFactory<PbfContext> contextFactory)
{
_contextFactory = contextFactory;
}
Expand All @@ -33,8 +32,8 @@ public async Task<bool> IsDuplicateAsync(string key)
}
catch (DbUpdateException e)
{
if (e.InnerException is SqlException sqlException &&
sqlException.Number == MsSqlErrorCodes.PrimaryKeyConstraintViolation)
if (e.InnerException is PostgresException sqlException &&
sqlException.SqlState == PostgresErrorCodes.UniqueViolation)
{
return true;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
using System.Data.Common;
using System.Data.Common;
using MAVN.Service.PrivateBlockchainFacade.MsSqlRepositories.Entities;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using MAVN.Common.MsSql;
using MAVN.Persistence.PostgreSQL.Legacy;
using MAVN.Service.PrivateBlockchainFacade.Domain.Features.Operations;
using MAVN.Service.PrivateBlockchainFacade.MsSqlRepositories.Entities.Deduplication;

namespace MAVN.Service.PrivateBlockchainFacade.MsSqlRepositories.Contexts
{
public class PbfContext : MsSqlContext
public class PbfContext : PostgreSQLContext
{
private const string Schema = "private_blockchain_facade";

Expand Down Expand Up @@ -48,7 +48,7 @@ public PbfContext(DbConnection dbConnection)
{
}

protected override void OnLykkeModelCreating(ModelBuilder modelBuilder)
protected override void OnMAVNModelCreating(ModelBuilder modelBuilder)
{
var operationEntityBuilder = modelBuilder.Entity<OperationEntity>();
operationEntityBuilder.Property(c => c.Type).HasConversion(new EnumToStringConverter<OperationType>());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
<Version>1.0.0</Version>
<RootNamespace>MAVN.Service.PrivateBlockchainFacade.MsSqlRepositories</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="MAVN.Common.MsSql" Version="3.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.2.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="2.2.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.2.4" />
<PackageReference Include="MAVN.Persistence.PostgreSQL.Legacy" Version="1.1.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.1.5" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="3.1.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\MAVN.Service.PrivateBlockchainFacade.Domain\MAVN.Service.PrivateBlockchainFacade.Domain.csproj" />
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit b2b8df9

Please sign in to comment.