-
Notifications
You must be signed in to change notification settings - Fork 0
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
[NayNay] Transfer updates + unit testing #140
Merged
+224
−81
Merged
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
9946f43
[NayNay] Transfer updates + unit testing
rh0delta 24cd3bd
Merge branch 'dev' into naynay/transfer-testing
rh0delta 837dd65
updated transfer pure function and added tests
rh0delta daed1a4
Merge branch 'dev' into naynay/transfer-testing
rh0delta e0b5e7b
Merge branch 'dev' of github.com:entropyxyz/cli into naynay/transfer-…
mixmix b8a3c50
Update transfer.test.ts
rh0delta 2499a56
updated based on PR suggestions
rh0delta ddb31ad
updated progress bar use to be more universal for the cli; based on p…
rh0delta 0f48986
updating comment
rh0delta 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
Loading status checks…
updated based on PR suggestions
commit 2499a56b6ba0436c72c5ecb42a1b7c431a74b3cf
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 |
---|---|---|
@@ -1,5 +1,7 @@ | ||
// @ts-ignore | ||
import { Pair } from '@entropyxyz/sdk/keys' | ||
export interface TransferOptions { | ||
from?: any | ||
from: Pair | ||
to: string | ||
amount: number | string | bigint | ||
amount: bigint | ||
} |
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 |
---|---|---|
|
@@ -2,6 +2,8 @@ import { Test } from 'tape' | |
import { Entropy, wasmGlobalsReady } from '@entropyxyz/sdk' | ||
// @ts-ignore | ||
import { spinNetworkUp, spinNetworkDown, } from "@entropyxyz/sdk/testing" | ||
// @ts-ignore | ||
import Keyring from '@entropyxyz/sdk/keys' | ||
Comment on lines
3
to
+6
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is their an an issue for this on sdk? this dosent look good. |
||
|
||
import { initializeEntropy } from '../../src/common/initializeEntropy' | ||
import * as config from '../../src/config' | ||
|
@@ -38,9 +40,11 @@ export async function setupTest (t: Test, opts?: SetupTestOpts): Promise<{ entro | |
|
||
// TODO: remove this after new SDK is published | ||
await sleep(process.env.GITHUB_WORKSPACE ? 30_000 : 5_000) | ||
|
||
// To follow the same way we initiate entropy within the cli we must go through the same process of creating an initial keyring | ||
// as done in src/flows/manage-accounts/new-key.ts | ||
const keyring = new Keyring({ seed, debug: true }) | ||
const entropy = await initializeEntropy({ | ||
keyMaterial: { seed, debug: true }, | ||
keyMaterial: keyring.getAccount(), | ||
endpoint: 'ws://127.0.0.1:9944', | ||
configPath | ||
}) | ||
|
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,7 +1,8 @@ | ||
import test from 'tape' | ||
import Entropy, { wasmGlobalsReady } from '@entropyxyz/sdk' | ||
import { wasmGlobalsReady } from '@entropyxyz/sdk' | ||
// WIP: I'm seeing problems importing this? | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it resolved in the SDK that is un-published yet I wonder |
||
import Keyring from '@entropyxyz/sdk/dist/keys/index' | ||
// @ts-ignore | ||
import Keyring from '@entropyxyz/sdk/keys' | ||
import { | ||
makeSeed, | ||
promiseRunner, | ||
|
@@ -33,8 +34,11 @@ test('Transfer', async (t) => { | |
await sleep(process.env.GITHUB_WORKSPACE ? 30_000 : 5_000) | ||
|
||
const naynaySeed = makeSeed() | ||
const entropy = await initializeEntropy({ keyMaterial: { seed: naynaySeed, debug: true }, endpoint: 'ws://127.0.0.1:9944', }) | ||
const charlieEntropy = await initializeEntropy({ keyMaterial: { seed: charlieStashSeed, debug: true }, endpoint: 'ws://127.0.0.1:9944', }) | ||
const naynayKeyring = new Keyring({ seed: naynaySeed, debug: true }) | ||
const charlieKeyring = new Keyring({ seed: charlieStashSeed, debug: true }) | ||
|
||
const entropy = await initializeEntropy({ keyMaterial: naynayKeyring.getAccount(), endpoint: 'ws://127.0.0.1:9944', }) | ||
const charlieEntropy = await initializeEntropy({ keyMaterial: charlieKeyring.getAccount(), endpoint: 'ws://127.0.0.1:9944', }) | ||
await run('entropy ready', entropy.ready) | ||
await run('charlie ready', charlieEntropy.ready) | ||
|
||
|
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😍