-
Notifications
You must be signed in to change notification settings - Fork 40
Rewrite post$ to take a password and not use signer #93
Conversation
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.
Could you also bump all @parity/*
packages and deps to ^4.0.0?
observer.next({ confirmed: receipt }); | ||
} | ||
const signedTransaction = await api.personal.signTransaction(tx, passphrase); | ||
postRaw$(signedTransaction.raw).subscribe(observer); |
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.
Since this is a breaking change, what do you think of putting observer.next({ signed: ... })
here
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.
sounds good!
const { provider } = options; | ||
const api = provider ? createApiFromProvider(provider) : getApi(); | ||
|
||
const source$ = Observable.create(async (observer: Observer<TxStatus>) => { | ||
try { | ||
const transactionHash = await api.eth.sendRawTransaction(tx); | ||
const transactionHash = await api.eth.sendRawTransaction(rawTx); | ||
observer.next({ signed: transactionHash }); |
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.
... and changing here to observer.next({ sent: ... })
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.
Conflicts need to be solved. Can you also bump inside lerna.json?
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.
lgtm!
Breaking change to the post$ API (before:
tx, options
; now:tx, passphrase, options
). Should bump version consequently.post$ now doesn't require any subsequent action from the caller (no more signer_ rpcs). post$ uses
personal_signTransaction
with the tx and passphrase to get the signed tx, and callspostRaw$
with it.Con: AFAIK the
personal
api needs to be activated in Parity's launch flag--ws-apis
(unless the secure token covers this; haven't checked).