Skip to content

Commit b70459c

Browse files
authored
Merge pull request #3 from flmel/update_rust_sdk
chore: update rust_sdk
2 parents e469287 + fcd9bee commit b70459c

File tree

4 files changed

+8
-11
lines changed

4 files changed

+8
-11
lines changed

Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ crate-type = ["cdylib", "rlib"]
1313

1414
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
1515
[dependencies]
16-
near-sdk = { version = "5.0.0", features = ["unstable"] }
16+
near-sdk = { version = "5.1.0", features = ["unstable"] }
1717

1818
[dev-dependencies]
19-
near-sdk = { version = "5.0.0", features = ["unit-testing"] }
19+
near-sdk = { version = "5.1.0", features = ["unit-testing"] }
2020
near-workspaces = { version = "0.10.0", features = ["unstable"] }
2121
tokio = { version = "1.12.0", features = ["full"] }
2222
serde_json = "1"

src/deploy.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use near_sdk::serde::Serialize;
2-
use near_sdk::{env, log, near_bindgen, AccountId, NearToken, Promise, PromiseError, PublicKey};
2+
use near_sdk::{env, log, near, AccountId, NearToken, Promise, PromiseError, PublicKey};
33

44
use crate::{Contract, ContractExt, NEAR_PER_STORAGE, NO_DEPOSIT, TGAS};
55

@@ -9,7 +9,7 @@ struct DonationInitArgs {
99
beneficiary: AccountId,
1010
}
1111

12-
#[near_bindgen]
12+
#[near]
1313
impl Contract {
1414
#[payable]
1515
pub fn create_factory_subaccount_and_deploy(

src/lib.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Find all our documentation at https://docs.near.org
2-
use near_sdk::borsh::{BorshDeserialize, BorshSerialize};
32
use near_sdk::store::LazyOption;
4-
use near_sdk::{near_bindgen, Gas, NearToken};
3+
use near_sdk::{near, Gas, NearToken};
54

65
mod deploy;
76
mod manager;
@@ -12,9 +11,7 @@ const TGAS: Gas = Gas::from_tgas(1); // 10e12yⓃ
1211
const NO_DEPOSIT: NearToken = NearToken::from_near(0); // 0yⓃ
1312

1413
// Define the contract structure
15-
#[near_bindgen]
16-
#[derive(BorshDeserialize, BorshSerialize)]
17-
#[borsh(crate = "near_sdk::borsh")]
14+
#[near(contract_state)]
1815
pub struct Contract {
1916
// Since a contract is something big to store, we use LazyOptions
2017
// this way it is not deserialized on each method call

src/manager.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
use near_sdk::{env, near_bindgen};
1+
use near_sdk::{env, near};
22

33
use crate::{Contract, ContractExt};
44

5-
#[near_bindgen]
5+
#[near]
66
impl Contract {
77
#[private]
88
pub fn update_stored_contract(&mut self) {

0 commit comments

Comments
 (0)