Skip to content

Commit

Permalink
1.11.3-GroupRedeemCollateralReturn-hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
jaensen committed Dec 13, 2024
1 parent 19ebe9d commit c164fc2
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 40 deletions.
77 changes: 39 additions & 38 deletions Circles.Index.CirclesV2.StandardTreasury/LogParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -174,44 +174,45 @@ private GroupRedeem GroupRedeem(Block block, TxReceipt receipt, LogEntry log, in
private IEnumerable<GroupRedeemCollateralReturn> GroupRedeemCollateralReturn(Block block, TxReceipt receipt,
LogEntry log, int logIndex)
{
string groupAddress = "0x" + log.Topics[1].ToString().Substring(Consts.AddressEmptyBytesPrefixLength);
string toAddress = "0x" + log.Topics[2].ToString().Substring(Consts.AddressEmptyBytesPrefixLength);

int offset = 0;
int idsLength = (int)new BigInteger(log.Data.Slice(offset, 32).ToArray());
offset += 32;

List<UInt256> ids = new List<UInt256>();
for (int i = 0; i < idsLength; i++)
{
ids.Add(new UInt256(log.Data.Slice(offset, 32), true));
offset += 32;
}

int valuesLength = (int)new BigInteger(log.Data.Slice(offset, 32).ToArray());
offset += 32;

List<UInt256> values = new List<UInt256>();
for (int i = 0; i < valuesLength; i++)
{
values.Add(new UInt256(log.Data.Slice(offset, 32), true));
offset += 32;
}

for (int i = 0; i < idsLength; i++)
{
yield return new GroupRedeemCollateralReturn(
block.Number,
(long)block.Timestamp,
receipt.Index,
logIndex,
receipt.TxHash!.ToString(),
i,
groupAddress,
toAddress,
ids[i],
values[i]);
}
// string groupAddress = "0x" + log.Topics[1].ToString().Substring(Consts.AddressEmptyBytesPrefixLength);
// string toAddress = "0x" + log.Topics[2].ToString().Substring(Consts.AddressEmptyBytesPrefixLength);
//
// int offset = 0;
// int idsLength = (int)new BigInteger(log.Data.Slice(offset, 32).ToArray());
// offset += 32;
//
// List<UInt256> ids = new List<UInt256>();
// for (int i = 0; i < idsLength; i++)
// {
// ids.Add(new UInt256(log.Data.Slice(offset, 32), true));
// offset += 32;
// }
//
// int valuesLength = (int)new BigInteger(log.Data.Slice(offset, 32).ToArray());
// offset += 32;
//
// List<UInt256> values = new List<UInt256>();
// for (int i = 0; i < valuesLength; i++)
// {
// values.Add(new UInt256(log.Data.Slice(offset, 32), true));
// offset += 32;
// }
//
// for (int i = 0; i < idsLength; i++)
// {
// yield return new GroupRedeemCollateralReturn(
// block.Number,
// (long)block.Timestamp,
// receipt.Index,
// logIndex,
// receipt.TxHash!.ToString(),
// i,
// groupAddress,
// toAddress,
// ids[i],
// values[i]);
// }
yield break; // Don't index right now.
}

private IEnumerable<GroupRedeemCollateralBurn> GroupRedeemCollateralBurn(Block block, TxReceipt receipt,
Expand Down
4 changes: 2 additions & 2 deletions Circles.Index/Circles.Index.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<Authors>Daniel Janz (Gnosis Service GmbH)</Authors>
<Copyright>Gnosis Service GmbH</Copyright>
<Product>Circles</Product>
<AssemblyVersion>1.11.3</AssemblyVersion>
<FileVersion>1.11.3</FileVersion>
<AssemblyVersion>1.11.3-GroupRedeemCollateralReturn-hotfix</AssemblyVersion>
<FileVersion>1.11.3-GroupRedeemCollateralReturn-hotfix</FileVersion>
</PropertyGroup>


Expand Down

0 comments on commit c164fc2

Please sign in to comment.