-
-
Notifications
You must be signed in to change notification settings - Fork 54
Conversation
index.js
Outdated
@@ -30,6 +52,16 @@ class TrezorKeyring extends EventEmitter { | |||
this.paths = {}; | |||
this.deserialize(opts); | |||
TrezorConnect.manifest(TREZOR_CONNECT_MANIFEST); | |||
TrezorConnect.getFeatures().then((features) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think having this call right here is going to be problematic. I'm seeing the Trezor connection window pop up way too frequently and when performing actions that don't relate to Trezor. I'll need to research the best place to put this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This adds support for EIP-1559 for the Trezor T, once we get all this library to work with it as well. We use version "8.2.1-extended" exactly, as we need non-browser support for local tests.
Although 3.3.0 is out, I've selected ^3.2.1 just to match the current version of MetaMask's package.json file. Version 3.2.0 adds support for EIP-1559 transactions.
Test case copied over from MetaMask/eth-ledger-bridge-keyring#99
This adds support for object-rest-spread (e.g. {...x, ...y}), without using the babel parser, which we use in tests. This is different from what the Metamask extension has, which is 2017, but they're using the babel parser.
Creating an unfrozen transaction (added in #88) seems to be a change that was only required in eth-ledger-keyring, not in Trezor, and is fixed by @ethereumjs/tx: v3.1.4 anyway. I've removed this part, since it was causing issues with EIP-1559 transactions, and does not seem necessary for non-EIP-1559 transactions either.
Co-authored-by: Alois Klink <[email protected]>
07479ab
to
8ad61f4
Compare
index.js
Outdated
this.model = event.payload.features.model; | ||
} | ||
}); | ||
TrezorConnect.init({ manifest: TREZOR_CONNECT_MANIFEST }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@danjm Brilliant move with DEVICE_EVENT
event listening! Unfortunately the event was never firing for me. What does work, however, is this change I've made, which puts the event listener first and then triggers the event via init
.
Builds on the work by @aloisklink in #97
This expands on that PR by adding a method for determining the model of the device, allowing us to detect whether the current model supports EIP-1559