                                 done (true, rid)
                             }
         }
-
-//        queue.async {
-//            if Bool.random() { // sometimes return no transaction -> done
-//                each ((foo: 0, rid: rid))
-//                each ((foo: 1, rid: rid))
-//            }
-//            done (true, rid)
-//        }
     }
 
     /// ETH

        request.addValue ("application/json", forHTTPHeaderField: "Content-Type")
        request.httpMethod = "POST"

        do { request.httpBody = try JSONSerialization.data(withJSONObject: data, options: []) }
        catch let jsonError as NSError {
            completion (Result.failure (QueryError.jsonParse(jsonError)))
        }

                                        transaction: String,
                                        rid: Int32,
                                        completion: @escaping (ETH.Submit) -> Void) {
        let json: JSON.Dict = [
            "jsonrpc" : "2.0",
            "method"  : "eth_sendRawTransaction",
            "params"  : [transaction],
            "id"      : rid
        ]

        ethMakeRequest(ewm: ewm, data: json) { (res: Result<BlockChainDB.JSON, BlockChainDB.QueryError>) in
            let hash = try! res
                .map { $0.asString (name: "result")! }
                .recover { (ignore) in "0x123abc456def" }
                .get()

            completion ((wid: wid, tid: tid, hash: hash, errorCode: Int32(-1), errorMessage: nil, rid: rid))
        }
    }

