Skip to content

Commit

Permalink
remove logs
Browse files Browse the repository at this point in the history
  • Loading branch information
karlprieb committed Oct 6, 2023
1 parent cb9fe81 commit 4aa4377
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 10 deletions.
9 changes: 0 additions & 9 deletions lib/src/streams/transaction_uploader.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,16 @@ TaskEither<StreamTransactionError, Stream<(int, int)>> uploadTransaction(
final txHeaders = transaction.toJson();

return _postTransactionHeaderTaskEither(arweave, txHeaders).flatMap((_) {
print('call post chunks');
return TaskEither.of(_postChunks(arweave, transaction));
});
}

TaskEither<StreamTransactionError, Response> _postTransactionHeaderTaskEither(
ArweaveApi arweave, Map<String, dynamic> headers) {
return TaskEither.tryCatch(() async {
print('Uploading transaction headers...');

final res = await arweave.post('tx', body: json.encode(headers));

if (!(res.statusCode >= 200 && res.statusCode < 300)) {
print('Unable to upload transaction: ${res.statusCode}');
throw Exception('Unable to upload transaction: ${res.statusCode}');
}

Expand All @@ -56,7 +52,6 @@ Stream<(int, int)> _postChunks(
ArweaveApi arweave,
TransactionResult transaction,
) async* {
print('Uploading chunks...');
final chunkUploadCompletionStreamController = StreamController<int>();
final chunkStream = transaction.chunkStreamGenerator();
final chunkQueue = StreamQueue(chunkStream);
Expand Down Expand Up @@ -84,11 +79,8 @@ Stream<(int, int)> _postChunks(
},
);

print('chunk uploaded');

chunkUploadCompletionStreamController.add(chunkIndex);
} catch (err) {
print('Chunk upload failed at $chunkIndex');
chunkUploadCompletionStreamController.addError(err);
}
}
Expand Down Expand Up @@ -148,7 +140,6 @@ Future<void> _uploadChunk(ArweaveApi arweave, int chunkIndex,
}

final res = await arweave.post('chunk', body: json.encode(chunk));
print('Uploaded chunk $chunkIndex: ${res.statusCode}');

if (res.statusCode != 200) {
final responseError = getResponseError(res);
Expand Down
1 change: 0 additions & 1 deletion lib/src/streams/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ TaskEither<StreamTransactionError, Uint8List> deepHashTaskEither(
return TaskEither.tryCatch(() async {
return await deepHash(inputs);
}, (error, _) {
print(error);
return DeepHashError();
});
}
Expand Down

0 comments on commit 4aa4377

Please sign in to comment.