lib/etht/bigquery.rb in etht-0.1.7 vs lib/etht/bigquery.rb in etht-0.1.8

- old
+ new

@@ -54,23 +54,23 @@ # @return [String] comando insert SQL formatado etht (trx normais) def etht_ins "insert #{BD}.etht(blocknumber,timestamp,txhash,nonce,blockhash,transactionindex,axfrom,axto,value,gas," \ 'gasprice,iserror,txreceipt_status,input,contractaddress,cumulativegasused,gasused,confirmations,dias' \ - ") VALUES(#{transacoes.norml.map { |e| etht_val1(e) }.join(',')})" + ") VALUES#{transacoes.norml.map { |e| etht_val1(e) }.join(',')}" end # @return [String] comando insert SQL formatado ethk (trx token) def ethk_ins "insert #{BD}.ethk(blocknumber,timestamp,txhash,nonce,blockhash,axfrom,contractaddress,axto,value,tokenname," \ 'tokensymbol,tokendecimal,transactionindex,gas,gasprice,gasused,cumulativegasused,input,confirmations,dias' \ - ") VALUES(#{transacoes.token.map { |e| ethk_val1(e) }.join(',')})" + ") VALUES#{transacoes.token.map { |e| ethk_val1(e) }.join(',')}" end # @return [String] valores formatados etht (trx normais parte1) def etht_val1(hes) - "#{Integer(hes['blockNumber'])}," \ + "(#{Integer(hes['blockNumber'])}," \ "#{Integer(hes['timeStamp'])}," \ "'#{hes['hash']}'," \ "#{Integer(hes['nonce'])}," \ "'#{hes['blockHash']}'," \ "#{Integer(hes['transactionIndex'])}," \ @@ -92,16 +92,16 @@ # @return [String] valores formatados etht (trx normais parte3) def etht_val3(hes) "#{hes['contractAddress'].length.zero? ? 'null' : "'#{hes['contractAddress']}'"}," \ "0,cast('#{hes['gasUsed']}' as numeric),0," \ - "#{Integer(ops[:h][hes['blockNumber']] || 0)}" + "#{Integer(ops[:h][hes['blockNumber']] || 0)})" end # @return [String] valores formatados ethk (trx token parte1) def ethk_val1(hes) - "#{Integer(hes['blockNumber'])}," \ + "(#{Integer(hes['blockNumber'])}," \ "#{Integer(hes['timeStamp'])}," \ "'#{hes['hash']}'," \ "#{Integer(hes['nonce'])}," \ "'#{hes['blockHash']}'," \ "'#{hes['from']}'," \ @@ -124,10 +124,10 @@ def ethk_val3(hes) "cast('#{hes['gas']}' as numeric)," \ "cast('#{hes['gasPrice']}' as numeric)," \ "cast('#{hes['gasUsed']}' as numeric),0," \ "#{hes['input'].length.zero? ? 'null' : "'#{hes['input']}'"},0," \ - "#{Integer(ops[:h][hes['blockNumber']] || 0)}" + "#{Integer(ops[:h][hes['blockNumber']] || 0)})" end # cria job bigquery & verifica execucao # # @param [String] sql a executar