Skip to content

Commit

Permalink
feat: Updated new project template with near-sdk-rs 5.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
frol committed Apr 9, 2024
1 parent 7a3eaa0 commit 4074164
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ crate-type = ["cdylib", "rlib"]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
near-sdk = "5.0.0"
near-sdk = "5.1.0"

[dev-dependencies]
near-sdk = { version = "5.0.0", features = ["unit-testing"] }
near-sdk = { version = "5.1.0", features = ["unit-testing"] }
near-workspaces = { version = "0.10.0", features = ["unstable"] }
tokio = { version = "1.12.0", features = ["full"] }
serde_json = "1"
Expand Down
9 changes: 3 additions & 6 deletions cargo-near/src/commands/new/new-project-template/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
// Find all our documentation at https://docs.near.org
use near_sdk::borsh::{BorshDeserialize, BorshSerialize};
use near_sdk::{log, near_bindgen};
use near_sdk::{log, near};

// Define the contract structure
#[near_bindgen]
#[derive(BorshDeserialize, BorshSerialize)]
#[borsh(crate = "near_sdk::borsh")]
#[near(contract_state)]
pub struct Contract {
greeting: String,
}
Expand All @@ -20,7 +17,7 @@ impl Default for Contract {
}

// Implement the contract structure
#[near_bindgen]
#[near]
impl Contract {
// Public method - returns the greeting saved, defaulting to DEFAULT_GREETING
pub fn get_greeting(&self) -> String {
Expand Down

0 comments on commit 4074164

Please sign in to comment.