on master help sign in
Use actual key revision during reticket process

In other words, mimics the behavior of configuring keys through the normal flow.

commitd67c869d84ad9a30d9c83091b61c0d42516c0208 authorFang <git@fang.io> dateThu 18 Jul 2019, 17:32 (7 years ago) parent84f0413
2 files changed+9−2
src/lib/reticket.js+2−1 src/views/Admin/Reticket/ReticketExecute.js+7−1
src/lib/reticket.js+2−1
@@ -33,6 +33,7 @@ export async function reticketPointBetweenWallets({
3333 contracts,
3434 onUpdate,
3535 transferEth = false,
36+ nextNetworkKeyRevision = INITIAL_NETWORK_KEY_REVISION,
3637}) {
3738 const askForFunding = (address, minBalance, balance) =>
3839 onUpdate({
@@ -67,7 +68,7 @@ export async function reticketPointBetweenWallets({
6768 // configure networking public keys
6869 const seed = await deriveNetworkSeedFromUrbitWallet(
6970 toWallet,
70− INITIAL_NETWORK_KEY_REVISION
71+ nextNetworkKeyRevision
7172 );
7273
7374 const networkSeed = seed.matchWith({
src/views/Admin/Reticket/ReticketExecute.js+7−1
@@ -13,6 +13,7 @@ import useLifecycle from 'lib/useLifecycle';
1313import { useNetwork } from 'store/network';
1414import { useWallet } from 'store/wallet';
1515import { usePointCursor } from 'store/pointCursor';
16+import { usePointCache } from 'store/pointCache';
1617import { useHistory } from 'store/history';
1718
1819import { RestartButton, ForwardButton } from 'components/Buttons';
@@ -44,6 +45,7 @@ export default function ReticketExecute({ newWallet, setNewWallet }) {
4445 const { web3, contracts } = useNetwork();
4546 const { wallet, setWalletType, resetWallet, setUrbitWallet } = useWallet();
4647 const { pointCursor } = usePointCursor();
48+ const { getDetails } = usePointCache();
4749
4850 const [generalError, setGeneralError] = useState();
4951 const [progress, setProgress] = useState(0);
@@ -53,14 +55,18 @@ export default function ReticketExecute({ newWallet, setNewWallet }) {
5355 // start reticketing transactions on mount
5456 useLifecycle(() => {
5557 (async () => {
58+ const point = need.point(pointCursor);
59+ const details = need.details(getDetails(point));
60+ const networkRevision = parseInt(details.keyRevisionNumber, 10);
5661 try {
5762 await reticketPointBetweenWallets({
5863 fromWallet: need.wallet(wallet),
5964 toWallet: newWallet.value.wallet,
60− point: need.point(pointCursor),
65+ point: point,
6166 web3: need.web3(web3),
6267 contracts: need.contracts(contracts),
6368 onUpdate: handleUpdate,
69+ nextNetworkKeyRevision: networkRevision + 1,
6470 });
6571 } catch (err) {
6672 setGeneralError(err);