Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tx: fill out the rawTx before sending the rawTx #495

Merged
merged 2 commits into from
Jul 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/components/NetworkingKeys.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,14 @@ export default function NetworkingKeys({ point }) {
details.chain(chainKeyProp('encryptionKey'))
)}
<Grid.Item full as={Flex} row justify="between" className="mt3">
{renderDetail('Revision', details.map(d => d.keyRevisionNumber))}
{renderDetail('Continuity Era', details.map(d => d.continuityNumber))}
{renderDetail(
'Revision',
details.map(d => d.keyRevisionNumber)
)}
{renderDetail(
'Continuity Era',
details.map(d => d.continuityNumber)
)}
{renderDetail(
'Crypto Suite Ver.',
details.map(d => d.cryptoSuiteVersion)
Expand Down
5 changes: 4 additions & 1 deletion src/indigo-react/components/SelectInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ export default function SelectInput({
const ref = useRef();

// close select on outside clicks
useOnClickOutside(ref, useCallback(() => setIsOpen(false), [setIsOpen]));
useOnClickOutside(
ref,
useCallback(() => setIsOpen(false), [setIsOpen])
);

const toggleOpen = useCallback(() => {
input.onFocus();
Expand Down
5 changes: 4 additions & 1 deletion src/lib/lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ const safeToWei = (num, source) => {
};

const compose = (...fs) =>
fs.reduceRight((pF, nF) => (...args) => nF(pF(...args)), v => v);
fs.reduceRight(
(pF, nF) => (...args) => nF(pF(...args)),
v => v
);

const allFalse = (...args) => args.every(a => a === false);

Expand Down
6 changes: 5 additions & 1 deletion src/lib/reticket.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,11 @@ export async function reticketPointBetweenWallets({

progress(TRANSACTION_PROGRESS.TRANSFERRING);

await sendAndAwaitAllSerial(web3, txPairs.map(p => p.signed), usedTank);
await sendAndAwaitAllSerial(
web3,
txPairs.map(p => p.signed),
usedTank
);

//
// move leftover eth
Expand Down
1 change: 0 additions & 1 deletion src/lib/routeNames.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ export const ROUTE_NAMES = {
ACTIVATE: Symbol('ACTIVATE'),
INVITE_TRANSACTIONS: Symbol('INVITE_TRANSACTIONS'),
INVITES_MANAGE: Symbol('INVITES_MANAGE'),
SENATE: Symbol('SENATE'),
//
LOGIN: Symbol('LOGIN'),
LOGIN_OTHER: Symbol('OTHER'),
Expand Down
2 changes: 1 addition & 1 deletion src/lib/txn.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ const sendSignedTransaction = (web3, stx, doubtNonceError) => {
if (stx instanceof FakeMetamaskTransaction) {
eventEmitter = web3.eth.sendTransaction(stx.txnData);
} else {
eventEmitter = web3.eth.sendSignedTransaction(rawTx);
rawTx = hexify(stx.serialize());
eventEmitter = web3.eth.sendSignedTransaction(rawTx);
}
return new Promise(async (resolve, reject) => {
eventEmitter
Expand Down
6 changes: 3 additions & 3 deletions src/lib/useLocaHosting.js → src/lib/useLocalHosting.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ export default function useLocalHosting() {
const updateStatus = async point => {
const patp = ob.patp(point).slice(1);
try {
const { who } = await fetch(`https://${patp}.${DOMAIN}/who.json`).then(
r => r.json()
);
const { who } = await fetch(
`https://${patp}.${DOMAIN}/who.json`
).then(r => r.json());
if (who === patp) {
setStatus(STATE.RUNNING);
} else {
Expand Down
11 changes: 8 additions & 3 deletions src/lib/useRouter.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,14 @@ export default function useRouter({
setRoutes,
initialRoutes,
]);
const includes = useCallback(key => _includes(routes.map(r => r.key), key), [
routes,
]);
const includes = useCallback(
key =>
_includes(
routes.map(r => r.key),
key
),
[routes]
);
const data = useMemo(() => {
return get(last(routes), 'data', NULL_DATA);
}, [routes]);
Expand Down
2 changes: 1 addition & 1 deletion src/views/UrbitOS/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { useLocalRouter } from 'lib/LocalRouter';
import { useHosting } from 'store/hosting';
import DownloadKeyfileButton from 'components/DownloadKeyfileButton';
import useLifecycle from 'lib/useLifecycle';
import useLocalHosting from 'lib/useLocaHosting';
import useLocalHosting from 'lib/useLocalHosting';

export default function UrbitOSHome({ manualNetworkSeed }) {
const { pointCursor } = usePointCursor();
Expand Down