-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: tentative CJS build + ethers v6 (#1280)
* chore(deps): bump ethers (#1242) * fix(deps): patch tests and package.json files after the ethers bump Co-authored-by: Dennis von der Bey <[email protected]>
- Loading branch information
1 parent
977662a
commit b4e8b95
Showing
59 changed files
with
19,258 additions
and
8,430 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ jobs: | |
GH_TOKEN: ${{secrets.GH_TOKEN}} | ||
GH_USER: ${{secrets.GH_USER}} | ||
GH_EMAIL: ${{secrets.GH_EMAIL}} | ||
runs-on: ubuntu-18.04 | ||
runs-on: ubuntu-latest | ||
services: | ||
postgres: | ||
image: postgres:15.1 | ||
|
@@ -56,7 +56,7 @@ jobs: | |
|
||
- name: setup git coordinates | ||
run: | | ||
git remote set-url origin https://uport-project:$[email protected]/uport-project/veramo.git | ||
git remote set-url origin https://${{secrets.GH_USER}}:${{secrets.GH_TOKEN}}@github.com/decentralized-identity/veramo.git | ||
git config user.name $GH_USER | ||
git config user.email $GH_EMAIL | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,35 @@ | ||
import { Web3Provider, ExternalProvider } from '@ethersproject/providers' | ||
import { Wallet } from '@ethersproject/wallet' | ||
import { BrowserProvider, Eip1193Provider, Wallet } from 'ethers' | ||
|
||
export function createEthersProvider(): Web3Provider { | ||
export function createEthersProvider(): BrowserProvider { | ||
const privateKeyHex = '0x1da6847600b0ee25e9ad9a52abbd786dd2502fa4005dd5af9310b7cc7a3b25db' | ||
const wallet = new Wallet(privateKeyHex) | ||
const mockProvider = new MockWeb3Provider(wallet) | ||
const provider = new Web3Provider(mockProvider) | ||
const provider = new BrowserProvider(mockProvider) | ||
return provider | ||
} | ||
|
||
class MockWeb3Provider implements Eip1193Provider { | ||
constructor(private wallet: Wallet) {} | ||
|
||
class MockWeb3Provider implements ExternalProvider { | ||
constructor(private wallet: Wallet){ | ||
|
||
} | ||
async request(request: { method: string; params?: any[] }): Promise<any> { | ||
|
||
switch(request.method) { | ||
case 'personal_sign': | ||
//@ts-ignore | ||
return this.wallet.signMessage(request.params[1]) | ||
break | ||
case 'eth_signTypedData_v4': | ||
//@ts-ignore | ||
case 'eth_signTypedData_v4': | ||
// @ts-ignore | ||
const {domain, types, message} = JSON.parse(request.params[1]) | ||
delete(types.EIP712Domain) | ||
return this.wallet._signTypedData(domain, types, message) | ||
return this.wallet.signTypedData(domain, types, message) | ||
case 'eth_accounts': | ||
return [await this.wallet.getAddress()] | ||
case 'eth_chainId': | ||
return "1337" | ||
break | ||
default: | ||
throw Error(`not_available: method ${request.method}`) | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.