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

refactor: replace fungible token example sim tests with workspaces #699

Merged
merged 12 commits into from
Jan 27, 2022
2,979 changes: 1,072 additions & 1,907 deletions examples/fungible-token/Cargo.lock

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions examples/fungible-token/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@ authors = ["Near Inc <hello@nearprotocol.com>"]
edition = "2018"

[dev-dependencies]
anyhow = "1.0"
near-primitives = "0.5.0"
Copy link
Contributor

Choose a reason for hiding this comment

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

yeah an extension of what Phuong mentioned, this shouldn't be included

Suggested change
near-primitives = "0.5.0"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As @ChaoticTempest mentioned in the other thread I actually need this to pull FinalExecutionStatus

Copy link
Contributor

Choose a reason for hiding this comment

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

This seems like something that shouldn't be exposed through workspaces

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm, do you mean that workspaces should have its own type for expressing the call execution status?

CC @ChaoticTempest

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah, this is not an ideal pattern for workspace users to have to import a nearcore internal crate. Not a big deal, but something that should be changed at some point

Copy link
Member

Choose a reason for hiding this comment

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

ooof, this was a pattern I wasn't expecting to cover with asserts! with FinalExecutionStatus. Think we can defer this later until a new minor version of workspaces is released and we can convert these asserts! over to using is_success calls

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Think we can defer this later until a new minor version of workspaces is released and we can convert these asserts! over to using is_success calls

Yeah, we can defer for sure and is_success will help in this case, but CallExecutionDetails::status (which is a part of the public API) will still be a type from near-primitives so I think eventually we would want to replace it with something else.

near-sdk = { path = "../../near-sdk" }
near-sdk-sim = { path = "../../near-sdk-sim" }
serde_json = "1.0"
tokio = { version = "1.14", features = ["full"] }
workspaces = "0.1"

# remember to include a line for each contract
fungible-token = { path = "./ft" }
Expand All @@ -27,7 +31,3 @@ members = [
"ft",
"test-contract-defi",
]

[[example]]
name = "heavy"

103 changes: 0 additions & 103 deletions examples/fungible-token/examples/heavy.rs

This file was deleted.

Binary file modified examples/fungible-token/res/defi.wasm
Binary file not shown.
Binary file modified examples/fungible-token/res/fungible_token.wasm
Binary file not shown.
3 changes: 0 additions & 3 deletions examples/fungible-token/tests/sim/main.rs

This file was deleted.

62 changes: 0 additions & 62 deletions examples/fungible-token/tests/sim/no_macros.rs

This file was deleted.

95 changes: 0 additions & 95 deletions examples/fungible-token/tests/sim/utils.rs

This file was deleted.

Loading