Skip to content

Commit

Permalink
chore: dep to similar as in workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
palozano committed Jul 3, 2024
1 parent 1ac50e5 commit e01a31e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/on_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,9 @@ jobs:
- name: "Build contracts"
run: make build-contracts

- name: "Ensure target dir exists"
- name: "Ensure target dirs exist"
run: mkdir -p target/near/near_da_blob_store
run: mkdir -p target/near/blob_registry

- name: "Run tests"
run: TEST_NEAR_ACCOUNT=${{ secrets.TEST_NEAR_ACCOUNT }} TEST_NEAR_SECRET=${{ secrets.TEST_NEAR_SECRET }} cargo nextest run --workspace --locked
Expand Down
8 changes: 4 additions & 4 deletions contracts/blob-registry/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ name = "blob-registry"
description = "Blob registry"
version = { workspace = true }
edition = { workspace = true }
authors = { workspace = true }

[lib]
crate-type = ["cdylib" ]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
borsh = { workspace = true }
hex = { workspace = true }
Expand All @@ -16,10 +16,10 @@ near-sdk-contract-tools = "3.0.2"

[dev-dependencies]
serde_json = "1.0.120"
anyhow = "1.0.86"
anyhow = "1.0.75"
near-da-primitives = { path = "../../crates/primitives", default-features = false }
near-workspaces = { version = "0.10.0", features = [ "unstable" ] }
tokio = { version = "1.28.0", features = ["full"] }
near-workspaces = { version = "0.8.0", features = [ "unstable" ] }
tokio = "1.28"

[features]
default = [ "std" ]
Expand Down
16 changes: 8 additions & 8 deletions contracts/blob-registry/tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ async fn new() -> anyhow::Result<()> {
// Create a new sandbox for testing.
let worker = near_workspaces::sandbox().await?;
// Compile the contract.
let wasm = near_workspaces::compile_project("./").await?;
let wasm = near_workspaces::compile_project(".").await?;
// Deploy the (wasm) contract into the sandbox.
let contract = worker.dev_deploy(&wasm).await?;
// Create a dev account for testing.
Expand All @@ -34,7 +34,7 @@ async fn register_consumer_not_enough_funds_errs() -> anyhow::Result<()> {
// Create a new sandbox for testing.
let worker = near_workspaces::sandbox().await?;
// Compile the contract.
let wasm = near_workspaces::compile_project("./").await?;
let wasm = near_workspaces::compile_project(".").await?;
// Deploy the (wasm) contract into the sandbox.
let contract = worker.dev_deploy(&wasm).await?;
// Create a dev account for testing.
Expand All @@ -52,7 +52,7 @@ async fn register_consumer_not_enough_funds_errs() -> anyhow::Result<()> {
let registration = alice
.call(contract.id(), "register_consumer")
.args_json(json!({ "namespace": 0 }))
.deposit(NearToken::from_millinear(99))
.deposit(NearToken::from_millinear(99).as_yoctonear())
.transact()
.await?
.into_result();
Expand All @@ -67,7 +67,7 @@ async fn submit() -> anyhow::Result<()> {
// Create a new sandbox for testing.
let worker = near_workspaces::sandbox().await?;
// Compile the contract.
let wasm = near_workspaces::compile_project("./").await?;
let wasm = near_workspaces::compile_project(".").await?;
// Deploy the (wasm) contract into the sandbox.
let contract = worker.dev_deploy(&wasm).await?;
// Create a dev account for testing.
Expand All @@ -85,7 +85,7 @@ async fn submit() -> anyhow::Result<()> {
alice
.call(contract.id(), "register_consumer")
.args_json(json!({ "namespace": 0 }))
.deposit(NearToken::from_millinear(100))
.deposit(NearToken::from_millinear(100).as_yoctonear())
.transact()
.await?
.into_result()?;
Expand Down Expand Up @@ -113,7 +113,7 @@ async fn owner_change() -> anyhow::Result<()> {
// Create a new sandbox for testing.
let worker = near_workspaces::sandbox().await?;
// Compile the contract.
let wasm = near_workspaces::compile_project("./").await?;
let wasm = near_workspaces::compile_project(".").await?;
// Deploy the (wasm) contract into the sandbox.
let contract = worker.dev_deploy(&wasm).await?;
// Create a dev account for testing.
Expand All @@ -140,14 +140,14 @@ async fn owner_change() -> anyhow::Result<()> {
.args_json(json!({
"account_id": bob.id(),
}))
.deposit(NearToken::from_yoctonear(1))
.deposit(NearToken::from_yoctonear(1).as_yoctonear())
.transact()
.await?
.unwrap();

// Bob accepts the ownership
bob.call(contract.id(), "own_accept_owner")
.deposit(NearToken::from_yoctonear(1))
.deposit(NearToken::from_yoctonear(1).as_yoctonear())
.transact()
.await?
.unwrap();
Expand Down

0 comments on commit e01a31e

Please sign in to comment.