From b1493ae54100f2f1eb120c3de93035e0a988c41a Mon Sep 17 00:00:00 2001 From: schwartz-concordium <132270889+schwartz-concordium@users.noreply.github.com> Date: Wed, 20 Sep 2023 13:36:21 +0200 Subject: [PATCH 1/3] Moved contract call before update event --- .../Aggregates/Contract/ContractAggregate.cs | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/backend/Application/Aggregates/Contract/ContractAggregate.cs b/backend/Application/Aggregates/Contract/ContractAggregate.cs index 24c01b3ba..0bb901cbb 100644 --- a/backend/Application/Aggregates/Contract/ContractAggregate.cs +++ b/backend/Application/Aggregates/Contract/ContractAggregate.cs @@ -278,22 +278,8 @@ await repository )); break; case ContractUpdated contractUpdated: - await repository - .AddAsync(new ContractEvent( - blockHeight, - transactionHash, - transactionIndex, - eventIndex, - contractUpdated.ContractAddress, - sender, - contractUpdated, - source, - blockSlotTime - )); if (contractUpdated.Instigator is ContractAddress contractInstigator) { - // Possible a contract has called itself. - eventIndex += 1; await repository .AddAsync(new ContractEvent( blockHeight, @@ -308,7 +294,21 @@ await repository source, blockSlotTime )); + // Possible a contract has called itself. + eventIndex += 1; } + await repository + .AddAsync(new ContractEvent( + blockHeight, + transactionHash, + transactionIndex, + eventIndex, + contractUpdated.ContractAddress, + sender, + contractUpdated, + source, + blockSlotTime + )); break; case ContractUpgraded contractUpgraded: await repository From 3b7da3271c0aff38ba6e613b96680f3143bbdff3 Mon Sep 17 00:00:00 2001 From: schwartz-concordium <132270889+schwartz-concordium@users.noreply.github.com> Date: Wed, 20 Sep 2023 13:58:14 +0200 Subject: [PATCH 2/3] Fix test --- .../Tests/Aggregates/Contract/ContractAggregateTests.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/backend/Tests/Aggregates/Contract/ContractAggregateTests.cs b/backend/Tests/Aggregates/Contract/ContractAggregateTests.cs index 2114aeb5a..f3bdeb83c 100644 --- a/backend/Tests/Aggregates/Contract/ContractAggregateTests.cs +++ b/backend/Tests/Aggregates/Contract/ContractAggregateTests.cs @@ -129,13 +129,12 @@ await ContractAggregate.StoreEvent( // Assert contractEvents.Count.Should().Be(2); - var updateEvent = contractEvents[0]; - updateEvent.Event.Should().BeOfType(); - updateEvent.ContractAddressIndex.Should().Be(from); - - var transferEvent = contractEvents[1]; + var transferEvent = contractEvents[0]; transferEvent.Event.Should().BeOfType(); transferEvent.ContractAddressIndex.Should().Be(to); + var updateEvent = contractEvents[1]; + updateEvent.Event.Should().BeOfType(); + updateEvent.ContractAddressIndex.Should().Be(from); } [Fact] From 9fa1dc49b522e547b14b980f6ddcc71b7593b7f6 Mon Sep 17 00:00:00 2001 From: schwartz-concordium <132270889+schwartz-concordium@users.noreply.github.com> Date: Wed, 20 Sep 2023 14:20:04 +0200 Subject: [PATCH 3/3] Updated versions --- backend/Application/Application.csproj | 3 +-- frontend/package.json | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/backend/Application/Application.csproj b/backend/Application/Application.csproj index 8aeffd220..3e1b185bd 100644 --- a/backend/Application/Application.csproj +++ b/backend/Application/Application.csproj @@ -4,9 +4,8 @@ net6.0 enable disable - 1.7.0 + 1.7.1 - diff --git a/frontend/package.json b/frontend/package.json index ed6058d6a..97c001b51 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,7 +1,7 @@ { "name": "ccscan-frontend", "description": "CCDScan frontend", - "version": "1.5.0", + "version": "1.5.1", "engine": "16", "type": "module", "private": true,