on master help sign in
Use actual key revision during reticket process
d67c869Fang
src/lib/reticket.js+2−1
@@ -33,6 +33,7 @@ export async function reticketPointBetweenWallets({
33 contracts,
33 contracts,
34 onUpdate,
34 onUpdate,
35 transferEth = false,
35 transferEth = false,
36+ nextNetworkKeyRevision = INITIAL_NETWORK_KEY_REVISION,
36}) {
37}) {
37 const askForFunding = (address, minBalance, balance) =>
38 const askForFunding = (address, minBalance, balance) =>
38 onUpdate({
39 onUpdate({
@@ -67,7 +68,7 @@ export async function reticketPointBetweenWallets({
67 // configure networking public keys
68 // configure networking public keys
68 const seed = await deriveNetworkSeedFromUrbitWallet(
69 const seed = await deriveNetworkSeedFromUrbitWallet(
69 toWallet,
70 toWallet,
70− INITIAL_NETWORK_KEY_REVISION
71+ nextNetworkKeyRevision
71 );
72 );
72
73
73 const networkSeed = seed.matchWith({
74 const networkSeed = seed.matchWith({
src/views/Admin/Reticket/ReticketExecute.js+7−1
@@ -13,6 +13,7 @@ import useLifecycle from 'lib/useLifecycle';
13import { useNetwork } from 'store/network';
13import { useNetwork } from 'store/network';
14import { useWallet } from 'store/wallet';
14import { useWallet } from 'store/wallet';
15import { usePointCursor } from 'store/pointCursor';
15import { usePointCursor } from 'store/pointCursor';
16+import { usePointCache } from 'store/pointCache';
16import { useHistory } from 'store/history';
17import { useHistory } from 'store/history';
17
18
18import { RestartButton, ForwardButton } from 'components/Buttons';
19import { RestartButton, ForwardButton } from 'components/Buttons';
@@ -44,6 +45,7 @@ export default function ReticketExecute({ newWallet, setNewWallet }) {
44 const { web3, contracts } = useNetwork();
45 const { web3, contracts } = useNetwork();
45 const { wallet, setWalletType, resetWallet, setUrbitWallet } = useWallet();
46 const { wallet, setWalletType, resetWallet, setUrbitWallet } = useWallet();
46 const { pointCursor } = usePointCursor();
47 const { pointCursor } = usePointCursor();
48+ const { getDetails } = usePointCache();
47
49
48 const [generalError, setGeneralError] = useState();
50 const [generalError, setGeneralError] = useState();
49 const [progress, setProgress] = useState(0);
51 const [progress, setProgress] = useState(0);
@@ -53,14 +55,18 @@ export default function ReticketExecute({ newWallet, setNewWallet }) {
53 // start reticketing transactions on mount
55 // start reticketing transactions on mount
54 useLifecycle(() => {
56 useLifecycle(() => {
55 (async () => {
57 (async () => {
58+ const point = need.point(pointCursor);
59+ const details = need.details(getDetails(point));
60+ const networkRevision = parseInt(details.keyRevisionNumber, 10);
56 try {
61 try {
57 await reticketPointBetweenWallets({
62 await reticketPointBetweenWallets({
58 fromWallet: need.wallet(wallet),
63 fromWallet: need.wallet(wallet),
59 toWallet: newWallet.value.wallet,
64 toWallet: newWallet.value.wallet,
60− point: need.point(pointCursor),
65+ point: point,
61 web3: need.web3(web3),
66 web3: need.web3(web3),
62 contracts: need.contracts(contracts),
67 contracts: need.contracts(contracts),
63 onUpdate: handleUpdate,
68 onUpdate: handleUpdate,
69+ nextNetworkKeyRevision: networkRevision + 1,
64 });
70 });
65 } catch (err) {
71 } catch (err) {
66 setGeneralError(err);
72 setGeneralError(err);