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 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/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] 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,