Skip to content

Commit

Permalink
Merge pull request theQRL#506 from jplomas/ledger-fix
Browse files Browse the repository at this point in the history
Ledger fix
  • Loading branch information
jplomas authored Nov 10, 2021
2 parents a148302 + f68f9d9 commit 9ba3734
Show file tree
Hide file tree
Showing 9 changed files with 217 additions and 9,404 deletions.
93 changes: 7 additions & 86 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,104 +1,25 @@
version: 2.1
orbs:
node: circleci/node@1.1
node: circleci/node@4.7.0
jobs:
build:
executor:
name: node/default
tag: '12.14'
steps:
- checkout
- restore_cache:
key: build-temp-{{ checksum ".meteor/release" }}-{{ checksum ".circleci/config.yml" }}
- restore_cache:
key: meteor-release-{{ checksum ".meteor/release" }}-{{ checksum ".meteor/versions" }}-{{ checksum ".circleci/config.yml" }}
- restore_cache:
key: meteor-packages
- restore_cache:
key: npm-packages-{{ checksum "package.json" }}-{{ checksum "package-lock.json" }}-{{ checksum ".circleci/config.yml" }}
- run:
name: restore cached meteor binary
name: update certificates
command: |
if [ -e ~/build-temp/meteor-bin ]
then
echo "Cached Meteor bin found, restoring it."
sudo cp ~/build-temp/meteor-bin /usr/local/bin/meteor
else
echo "No cached Meteor bin found."
fi
sudo apt-get update && sudo apt-get upgrade -y
- run:
name: install meteor
command: |
# only install meteor if bin isn't found
command -v meteor >/dev/null 2>&1 || curl https://install.meteor.com | /bin/sh
- run:
name: check versions
name: install dependencies
command: |
echo "Meteor version:"
# this forces Meteor to download whatever release your project is using
meteor --version
which meteor
echo "Meteor node version:"
meteor node -v
echo "Meteor npm version:"
meteor npm -v
sudo apt-get install -y libusb-dev libudev-dev
- run:
name: copy meteor bin to build cache
name: install meteor
command: |
mkdir -p ~/build-temp
cp /usr/local/bin/meteor ~/build-temp/meteor-bin
- save_cache:
key: build-temp-{{ checksum ".meteor/release" }}-{{ checksum ".circleci/config.yml" }}
paths:
- ~/build-temp
curl https://install.meteor.com/ | sh
- run:
name: install npm packages
command: meteor npm i
- save_cache:
key: npm-packages-{{ checksum "package.json" }}-{{ checksum "package-lock.json" }}-{{ checksum ".circleci/config.yml" }}
paths:
- ./node_modules/
- ~/.npm/
# - run:
# name: run tests
# command: meteor test --driver-package meteortesting:mocha
- save_cache:
key: meteor-release-{{ checksum ".meteor/release" }}-{{ checksum ".meteor/versions" }}-{{ checksum ".circleci/config.yml" }}
paths:
- ~/.meteor
- save_cache:
key: meteor-packages-{{ epoch }}
paths:
- .meteor/local


# version: 2
# machine:
# node:
# version: 0.10.43
# dependencies:
# override:
# - curl https://install.meteor.com | /bin/sh
# - npm install
# checkout:
# post:
# - git submodule update --init
# # Start meteor in background
# - run:
# name: Start Meteor
# command: |
# meteor npm install --unsafe-perm
# npm run dev
# background: true

# # Test run
# - run:
# name: Ensure runs
# command: |
# until curl --max-time 300 http://localhost:3000/; do sleep 1; done

# workflows:
# version: 2
# build_all:
# jobs:
# - build
2 changes: 1 addition & 1 deletion .electrify/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ app.on('ready', function() {
if (process.platform === 'darwin') {
app.setAboutPanelOptions({
applicationName: "QRL Wallet",
applicationVersion: "1.7.2",
applicationVersion: "1.7.3",
version: "Electron 10.1.7",
copyright: "Die QRL Stiftung, Zug Switzerland",
credits: "The QRL Developers"
Expand Down
2 changes: 1 addition & 1 deletion .electrify/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .electrify/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "QRLWallet",
"productName": "QRLWallet",
"projectName": "qrl-wallet",
"version": "1.7.2",
"version": "1.7.3",
"main": "index.js",
"dependencies": {
"@theqrl/electrify-qrl": "^1.0.0",
Expand Down
2 changes: 1 addition & 1 deletion imports/startup/both/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import './nodes.js'
SHOR_PER_QUANTA = 1000000000

// qrl-wallet Version
WALLET_VERSION = '1.7.2'
WALLET_VERSION = '1.7.3'

// qrl.proto sha256 sum for each release of QRL Node
QRLPROTO_SHA256 = [
Expand Down
44 changes: 19 additions & 25 deletions imports/ui/pages/tools/message/messageConfirm.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,19 @@ import './messageConfirm.html'
async function getLedgerCreateMessageTx(sourceAddr, fee, message, callback) {
console.log('-- Getting QRL Ledger Nano App createMessageTx --')
if (isElectrified()) {
const retry = Meteor.setInterval(() => {
Meteor.call(
'ledgerCreateMessageTx',
sourceAddr,
fee,
message,
(err, data) => {
if (data.error_message !== 'Timeout') {
console.log('> Got Ledger Nano createMessageTx from USB')
console.log(data)
Meteor.clearInterval(retry)
callback(null, data)
}
Meteor.call(
'ledgerCreateMessageTx',
sourceAddr,
fee,
message,
(err, data) => {
if (data.error_message !== 'Timeout') {
console.log('> Got Ledger Nano createMessageTx from USB')
console.log(data)
callback(null, data)
}
)
}, 2000)
}
)
} else {
const QrlLedger = await createTransport()
QrlLedger.createMessageTx(sourceAddr, fee, message).then(data => {
Expand All @@ -39,16 +36,13 @@ async function getLedgerCreateMessageTx(sourceAddr, fee, message, callback) {
async function getLedgerRetrieveSignature(request, callback) {
console.log('-- Getting QRL Ledger Nano App Signature --')
if (isElectrified()) {
const retry = Meteor.setInterval(() => {
Meteor.call('ledgerRetrieveSignature', request, (err, data) => {
if (data.error_message !== 'Timeout') {
console.log('> Got Ledger Nano retrieveSignature from USB')
console.log(data)
Meteor.clearInterval(retry)
callback(null, data)
}
})
}, 2000)
Meteor.call('ledgerRetrieveSignature', request, (err, data) => {
if (data.error_message !== 'Timeout') {
console.log('> Got Ledger Nano retrieveSignature from USB')
console.log(data)
callback(null, data)
}
})
} else {
const QrlLedger = await createTransport()
QrlLedger.retrieveSignature(request).then(data => {
Expand Down
2 changes: 1 addition & 1 deletion imports/ui/pages/tools/message/messageResult.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ <h4 class="ui horizontal divider header">
{{> QRCode text=transactionHash size="128px"}}
</div>
<div class="content">
<a class="header">{{messageDetails.message}}</a>
<a class="header" style="word-break: break-all;">{{messageDetails.message}}</a>
<div class="meta">
<span>Transaction Hash <a id="confirmedMessageHash" class="ui purple label" target="_blank" href="{{nodeExplorerUrl}}/tx/{{transactionHash}}">{{transactionHash}}</a></span>
</div>
Expand Down
Loading

0 comments on commit 9ba3734

Please sign in to comment.