Skip to content

Commit

Permalink
add more log lines to debug multichain error
Browse files Browse the repository at this point in the history
  • Loading branch information
Dizigen committed Dec 5, 2023
1 parent fdadce7 commit 8951ccb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/@magic-sdk/provider/src/core/view-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ async function createMagicRequest(
const decrypted = await decryptDeviceShare(deviceShare, ek, ivString);
request.deviceShare = decrypted;
}
console.warn('request that was generated', request);
return request;
}

Expand Down Expand Up @@ -200,6 +201,7 @@ export abstract class ViewController {
const batchIds = Array.isArray(payload) ? payload.map((p) => p.id) : [];
const msg = await createMagicRequest(`${msgType}-${this.parameters}`, payload, this.networkHash);

console.warn('right before _post');
await this._post(msg);

/**
Expand Down
1 change: 1 addition & 0 deletions packages/@magic-sdk/provider/src/modules/base-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export class BaseModule {
* Emits promisified requests to the Magic `<iframe>` context.
*/
protected request<ResultType = any, Events extends EventsDefinition = void>(payload: Partial<JsonRpcRequestPayload>) {
console.warn('calling request', payload);
const responsePromise = this.overlay.post<ResultType>(
MagicOutgoingWindowMessage.MAGIC_HANDLE_REQUEST,
standardizeJsonRpcRequestPayload(payload),
Expand Down
1 change: 1 addition & 0 deletions packages/magic-sdk/src/iframe-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ export class IframeController extends ViewController {
}

protected async _post(data: any) {
console.warn('posting data', data);
const iframe = await this.iframe;
if (iframe && iframe.contentWindow) {
iframe.contentWindow.postMessage(data, this.endpoint);
Expand Down

0 comments on commit 8951ccb

Please sign in to comment.