on master help sign in
invites: fix nonces in generateInviteCodes
2bca737yosoyubik
src/lib/useRoller.ts+5−5
@@ -153,7 +153,7 @@ export default function useRoller() {
153
153
154 for (let i = 0; i < numInvites && planets[i]; i++) {
154 for (let i = 0; i < numInvites && planets[i]; i++) {
155 const planet = planets[i];
155 const planet = planets[i];
156− const nonceInc = i * 3;
156+ const nonceInc = i + nonce;
157
157
158 const { ticket, owner } = await wg.generateTemporaryDeterministicWallet(
158 const { ticket, owner } = await wg.generateTemporaryDeterministicWallet(
159 planet,
159 planet,
@@ -172,9 +172,9 @@ export default function useRoller() {
172 const configureKeysRequest = await configureKeys(
172 const configureKeysRequest = await configureKeys(
173 api,
173 api,
174 _wallet,
174 _wallet,
175− _point,
175+ planet,
176 proxy,
176 proxy,
177− nonceInc + 1,
177+ 0, //nonceInc + 1,
178 _details,
178 _details,
179 authToken,
179 authToken,
180 authMnemonic,
180 authMnemonic,
@@ -187,7 +187,7 @@ export default function useRoller() {
187 _wallet,
187 _wallet,
188 planet,
188 planet,
189 proxy,
189 proxy,
190− nonceInc + 2,
190+ 1, //nonceInc + 2,
191 owner.keys.address
191 owner.keys.address
192 );
192 );
193
193
@@ -271,7 +271,7 @@ export default function useRoller() {
271
271
272 const stillPending = invites.pending.filter(invite => {
272 const stillPending = invites.pending.filter(invite => {
273 const completed = !pendingTransactions.find(
273 const completed = !pendingTransactions.find(
274− p => `~${p?.rawTx?.tx?.tx?.data?.ship}` === ob.patp(invite.planet)
274+ p => `~${p?.rawTx?.tx?.data?.ship}` === ob.patp(invite.planet)
275 );
275 );
276
276
277 if (
277 if (
src/lib/utils/roller.ts+5−5
@@ -1,5 +1,5 @@
1−import { signTransactionHash } from "lib/authToken";
1+import { signTransactionHash } from 'lib/authToken';
2−import { Invite } from "lib/types/Invite";
2+import { Invite } from 'lib/types/Invite';
3import { Just } from 'folktale/maybe';
3import { Just } from 'folktale/maybe';
4import { randomHex } from 'web3-utils';
4import { randomHex } from 'web3-utils';
5import {
5import {
@@ -65,7 +65,7 @@ export const configureKeys = async (
65 urbitWallet: any
65 urbitWallet: any
66) => {
66) => {
67 const from = {
67 const from = {
68− ship: _point, //ship that is spawning the planet
68+ ship: _point, //ship to configure keys
69 proxy,
69 proxy,
70 };
70 };
71
71
@@ -100,13 +100,13 @@ export const configureKeys = async (
100export const transferPoint = async (
100export const transferPoint = async (
101 api: any,
101 api: any,
102 _wallet: any,
102 _wallet: any,
103− planet: number,
103+ _point: number,
104 proxy: string,
104 proxy: string,
105 nonce: number,
105 nonce: number,
106 address: string
106 address: string
107) => {
107) => {
108 const from = {
108 const from = {
109− ship: planet, //planet to transfer
109+ ship: _point, // ship to transfer
110 proxy,
110 proxy,
111 };
111 };
112
112
src/views/Point/Point.js+1−1
@@ -235,7 +235,7 @@ export default function Point() {
235
235
236 const address = need.addressFromWallet(wallet);
236 const address = need.addressFromWallet(wallet);
237 const numPending = pendingTransactions.filter(
237 const numPending = pendingTransactions.filter(
238− ({ rawTx }) => rawTx?.tx?.tx?.type === 'spawn'
238+ ({ rawTx }) => rawTx?.tx?.type === 'spawn'
239 ).length;
239 ).length;
240
240
241 return (
241 return (