@@ -977,7 +977,7 @@ private void PersistEventsOnApplicationExecuted(object sender, ApplicationExecut
977977 var transactionHash = e . Transaction . Hash . ToString ( ) . Substring ( 2 ) ;
978978 var blockHeight = ( ( LevelDBBlockchain ) sender ) . Height ;
979979 var blockTime = Blockchain . Default . GetBlock ( blockHeight ) . Timestamp ;
980- Console . WriteLine ( "Executed txn: $ {0}, block height: $ {1}" , transactionHash , blockHeight ) ;
980+ Console . WriteLine ( "Executed txn: {0}, block height: {1}" , transactionHash , blockHeight ) ;
981981
982982 if ( e . VMState . HasFlag ( VMState . FAULT ) )
983983 {
@@ -1077,8 +1077,6 @@ private void PersistEventsOnApplicationExecuted(object sender, ApplicationExecut
10771077
10781078 private static void WriteToPsql ( SmartContractEvent contractEvent )
10791079 {
1080- Console . WriteLine ( String . Format ( "Blockheight={0}" , contractEvent . blockNumber ) ) ;
1081-
10821080 string connString = Environment . GetEnvironmentVariable ( "DB_CONNECTION_STRING" ) ;
10831081
10841082 using ( var conn = new NpgsqlConnection ( connString ) )
@@ -1087,30 +1085,23 @@ private static void WriteToPsql(SmartContractEvent contractEvent)
10871085 try
10881086 {
10891087 conn . Open ( ) ;
1090- Console . WriteLine ( String . Format ( "Connection {0}" , conn . State ) ) ;
10911088
10921089 WriteToEventTable ( contractEvent , conn ) ;
10931090
10941091 if ( contractEvent . eventType == "created" )
10951092 {
10961093 WriteToOfferTable ( contractEvent , conn ) ;
10971094 }
1098-
1099- if ( contractEvent . eventType == "filled" )
1095+ else if ( contractEvent . eventType == "filled" )
11001096 {
11011097 WriteToTradeTable ( contractEvent , conn ) ;
11021098 }
11031099 }
1104- catch ( Exception ex )
1105- {
1106- throw ex ;
1107- }
11081100 finally
11091101 {
11101102 if ( conn != null && conn . State == System . Data . ConnectionState . Open )
11111103 {
11121104 conn . Close ( ) ;
1113- Console . WriteLine ( String . Format ( "Connection {0}" , conn . State ) ) ;
11141105 }
11151106 }
11161107 }
@@ -1119,7 +1110,7 @@ private static void WriteToPsql(SmartContractEvent contractEvent)
11191110
11201111 private static void WriteToEventTable ( SmartContractEvent contractEvent , NpgsqlConnection conn )
11211112 {
1122- Console . WriteLine ( String . Format ( "Event {0} {1}" , contractEvent . eventType , contractEvent . eventPayload ) ) ;
1113+ Console . WriteLine ( String . Format ( "Inserting {0} event {1}, block height: {2} " , contractEvent . eventType , contractEvent . eventPayload , contractEvent . blockNumber ) ) ;
11231114 try
11241115 {
11251116 using ( var cmd = new NpgsqlCommand (
@@ -1158,7 +1149,7 @@ private static void WriteToEventTable(SmartContractEvent contractEvent, NpgsqlCo
11581149
11591150 private static void WriteToOfferTable ( SmartContractEvent contractEvent , NpgsqlConnection conn )
11601151 {
1161- Console . WriteLine ( String . Format ( "Offer {0}" , contractEvent . eventPayload ) ) ;
1152+ Console . WriteLine ( String . Format ( "Inserting Offer {0}, block height: {1} " , contractEvent . eventPayload , contractEvent . blockNumber ) ) ;
11621153
11631154 try
11641155 {
@@ -1212,7 +1203,7 @@ private static void WriteToOfferTable(SmartContractEvent contractEvent, NpgsqlCo
12121203
12131204 private static void WriteToTradeTable ( SmartContractEvent contractEvent , NpgsqlConnection conn )
12141205 {
1215- Console . WriteLine ( String . Format ( "Trade {0}" , contractEvent . eventPayload ) ) ;
1206+ Console . WriteLine ( String . Format ( "Inserting {0}, block height: {1} " , contractEvent . eventPayload , contractEvent . blockNumber ) ) ;
12161207
12171208 string connString = Environment . GetEnvironmentVariable ( "DB_CONNECTION_STRING" ) ;
12181209 try
0 commit comments