Skip to content

Commit 7f958d1

Browse files
authored
chore: upgraded crates to nearcore 2.10 release (#180)
1 parent b95ac53 commit 7f958d1

File tree

8 files changed

+33
-26
lines changed

8 files changed

+33
-26
lines changed

Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ thiserror = "2.0"
1919
serde_json = "1.0.85"
2020
lazy_static = "1.4.0"
2121

22-
near-crypto = "0.33"
23-
near-primitives = { version = "0.33", features = ["test_utils"] }
24-
near-chain-configs = "0.33"
25-
near-jsonrpc-primitives = "0.33"
22+
near-crypto = "0.34"
23+
near-primitives = { version = "0.34", features = ["test_utils"] }
24+
near-chain-configs = "0.34"
25+
near-jsonrpc-primitives = "0.34"
2626

2727
[dev-dependencies]
2828
tokio = { version = "1.0", features = ["macros", "rt-multi-thread"] }

examples/contract_change_method.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
use near_jsonrpc_client::{methods, JsonRpcClient};
22
use near_jsonrpc_primitives::types::query::QueryResponseKind;
33
use near_jsonrpc_primitives::types::transactions::{RpcTransactionError, TransactionInfo};
4+
use near_primitives::gas::Gas;
45
use near_primitives::transaction::{Action, FunctionCallAction, Transaction, TransactionV0};
5-
use near_primitives::types::BlockReference;
6+
use near_primitives::types::{Balance, BlockReference};
67
use near_primitives::views::TxExecutionStatus;
78

89
use serde_json::json;
@@ -53,8 +54,8 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
5354
})
5455
.to_string()
5556
.into_bytes(),
56-
gas: 100_000_000_000_000, // 100 TeraGas
57-
deposit: 0,
57+
gas: Gas::from_teragas(100),
58+
deposit: Balance::ZERO,
5859
}))],
5960
};
6061

examples/contract_change_method_commit.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
use near_jsonrpc_client::{methods, JsonRpcClient};
22
use near_jsonrpc_primitives::types::query::QueryResponseKind;
3+
use near_primitives::gas::Gas;
34
use near_primitives::transaction::{Action, FunctionCallAction, Transaction, TransactionV0};
4-
use near_primitives::types::BlockReference;
5+
use near_primitives::types::{Balance, BlockReference};
56

67
use serde_json::json;
78

@@ -50,8 +51,8 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
5051
})
5152
.to_string()
5253
.into_bytes(),
53-
gas: 100_000_000_000_000, // 100 TeraGas
54-
deposit: 0,
54+
gas: Gas::from_teragas(100),
55+
deposit: Balance::ZERO,
5556
}))],
5657
};
5758

examples/create_account.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@ use near_jsonrpc_client::methods::broadcast_tx_commit::RpcTransactionError;
1313
use near_jsonrpc_client::{methods, JsonRpcClient};
1414
use near_jsonrpc_primitives::types::query::QueryResponseKind;
1515
use near_jsonrpc_primitives::types::transactions::TransactionInfo;
16+
use near_primitives::gas::Gas;
1617
use near_primitives::hash::CryptoHash;
1718
use near_primitives::transaction::{
1819
Action, AddKeyAction, CreateAccountAction, FunctionCallAction, Transaction, TransactionV0,
1920
TransferAction,
2021
};
21-
use near_primitives::types::{AccountId, BlockReference};
22+
use near_primitives::types::{AccountId, Balance, BlockReference};
2223
use near_primitives::views::{FinalExecutionStatus, TxExecutionStatus};
2324

2425
use serde_json::json;
@@ -151,7 +152,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
151152
public_key: new_key_pair.public_key(),
152153
})),
153154
Action::Transfer(TransferAction {
154-
deposit: initial_deposit,
155+
deposit: Balance::from_yoctonear(initial_deposit),
155156
}),
156157
],
157158
},
@@ -180,8 +181,8 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
180181
})
181182
.to_string()
182183
.into_bytes(),
183-
gas: 300_000_000_000_000,
184-
deposit: initial_deposit,
184+
gas: Gas::from_teragas(300),
185+
deposit: Balance::from_yoctonear(initial_deposit),
185186
}))],
186187
},
187188
b"true".to_vec(),

