Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Update @safe-global/safe-apps-sdk to ^8.0.0 #2339

Merged
merged 4 commits into from
Aug 14, 2023
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
4 changes: 4 additions & 0 deletions jest.setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// Used for __tests__/testing-library.js
// Learn more: https://github.com/testing-library/jest-dom
import '@testing-library/jest-dom/extend-expect'
import { TextEncoder, TextDecoder } from 'util'

jest.mock('@web3-onboard/coinbase', () => jest.fn())
jest.mock('@web3-onboard/injected-wallets', () => ({ ProviderLabel: { MetaMask: 'MetaMask' } }))
Expand Down Expand Up @@ -42,4 +43,7 @@ jest.mock('@web3-onboard/core', () => () => ({
const NumberFormat = Intl.NumberFormat
const englishTestLocale = 'en'

// `viem` used by the `safe-apps-sdk` uses `TextEncoder` and `TextDecoder` which are not available in jsdom for some reason
Object.assign(global, { TextDecoder, TextEncoder })

jest.spyOn(Intl, 'NumberFormat').mockImplementation((locale, ...rest) => new NumberFormat([englishTestLocale], ...rest))
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"@mui/material": "^5.14.3",
"@mui/x-date-pickers": "^5.0.12",
"@reduxjs/toolkit": "^1.9.5",
"@safe-global/safe-apps-sdk": "7.11.0",
"@safe-global/safe-apps-sdk": "^8.0.0",
"@safe-global/safe-core-sdk": "^3.3.4",
"@safe-global/safe-core-sdk-utils": "^1.7.4",
"@safe-global/safe-deployments": "^1.25.0",
Expand Down
2 changes: 1 addition & 1 deletion src/components/safe-apps/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const FEATURES = [
'speaker-selection',
]

export type AllowedFeatures = typeof FEATURES[number]
export type AllowedFeatures = (typeof FEATURES)[number]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This threw a linter error without the braces


export const isBrowserFeature = (featureKey: string): featureKey is AllowedFeatures => {
return FEATURES.includes(featureKey as AllowedFeatures)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ const ReviewSignMessageOnChain = ({ message, method, requestId }: SignMessageOnC
// the primary type. And there must only be one type that is not used by any other type.
delete typesCopy.EIP712Domain
txData = readOnlySignMessageLibContract.encode('signMessage', [
// @ts-expect-error ethers type is complaining about missing BigNumber's methods. But we're not getting a BigNumber instance from a JSON
_TypedDataEncoder.hash(message.domain, typesCopy, message.message),
])
}
Expand Down
6 changes: 3 additions & 3 deletions src/services/pairing/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ const pairingModule = (): WalletInit => {
public chains: Chain[]
public disconnect: EIP1193Provider['disconnect']
// @ts-expect-error - 'emit' does not exist on `typeof EventEmitter`
public emit: typeof EventEmitter['emit']
public emit: (typeof EventEmitter)['emit']
// @ts-expect-error - 'on' does not exist on `typeof EventEmitter`
public on: typeof EventEmitter['on']
public on: (typeof EventEmitter)['on']
// @ts-expect-error - 'removeListener' does not exist on `typeof EventEmitter`
public removeListener: typeof EventEmitter['removeListener']
public removeListener: (typeof EventEmitter)['removeListener']
Comment on lines +59 to +63
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This threw a linter error without the braces


private disconnected$: InstanceType<typeof Subject>
private providers: Record<string, InstanceType<typeof StaticJsonRpcProvider>>
Expand Down
Loading