Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
konstantinullrich committed Aug 26, 2024
1 parent 3563384 commit 3bdf1a0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 4 additions & 1 deletion impls/monero.dart/lib/src/ledger.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ void enableLedgerExchange(
final response = await exchange(ledger, device, ledgerRequest);

final Pointer<Uint8> result = malloc<Uint8>(response.length);
result.asTypedList(response.length).addAll(response);
for (var i = 0; i < response.length; i++) {
result.asTypedList(response.length)[i] = response[i];
}

monero.Wallet_setDeviceReceivedData(
ptr, result.cast<UnsignedChar>(), response.length);

Expand Down
5 changes: 3 additions & 2 deletions patches/monero/0015-add-dummy-device-for-ledger.patch
Original file line number Diff line number Diff line change
Expand Up @@ -427,10 +427,10 @@ index 8bdd75a5a..d8661b213 100644

using namespace std;
using namespace cryptonote;
@@ -3299,4 +3302,94 @@ uint64_t WalletImpl::getBytesSent()
@@ -3299,4 +3302,95 @@ uint64_t WalletImpl::getBytesSent()
return m_wallet->get_bytes_sent();
}

+
+// HIDAPI_DUMMY
+bool WalletImpl::getStateIsConnected() {
Expand Down Expand Up @@ -502,6 +502,7 @@ index 8bdd75a5a..d8661b213 100644
+ return;
+ #else
+ hw::io::device_io_dummy::receivedFromDevice = static_cast<unsigned char *>(malloc(len));
+ hw::io::device_io_dummy::receivedFromDeviceLength = len;
+ memset(hw::io::device_io_dummy::receivedFromDevice, 0, len);
+ memcpy(hw::io::device_io_dummy::receivedFromDevice, data, len);
+ hw::io::device_io_dummy::waitsForDeviceReceive = false;
Expand Down

0 comments on commit 3bdf1a0

Please sign in to comment.