-
Notifications
You must be signed in to change notification settings - Fork 49
replace ethereum plugin with ethereum wrapper #1446
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
Merged
Merged
Changes from all commits
Commits
Show all changes
64 commits
Select commit
Hold shift + click to select a range
0b8fbc7
removed ethereum plugin folder and updated default client config in c…
krisbitney 378c607
replaced usages of ethereum plugin with ethereum wrapper in various p…
krisbitney 3a0709b
changed ens uri used for ethereum wrapper and provider interface
krisbitney 1d76047
Merge remote-tracking branch 'origin/origin-dev' into ethereum-plugin…
krisbitney 08fd6ab
moved ens text record resolver ipfs uri to defaultWrappers object for…
krisbitney 9df2cc5
Merge remote-tracking branch 'origin/origin-dev' into ethereum-plugin…
krisbitney a243def
Merge remote-tracking branch 'origin/origin-dev' into ethereum-plugin…
krisbitney c74738e
using ipfs uri instead of ens text record uri for ethereum wrapper
krisbitney bc0aecb
updated eth wrapper URIs, updated eth provider plugin, moved invokeWi…
krisbitney b3ebe30
Merge remote-tracking branch 'origin/origin-dev' into ethereum-plugin…
krisbitney 7078403
fix merge conflicts
krisbitney 2ec4f68
updated ens wrappers in test-env-js to use ethereum wrapper
krisbitney da87773
fixed some tests for use with ethereum wrapper and missed merge confl…
krisbitney 53250e1
fixes to default config and client sanity test
krisbitney cb08ede
Merge remote-tracking branch 'origin/origin-dev' into ethereum-plugin…
krisbitney 8ff7a6f
updated ethereum wrapper ipfs uri to new version
krisbitney 2421071
Merge remote-tracking branch 'origin/origin-dev' into ethereum-plugin…
krisbitney ac753f7
updated ganache version in default test env to @latest
krisbitney 6045da6
fixed typo in updated ganache command in docker-compose
krisbitney ccdd538
correctly providing txHash to awaitTransaction call in ens-recursive-…
krisbitney eb4c8f9
moved timeout clearing logic in invokeWithTimeout
krisbitney db2d4d3
updated ens text record resolver ipfs uri to use version that depends…
krisbitney 8f09ca6
updated ens resolver test to throw result error on failure (helps wit…
krisbitney 97ac3d9
adjusted some codegen tests for ethereum wrapper
krisbitney d1ea738
adjusted docgen test for ethereum wrapper (output is malformed due to…
krisbitney 099c1cf
fixed client sanity test for change in default config bundle
krisbitney f00bb72
updated ens text record resolver ipfs URI in uri resolution tests; up…
krisbitney 2e817dd
added defaultIpfsProviders to client config in client tests
krisbitney 77b311a
Merge remote-tracking branch 'origin/origin-dev' into ethereum-plugin…
krisbitney 4e4d866
update yarn lock
krisbitney cc74ee1
Merge remote-tracking branch 'origin/origin-dev' into ethereum-plugin…
krisbitney 29329ec
fixed version of plugin-js in client package.json
krisbitney 0a0fbff
replaced invokeWithTimeout in ens deployer modules with tested version
krisbitney d74ee38
added RetryResolver to ens deployers; fixed null pointer exception wh…
krisbitney 90a3c2c
removed redundant items from getTestEnvClientConfig in CLI
krisbitney 272ac51
adjusted config in ens resolver test client
krisbitney 951c547
moved file reader null check from WasmWRapper and WasmPackage to UriR…
krisbitney de9e973
added RetryResolver to additional test client configs
krisbitney b88d99a
added retry options to ipfs resolver plugin; removed RetryResolver
krisbitney 87bdeb6
lint
krisbitney 4d114d2
Merge remote-tracking branch 'origin/origin-dev' into ethereum-plugin…
krisbitney 3f35dda
Merge remote-tracking branch 'origin/origin-dev' into ethereum-plugin…
krisbitney a0109b4
lint
krisbitney 881776e
fixed issue where deployment would fail when uri was already register…
krisbitney 68fea02
Merge remote-tracking branch 'origin/origin-dev' into ethereum-plugin…
krisbitney 7f715de
updated eth provider uri; simplified client config in ens deployer mo…
krisbitney 445c2ba
improved UInt8Array validity check in ipfs resolver plugin
krisbitney 63a8856
added copies of invokeWithTimeout.ts to each of the defult ens deploy…
krisbitney 99aa1a9
Merge remote-tracking branch 'origin/origin-dev' into ethereum-plugin…
krisbitney 94681a6
fix merge conflicts
krisbitney 1be734a
added ens wrapper uri and updated ens text record uri
krisbitney 590ac88
partial transition to ens/wraps:ethereum
krisbitney 753d633
updated to all URIS to ens/wraps.eth
krisbitney ef4c3cf
updated ethereum uris
krisbitney 0b9e0df
added fallback ipfs providers to test configs
krisbitney 4e481eb
added ens text record resolver to config in client tests; updated eth…
krisbitney 0f2d709
fixed uri in app codegen test case 002
krisbitney 04fe7b3
fixed uris some plugin codegen test cases
krisbitney b8fb20c
increased ipfs retry value
krisbitney 4850e07
updated version of ethereum-provider-js and replaced ethereum/ens ipf…
krisbitney 469e757
replaced old ens text record resolver ipfs uri with updated version i…
krisbitney d4a80e9
Merge remote-tracking branch 'origin/origin-dev' into ethereum-plugin…
krisbitney 63fb182
update yarn lock
krisbitney 982c1be
updated uri resolution tests
krisbitney File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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
2 changes: 1 addition & 1 deletion
2
packages/cli/src/__tests__/unit/option-parsers/samples/wrapper-envs.yaml
This file contains hidden or 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,6 +1,6 @@ | ||
| ens/hello-world.polywrap.eth: | ||
| foo: bar | ||
| ens/ethereum.polywrap.eth: | ||
| ens/wraps.eth:ethereum@1.0.0: | ||
| connection: | ||
| node: https://mainnet.infura.io/v3/some_api_key | ||
| networkNameOrChainId: mainnet |
This file contains hidden or 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
56 changes: 56 additions & 0 deletions
56
...ages/cli/src/lib/defaults/deploy-modules/ens-recursive-name-register/invokeWithTimeout.ts
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| import { | ||
| Invoker, | ||
| InvokeResult, | ||
| InvokerOptions, | ||
| WrapError, | ||
| WrapErrorCode, | ||
| } from "@polywrap/core-js"; | ||
| import { ResultErr } from "@polywrap/result"; | ||
|
|
||
| /** | ||
| * Invoke a wrapper; abort the invocation if a timeout expires. | ||
| * | ||
| * @param client - a Polywrap Invoker (e.g. CoreClient) | ||
| * @param options - invocation options | ||
| * @param timeout - a timeout period (in ms) | ||
| * */ | ||
| export async function invokeWithTimeout<TResult>( | ||
| client: Invoker, | ||
| options: InvokerOptions, | ||
| timeout: number | ||
| ): Promise<InvokeResult<TResult>> { | ||
| const controller = new AbortController(); | ||
|
|
||
| const timer = setTimeout(() => { | ||
| controller.abort(); | ||
| }, timeout); | ||
|
|
||
| return await new Promise<InvokeResult<TResult>>((resolve, reject) => { | ||
| controller.signal.addEventListener("abort", () => { | ||
| const wrapError = new WrapError("Timeout has been reached", { | ||
| code: WrapErrorCode.WRAPPER_INVOKE_ABORTED, | ||
| uri: options.uri.uri, | ||
| method: options.method, | ||
| args: JSON.stringify(options.args, null, 2), | ||
| }); | ||
| reject(wrapError); | ||
| }); | ||
| client | ||
| .invoke<TResult>(options) | ||
| .then((result) => resolve(result)) | ||
| .catch((error) => { | ||
| // the client threw an error (this should never happen) | ||
| const wrapError = new WrapError(error.message, { | ||
| code: WrapErrorCode.WRAPPER_INVOKE_FAIL, | ||
| uri: options.uri.uri, | ||
| method: options.method, | ||
| args: JSON.stringify(options.args, null, 2), | ||
| }); | ||
| resolve(ResultErr(wrapError)); | ||
| }); | ||
| }) | ||
| .catch((error) => { | ||
| return ResultErr<WrapError>(error as WrapError); | ||
| }) | ||
| .finally(() => timer && clearTimeout(timer)); | ||
| } |
This file contains hidden or 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
56 changes: 56 additions & 0 deletions
56
packages/cli/src/lib/defaults/deploy-modules/ens/invokeWithTimeout.ts
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| import { | ||
| Invoker, | ||
| InvokeResult, | ||
| InvokerOptions, | ||
| WrapError, | ||
| WrapErrorCode, | ||
| } from "@polywrap/core-js"; | ||
| import { ResultErr } from "@polywrap/result"; | ||
|
|
||
| /** | ||
| * Invoke a wrapper; abort the invocation if a timeout expires. | ||
| * | ||
| * @param client - a Polywrap Invoker (e.g. CoreClient) | ||
| * @param options - invocation options | ||
| * @param timeout - a timeout period (in ms) | ||
| * */ | ||
| export async function invokeWithTimeout<TResult>( | ||
| client: Invoker, | ||
| options: InvokerOptions, | ||
| timeout: number | ||
| ): Promise<InvokeResult<TResult>> { | ||
| const controller = new AbortController(); | ||
|
|
||
| const timer = setTimeout(() => { | ||
| controller.abort(); | ||
| }, timeout); | ||
|
|
||
| return await new Promise<InvokeResult<TResult>>((resolve, reject) => { | ||
| controller.signal.addEventListener("abort", () => { | ||
| const wrapError = new WrapError("Timeout has been reached", { | ||
| code: WrapErrorCode.WRAPPER_INVOKE_ABORTED, | ||
| uri: options.uri.uri, | ||
| method: options.method, | ||
| args: JSON.stringify(options.args, null, 2), | ||
| }); | ||
| reject(wrapError); | ||
| }); | ||
| client | ||
| .invoke<TResult>(options) | ||
| .then((result) => resolve(result)) | ||
| .catch((error) => { | ||
| // the client threw an error (this should never happen) | ||
| const wrapError = new WrapError(error.message, { | ||
| code: WrapErrorCode.WRAPPER_INVOKE_FAIL, | ||
| uri: options.uri.uri, | ||
| method: options.method, | ||
| args: JSON.stringify(options.args, null, 2), | ||
| }); | ||
| resolve(ResultErr(wrapError)); | ||
| }); | ||
| }) | ||
| .catch((error) => { | ||
| return ResultErr<WrapError>(error as WrapError); | ||
| }) | ||
| .finally(() => timer && clearTimeout(timer)); | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.