examples/send_tx.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
use near_jsonrpc_client::{methods, JsonRpcClient};
22
use near_jsonrpc_primitives::types::query::QueryResponseKind;
33
use near_jsonrpc_primitives::types::transactions::{RpcTransactionError, TransactionInfo};
4+
use near_primitives::gas::Gas;
45
use near_primitives::transaction::{Action, FunctionCallAction, Transaction, TransactionV0};
5-
use near_primitives::types::BlockReference;
6+
use near_primitives::types::{Balance, BlockReference};
67
use near_primitives::views::TxExecutionStatus;
78
use tokio::time;
89

@@ -53,8 +54,8 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
5354
})
5455
.to_string()
5556
.into_bytes(),
56-
gas: 100_000_000_000_000, // 100 TeraGas
57-
deposit: 0,
57+
gas: Gas::from_teragas(100),
58+
deposit: Balance::ZERO,
5859
}))],
5960
});
6061
let tx_hash = transaction.get_hash_and_size().0;

src/methods/broadcast_tx_async.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
//!
1111
//! ```no_run
1212
//! use near_jsonrpc_client::{methods, JsonRpcClient};
13-
//! use near_primitives::types::{AccountId};
13+
//! use near_primitives::gas::Gas;
14+
//! use near_primitives::types::{AccountId, Balance};
1415
//! use near_primitives::transaction::{Action, FunctionCallAction, Transaction, TransactionV0};
1516
//! use near_crypto::SecretKey;
1617
//! use core::str::FromStr;
@@ -42,8 +43,8 @@
4243
//! })
4344
//! .to_string()
4445
//! .into_bytes(),
45-
//! gas: 100_000_000_000_000, // 100 TeraGas
46-
//! deposit: 0,
46+
//! gas: Gas::from_teragas(100),
47+
//! deposit: Balance::ZERO,
4748
//! }))],
4849
//! });
4950
//!

src/methods/broadcast_tx_commit.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
//! ```no_run
1414
//! use near_jsonrpc_client::{methods, JsonRpcClient};
1515
//! use near_jsonrpc_primitives::types::{query::QueryResponseKind, transactions::TransactionInfo};
16-
//! use near_primitives::types::{AccountId, BlockReference};
16+
//! use near_primitives::gas::Gas;
17+
//! use near_primitives::types::{AccountId, Balance, BlockReference};
1718
//! use near_primitives::transaction::{Action, FunctionCallAction, Transaction, TransactionV0};
1819
//! use serde_json::json;
1920
//!
@@ -43,8 +44,8 @@
4344
//! })
4445
//! .to_string()
4546
//! .into_bytes(),
46-
//! gas: 100_000_000_000_000, // 100 TeraGas
47-
//! deposit: 0,
47+
//! gas: Gas::from_teragas(100),
48+
//! deposit: Balance::ZERO,
4849
//! }))],
4950
//! });
5051
//!

src/methods/send_tx.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@
1212
//!
1313
//! ```no_run
1414
//! use near_jsonrpc_client::{methods, JsonRpcClient};
15+
//! use near_primitives::gas::Gas;
1516
//! use near_jsonrpc_primitives::types::{query::QueryResponseKind, transactions::TransactionInfo};
16-
//! use near_primitives::types::{AccountId, BlockReference};
17+
//! use near_primitives::types::{AccountId, Balance, BlockReference};
1718
//! use near_primitives::transaction::{Action, FunctionCallAction, Transaction, TransactionV0};
1819
//! use serde_json::json;
1920
//!
@@ -44,8 +45,8 @@
4445
//! })
4546
//! .to_string()
4647
//! .into_bytes(),
47-
//! gas: 100_000_000_000_000, // 100 TeraGas
48-
//! deposit: 0,
48+
//! gas: Gas::from_teragas(100),
49+
//! deposit: Balance::ZERO,
4950
//! }))],
5051
//! });
5152
//!

0 commit comments

Comments
 (0)