Skip to content

Commit

Permalink
Merge pull request #7 from flmel/update_rust_sdk
Browse files Browse the repository at this point in the history
chore: update rust_sdk
  • Loading branch information
gagdiez authored Apr 1, 2024
2 parents c34b262 + c168819 commit e32141f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
4 changes: 2 additions & 2 deletions contract-rs/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "contract-rs"
description = "cargo-near-new-project-description"
description = "Hello Near Example"
version = "0.1.0"
edition = "2021"
# TODO: Fill out the repository field to help NEAR ecosystem tools to discover your project.
Expand All @@ -13,7 +13,7 @@ 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"] }
Expand Down
9 changes: 3 additions & 6 deletions contract-rs/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 e32141f

Please sign in to comment.