Skip to content

Commit

Permalink
BlockchainProcessing adding 1559 fields to views, mapping and changin…
Browse files Browse the repository at this point in the history
…g dbSchema to support custom string names, together with goerli, sepolia
  • Loading branch information
juanfranblanco committed Oct 14, 2022
1 parent 3ecb1f5 commit e4dcf8e
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,14 @@ namespace Nethereum.BlockchainProcessing.BlockStorage.Entities
{
public class DbSchemaAttribute: Attribute
{
public DbSchemaNames DbSchemaName { get; }
public string DbSchemaName { get; }

public DbSchemaAttribute(DbSchemaNames dbSchemaName)
{
DbSchemaName = dbSchemaName.ToString();
}

public DbSchemaAttribute(string dbSchemaName)
{
DbSchemaName = dbSchemaName;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
{
public enum DbSchemaNames
{
dbo, localhost, ropsten, rinkeby, kovan, main
dbo, localhost, ropsten, rinkeby, kovan, main, goerli, sepolia
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ public interface IBlockView
string TotalDifficulty { get; }
long TransactionCount { get; }
string TimeStamp { get; }
string BaseFeePerGas { get;}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,8 @@ public interface ITransactionView
string TimeStamp { get; }
string TransactionIndex { get; }
string Value { get; }
string MaxFeePerGas { get; }
string MaxPriorityFeePerGas { get; }

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ public static void Map(this Block block, Nethereum.RPC.Eth.DTOs.Block source)
block.Nonce = source.Nonce;
block.BaseFeePerGas = source.BaseFeePerGas?.Value.ToString();
block.TransactionCount = TransactionCount(source);
}

}

private static int TransactionCount(Nethereum.RPC.Eth.DTOs.Block block)
{
Expand Down

0 comments on commit e4dcf8e

Please sign in to comment.