Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/tron-wallet-snap/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed

- Fix `bip44:discover` always failing due to `Network` enum being compiled bidirectionally by TypeScript when initialised from another enum's members, causing `Object.values(Network)` to include human-readable names (`"Mainnet"` etc.) alongside scope IDs; replaced enum initialisers with string literals so TypeScript emits a one-way mapping. ([#101](https://github.com/MetaMask/internal-snaps/pull/101))
- Fix `submitRequest` returning a v1 `KeyringResponse` envelope `{ pending: false, result: ... }` instead of raw `Json`; the Keyring API v2 `SnapKeyring` calls the snap directly and expects unwrapped `Json` back. ([#105](https://github.com/MetaMask/internal-snaps/pull/105))

## [2.0.0]

Expand Down
2 changes: 1 addition & 1 deletion packages/tron-wallet-snap/snap.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/MetaMask/internal-snaps.git"
},
"source": {
"shasum": "kpXPl/gHuE6MQIAy2ZxMvI3XByIC/Gj7xss6WPFWCe4=",
"shasum": "F3eaE0qVHHOHIRCGgPpluoGH5XmrorIMy/0ZHhBkBs0=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down
10 changes: 2 additions & 8 deletions packages/tron-wallet-snap/src/handlers/keyring/keyring.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,7 @@ describe('KeyringHandler', () => {

const result = await keyringHandler.submitRequest(request);

expect(result).toStrictEqual({
pending: false,
result: { signature: '0xsignature123' },
});
expect(result).toStrictEqual({ signature: '0xsignature123' });
expect(mockAccountsService.findById).toHaveBeenCalledWith(
mockAccount.id,
);
Expand Down Expand Up @@ -224,10 +221,7 @@ describe('KeyringHandler', () => {

const result = await keyringHandler.submitRequest(request);

expect(result).toStrictEqual({
pending: false,
result: { signature: '0xsignature123' },
});
expect(result).toStrictEqual({ signature: '0xsignature123' });
// The request reaching confirmation keeps the dApp's original payload.
expect(
mockConfirmationHandler.handleKeyringRequest,
Expand Down
5 changes: 2 additions & 3 deletions packages/tron-wallet-snap/src/handlers/keyring/keyring.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import type {
CreateAccountOptions as KeyringBatchCreateAccountOptions,
KeyringAccount,
KeyringRequest,
KeyringResponse,
Pagination,
ResolvedAccountAddress,
Transaction,
Expand Down Expand Up @@ -396,8 +395,8 @@ export class KeyringHandler implements KeyringSnapRpc {
}
}

async submitRequest(request: KeyringRequest): Promise<KeyringResponse> {
return { pending: false, result: await this.#handleSubmitRequest(request) };
async submitRequest(request: KeyringRequest): Promise<Json> {
return this.#handleSubmitRequest(request);
}

#prepareRequestForConfirmation(
Expand Down
Loading