@@ -121,38 +121,38 @@ const (
121121 nodeInsert = "INSERT INTO nodes (genesis_block, network_id, node_id, client_name, chain_id) VALUES " +
122122 "('%s', '%s', '%s', '%s', %d);\n "
123123
124- ipldInsert = "INSERT INTO public.blocks (key, data) VALUES ('%s', '%x');\n "
124+ ipldInsert = "INSERT INTO public.blocks (key, data) VALUES ('%s', '\\ x %x');\n "
125125
126126 headerInsert = "INSERT INTO eth.header_cids (block_number, block_hash, parent_hash, cid, td, node_id, reward, " +
127127 "state_root, tx_root, receipt_root, uncle_root, bloom, timestamp, mh_key, times_validated, base_fee) VALUES " +
128- "('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%x', %d, '%s', %d, %d );\n "
128+ "('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '\\ x %x', %d, '%s', %d, %s );\n "
129129
130130 headerInsertWithoutBaseFee = "INSERT INTO eth.header_cids (block_number, block_hash, parent_hash, cid, td, node_id, " +
131131 "reward, state_root, tx_root, receipt_root, uncle_root, bloom, timestamp, mh_key, times_validated, base_fee) VALUES " +
132- "('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%x', %d, '%s', %d, NULL);\n "
132+ "('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '\\ x %x', %d, '%s', %d, NULL);\n "
133133
134134 uncleInsert = "INSERT INTO eth.uncle_cids (block_hash, header_id, parent_hash, cid, reward, mh_key) VALUES " +
135135 "('%s', '%s', '%s', '%s', '%s', '%s');\n "
136136
137137 txInsert = "INSERT INTO eth.transaction_cids (header_id, tx_hash, cid, dst, src, index, mh_key, tx_data, tx_type) " +
138- "VALUES ('%s', '%s', '%s', '%s', '%s', %d, '%s', '%x', %d);\n "
138+ "VALUES ('%s', '%s', '%s', '%s', '%s', %d, '%s', '\\ x %x', %d);\n "
139139
140140 alInsert = "INSERT INTO eth.access_list_elements (tx_id, index, address, storage_keys) VALUES ('%s', %d, '%s', '%s');\n "
141141
142142 rctInsert = "INSERT INTO eth.receipt_cids (tx_id, leaf_cid, contract, contract_hash, leaf_mh_key, post_state, " +
143143 "post_status, log_root) VALUES ('%s', '%s', '%s', '%s', '%s', '%s', %d, '%s');\n "
144144
145145 logInsert = "INSERT INTO eth.log_cids (leaf_cid, leaf_mh_key, rct_id, address, index, topic0, topic1, topic2, " +
146- "topic3, log_data) VALUES ('%s', '%s', '%s', '%s', %d, '%s', '%s', '%s', '%s', '%x');\n "
146+ "topic3, log_data) VALUES ('%s', '%s', '%s', '%s', %d, '%s', '%s', '%s', '%s', '\\ x %x');\n "
147147
148148 stateInsert = "INSERT INTO eth.state_cids (header_id, state_leaf_key, cid, state_path, node_type, diff, mh_key) " +
149- "VALUES ('%s', '%s', '%s', '%x', %d, %t, '%s');\n "
149+ "VALUES ('%s', '%s', '%s', '\\ x %x', %d, %t, '%s');\n "
150150
151151 accountInsert = "INSERT INTO eth.state_accounts (header_id, state_path, balance, nonce, code_hash, storage_root) " +
152- "VALUES ('%s', '%x', '%s', %d, '%x', '%s');\n "
152+ "VALUES ('%s', '\\ x %x', '%s', %d, '\\ x %x', '%s');\n "
153153
154154 storageInsert = "INSERT INTO eth.storage_cids (header_id, state_path, storage_leaf_key, cid, storage_path, " +
155- "node_type, diff, mh_key) VALUES ('%s', '%x', '%s', '%s', '%x', %d, %t, '%s');\n "
155+ "node_type, diff, mh_key) VALUES ('%s', '\\ x %x', '%s', '%s', '\\ x %x', %d, %t, '%s');\n "
156156)
157157
158158func (sqw * SQLWriter ) upsertNode (node nodeinfo.Info ) {
@@ -199,7 +199,7 @@ func (sqw *SQLWriter) upsertHeaderCID(header models.HeaderModel) {
199199 } else {
200200 stmt = fmt .Sprintf (headerInsert , header .BlockNumber , header .BlockHash , header .ParentHash , header .CID ,
201201 header .TotalDifficulty , header .NodeID , header .Reward , header .StateRoot , header .TxRoot ,
202- header .RctRoot , header .UncleRoot , header .Bloom , header .Timestamp , header .MhKey , 1 , header .BaseFee )
202+ header .RctRoot , header .UncleRoot , header .Bloom , header .Timestamp , header .MhKey , 1 , * header .BaseFee )
203203 }
204204 sqw .stmts <- []byte (stmt )
205205 indexerMetrics .blocks .Inc (1 )
0 commit comments