on master help sign in
reticket: sign set spawn proxy TX w/ MT wal

The receiving wallet (aka reticketed Master Ticket wallet) now signs the L2 Set Spawn Proxy TX.

commit73ef2e54afc52b7b733ca8ec9786cd220cd79761 authortomholford <tomholford@users.noreply.github.com> dateFri 11 Feb 2022, 12:19 (5 years ago) parent3b36a53
2 files changed+13−2
src/lib/useReticketL2Spawn.ts+12−1 src/lib/utils/roller.ts+1−1
src/lib/useReticketL2Spawn.ts+12−1
@@ -97,12 +97,23 @@ export const useReticketL2Spawn = () => {
9797 });
9898
9999 // instead, set spawn proxy on L2
100+ // In most TX sending cases, we would use the fromWallet to sign and send
101+ // the TX. However, because we are transferring this point during the
102+ // reticket, we will instead sign the final set spawn proxy TX with the
103+ // receiving wallet's private key.
104+
105+ // `registerProxyAddress` expects a toWallet object shaped like a
106+ // BridgeWallet with `address` and `privateKey` properties.
107+ const toWalletStub = {
108+ address: toWallet.ownership.keys.address,
109+ privateKey: Buffer.from(toWallet.ownership.keys.private, 'hex'),
110+ };
100111 const proxy = 'own';
101112 const nonce = await api.getNonce({ ship: point, proxy });
102113
103114 await registerProxyAddress(
104115 api,
105− fromWallet,
116+ toWalletStub,
106117 point,
107118 proxy,
108119 'spawn',
src/lib/utils/roller.ts+1−1
@@ -208,7 +208,7 @@ const setProxy = async (
208208
209209export const registerProxyAddress = async (
210210 api: RollerRPCAPI,
211− wallet: any,
211+ wallet: any, // BridgeWallet
212212 _point: Ship,
213213 proxy: string,
214214 proxyAddressType: string,