Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Groxan committed May 31, 2024
1 parent f03b15f commit bf2078b
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 22 deletions.
8 changes: 4 additions & 4 deletions Tzkt.Api.Tests/Tzkt.Api.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.2" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="xunit" Version="2.8.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.0">
<PackageReference Include="coverlet.collector" Version="6.0.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
2 changes: 1 addition & 1 deletion Tzkt.Api/Models/Accounts/Base/Account.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public abstract class Account
public abstract string Address { get; set; }
}

public class AccountJsonInheritanceConverter : JsonInheritanceConverter
public class AccountJsonInheritanceConverter : JsonInheritanceConverter<Account>
{
public AccountJsonInheritanceConverter(string name) : base(name) { }

Expand Down
2 changes: 1 addition & 1 deletion Tzkt.Api/Models/Operations/Base/Operation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public abstract class Operation
public abstract long Id { get; set; }
}

public class OperationJsonInheritanceConverter : JsonInheritanceConverter
public class OperationJsonInheritanceConverter : JsonInheritanceConverter<Operation>
{
public OperationJsonInheritanceConverter(string name) : base(name) { }

Expand Down
2 changes: 1 addition & 1 deletion Tzkt.Api/Models/Operations/Base/OperationError.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public abstract class OperationError
public abstract string Type { get; set; }
}

public class OperationErrorJsonInheritanceConverter : JsonInheritanceConverter
public class OperationErrorJsonInheritanceConverter : JsonInheritanceConverter<OperationError>
{
public OperationErrorJsonInheritanceConverter(string name) : base(name) { }

Expand Down
4 changes: 2 additions & 2 deletions Tzkt.Api/Services/Cache/Accounts/AccountsCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public AccountsCache(NpgsqlDataSource dataSource, StateCache state, IConfigurati
: (int)(limit * 1.1);

using var db = DataSource.OpenConnection();
using var reader = db.ExecuteReader($@"{SelectQuery} ORDER BY ""LastLevel"" DESC LIMIT @limit", new { limit });
using IDataReader reader = db.ExecuteReader($@"{SelectQuery} ORDER BY ""LastLevel"" DESC LIMIT @limit", new { limit });

AccountsById = new Dictionary<int, RawAccount>(capacity);
AccountsByAddress = new Dictionary<string, RawAccount>(capacity);
Expand Down Expand Up @@ -98,7 +98,7 @@ public async Task UpdateAsync()
#endregion

await using var db = await DataSource.OpenConnectionAsync();
using var reader = await db.ExecuteReaderAsync($@"{SelectQuery} WHERE ""LastLevel"" > @from", new { from });
using IDataReader reader = await db.ExecuteReaderAsync($@"{SelectQuery} WHERE ""LastLevel"" > @from", new { from });

var parsers = new Func<IDataReader, RawAccount>[6]
{
Expand Down
6 changes: 3 additions & 3 deletions Tzkt.Api/Tzkt.Api.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@
<PackageReference Include="App.Metrics.AspNetCore.Mvc" Version="4.3.0" />
<PackageReference Include="App.Metrics.AspNetCore.Tracking" Version="4.3.0" />
<PackageReference Include="App.Metrics.Formatters.Prometheus" Version="4.3.0" />
<PackageReference Include="Dapper" Version="2.0.123" />
<PackageReference Include="Npgsql" Version="7.0.4" />
<PackageReference Include="NSwag.AspNetCore" Version="13.19.0" />
<PackageReference Include="Dapper" Version="2.1.35" />
<PackageReference Include="Npgsql" Version="7.0.7" />
<PackageReference Include="NSwag.AspNetCore" Version="14.0.7" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions Tzkt.Data/Tzkt.Data.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Netezos" Version="2.9.0" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="7.0.4" />
<PackageReference Include="Netezos" Version="2.10.1" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="7.0.18" />
</ItemGroup>

</Project>
9 changes: 9 additions & 0 deletions Tzkt.Sync/Extensions/JsonElementExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,15 @@ public static BigInteger RequiredBigInteger(this JsonElement el, string name)
: throw new SerializationException($"Missed required BigInteger {name}");
}

public static BigInteger? OptionalBigInteger(this JsonElement el, string name)
{
if (!el.TryGetProperty(name, out var prop))
return null;

return BigInteger.TryParse(prop.GetString(), out var res) ? res
: throw new SerializationException($"Invalid BigInteger {name}");
}

public static bool TryGetBigInteger(this JsonElement el, string name, out BigInteger res)
{
res = BigInteger.Zero;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,18 +83,19 @@ public void Revert(DoubleEndorsingOperation operation)
{
var branch = op.RequiredString("branch");
var content = op.Required("operations");
var endorsement = new EndorsementContent
var attestation = new AttestationContent
{
Level = content.RequiredInt32("level"),
Round = content.RequiredInt32("round"),
Slot = content.RequiredInt32("slot"),
PayloadHash = content.RequiredString("block_payload_hash")
PayloadHash = content.RequiredString("block_payload_hash"),
DalAttestation = content.OptionalBigInteger("dal_attestation")
};
var signature = Base58.Parse(op.RequiredString("signature"), 3);

var bytes = new byte[1] { 19 }
.Concat(Base58.Parse(chainId, 3))
.Concat(await new LocalForge().ForgeOperationAsync(branch, endorsement))
.Concat(await new LocalForge().ForgeOperationAsync(branch, attestation))
.ToArray();

foreach (var baker in Cache.Accounts.GetDelegates().OrderByDescending(x => x.LastLevel))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public void Revert(DoublePreendorsingOperation operation)
{
var branch = op.RequiredString("branch");
var content = op.Required("operations");
var preendorsement = new PreendorsementContent
var preattestation = new PreattestationContent
{
Level = content.RequiredInt32("level"),
Round = content.RequiredInt32("round"),
Expand All @@ -94,7 +94,7 @@ public void Revert(DoublePreendorsingOperation operation)

var bytes = new byte[1] { 18 }
.Concat(Base58.Parse(chainId, 3))
.Concat(await new LocalForge().ForgeOperationAsync(branch, preendorsement))
.Concat(await new LocalForge().ForgeOperationAsync(branch, preattestation))
.ToArray();

foreach (var baker in Cache.Accounts.GetDelegates().OrderByDescending(x => x.LastLevel))
Expand Down
6 changes: 3 additions & 3 deletions Tzkt.Sync/Tzkt.Sync.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
<PackageReference Include="App.Metrics.AspNetCore.Endpoints" Version="4.3.0" />
<PackageReference Include="App.Metrics.AspNetCore.Hosting" Version="4.3.0" />
<PackageReference Include="App.Metrics.Formatters.Prometheus" Version="4.3.0" />
<PackageReference Include="Dapper" Version="2.0.123" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.5">
<PackageReference Include="Dapper" Version="2.1.35" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.18">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Netezos" Version="2.9.0" />
<PackageReference Include="Netezos" Version="2.10.1" />
<PackageReference Include="Newtonsoft.Json.Bson" Version="1.0.2" />
<PackageReference Include="SauceControl.Blake2Fast" Version="2.0.0" />
</ItemGroup>
Expand Down

0 comments on commit bf2078b

Please sign in to comment.