Skip to content

Commit ba5fe80

Browse files
committed
chore: Update dependencies and SDK versions to 2.3.0
1 parent bb77227 commit ba5fe80

File tree

20 files changed

+38
-206
lines changed

20 files changed

+38
-206
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ members = [
99
exclude = ["examples/"]
1010

1111
[workspace.package]
12-
version = "2.2.1"
12+
version = "2.3.0"
1313

1414
# Special triple # comment for ci.
1515
[patch.crates-io]

examples/versioned/src/lib.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use unc_sdk::store::UnorderedMap;
1+
use unc_sdk::store::IterableMap;
22
use unc_sdk::{env, log, unc, AccountId, UncToken};
33

44
/// An example of a versioned contract. This is a simple contract that tracks how much
@@ -30,7 +30,7 @@ impl VersionedContract {
3030
}
3131
}
3232

33-
fn funders(&self) -> &UnorderedMap<AccountId, UncToken> {
33+
fn funders(&self) -> &IterableMap<AccountId, UncToken> {
3434
match self {
3535
Self::V0(contract) => &contract.funders,
3636
Self::V1(contract) => &contract.funders,
@@ -46,24 +46,24 @@ impl Default for VersionedContract {
4646

4747
#[unc]
4848
pub struct ContractV0 {
49-
funders: UnorderedMap<AccountId, UncToken>,
49+
funders: IterableMap<AccountId, UncToken>,
5050
}
5151

5252
impl Default for ContractV0 {
5353
fn default() -> Self {
54-
Self { funders: UnorderedMap::new(b"f") }
54+
Self { funders: IterableMap::new(b"f") }
5555
}
5656
}
5757

5858
#[unc]
5959
pub struct Contract {
60-
funders: UnorderedMap<AccountId, UncToken>,
60+
funders: IterableMap<AccountId, UncToken>,
6161
nonce: u64,
6262
}
6363

6464
impl Default for Contract {
6565
fn default() -> Self {
66-
Self { funders: UnorderedMap::new(b"f"), nonce: 0 }
66+
Self { funders: IterableMap::new(b"f"), nonce: 0 }
6767
}
6868
}
6969

@@ -128,7 +128,7 @@ mod tests {
128128
#[test]
129129
fn contract_v0_interactions() {
130130
let mut contract = {
131-
let mut funders = UnorderedMap::new(b"f");
131+
let mut funders = IterableMap::new(b"f");
132132
funders.insert(bob(), UncToken::from_attounc(8));
133133
VersionedContract::V0(ContractV0 { funders })
134134
};

unc-contract-standards/src/non_fungible_token/core/core_impl.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ impl NonFungibleToken {
277277
/// * token_id must be unique
278278
///
279279
/// Returns the newly minted token
280-
#[deprecated(since = "4.0.0", note = "mint is deprecated, please use internal_mint instead.")]
280+
#[deprecated(since = "2.0.0", note = "mint is deprecated, please use internal_mint instead.")]
281281
pub fn mint(
282282
&mut self,
283283
token_id: TokenId,

unc-sdk-macros/src/lib.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ pub fn unc(attr: TokenStream, item: TokenStream) -> TokenStream {
291291
/// #[event_version("2.0.0")]
292292
/// StringEvent(String),
293293
///
294-
/// #[event_version("3.0.0")]
294+
/// #[event_version("2.1.0")]
295295
/// EmptyEvent
296296
/// }
297297
///
@@ -510,34 +510,34 @@ pub fn ext_contract(attr: TokenStream, item: TokenStream) -> TokenStream {
510510

511511
/// `callback` is a marker attribute it does not generate code by itself.
512512
#[proc_macro_attribute]
513-
#[deprecated(since = "4.0.0", note = "Case is handled internally by macro, no need to import")]
513+
#[deprecated(since = "2.0.0", note = "Case is handled internally by macro, no need to import")]
514514
pub fn callback(_attr: TokenStream, item: TokenStream) -> TokenStream {
515515
item
516516
}
517517

518518
/// `callback_args_vec` is a marker attribute it does not generate code by itself.
519-
#[deprecated(since = "4.0.0", note = "Case is handled internally by macro, no need to import")]
519+
#[deprecated(since = "2.0.0", note = "Case is handled internally by macro, no need to import")]
520520
#[proc_macro_attribute]
521521
pub fn callback_vec(_attr: TokenStream, item: TokenStream) -> TokenStream {
522522
item
523523
}
524524

525525
/// `serializer` is a marker attribute it does not generate code by itself.
526-
#[deprecated(since = "4.0.0", note = "Case is handled internally by macro, no need to import")]
526+
#[deprecated(since = "2.0.0", note = "Case is handled internally by macro, no need to import")]
527527
#[proc_macro_attribute]
528528
pub fn serializer(_attr: TokenStream, item: TokenStream) -> TokenStream {
529529
item
530530
}
531531

532532
/// `result_serializer` is a marker attribute it does not generate code by itself.
533-
#[deprecated(since = "4.0.0", note = "Case is handled internally by macro, no need to import")]
533+
#[deprecated(since = "2.0.0", note = "Case is handled internally by macro, no need to import")]
534534
#[proc_macro_attribute]
535535
pub fn result_serializer(_attr: TokenStream, item: TokenStream) -> TokenStream {
536536
item
537537
}
538538

539539
/// `init` is a marker attribute it does not generate code by itself.
540-
#[deprecated(since = "4.0.0", note = "Case is handled internally by macro, no need to import")]
540+
#[deprecated(since = "2.0.0", note = "Case is handled internally by macro, no need to import")]
541541
#[proc_macro_attribute]
542542
pub fn init(_attr: TokenStream, item: TokenStream) -> TokenStream {
543543
item

unc-sdk/compilation_tests/bad_argument.stderr

Lines changed: 0 additions & 5 deletions
This file was deleted.

unc-sdk/compilation_tests/contract_metadata_fn_name.stderr

Lines changed: 0 additions & 5 deletions
This file was deleted.

unc-sdk/compilation_tests/generic_const_function.stderr

Lines changed: 0 additions & 5 deletions
This file was deleted.

unc-sdk/compilation_tests/generic_function.stderr

Lines changed: 0 additions & 5 deletions
This file was deleted.

unc-sdk/compilation_tests/impl_generic.stderr

Lines changed: 0 additions & 11 deletions
This file was deleted.

unc-sdk/compilation_tests/invalid_arg_pat.stderr

Lines changed: 0 additions & 23 deletions
This file was deleted.

unc-sdk/compilation_tests/payable_view.stderr

Lines changed: 0 additions & 5 deletions
This file was deleted.

unc-sdk/compilation_tests/schema_derive_invalids.stderr

Lines changed: 0 additions & 93 deletions
This file was deleted.

unc-sdk/compilation_tests/self_forbidden_in_non_init_fn_arg.stderr

Lines changed: 0 additions & 11 deletions
This file was deleted.

unc-sdk/compilation_tests/self_forbidden_in_non_init_fn_return.stderr

Lines changed: 0 additions & 5 deletions
This file was deleted.

unc-sdk/src/environment/env.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ pub fn input() -> Option<Vec<u8>> {
185185
}
186186

187187
/// Current block index.
188-
#[deprecated(since = "4.0.0", note = "Use block_height instead")]
188+
#[deprecated(since = "2.0.0", note = "Use block_height instead")]
189189
pub fn block_index() -> BlockHeight {
190190
block_height()
191191
}
@@ -848,7 +848,7 @@ pub fn value_return(value: &[u8]) {
848848
}
849849
/// Terminates the execution of the program with the UTF-8 encoded message.
850850
/// [`panic_str`] should be used as the bytes are required to be UTF-8
851-
#[deprecated(since = "4.0.0", note = "Use env::panic_str to panic with a message.")]
851+
#[deprecated(since = "2.0.0", note = "Use env::panic_str to panic with a message.")]
852852
pub fn panic(message: &[u8]) -> ! {
853853
unsafe { sys::panic_utf8(message.len() as _, message.as_ptr() as _) }
854854
}
@@ -883,7 +883,7 @@ pub fn log_str(message: &str) {
883883
}
884884

885885
/// Log the UTF-8 encodable message.
886-
#[deprecated(since = "4.0.0", note = "Use env::log_str for logging messages.")]
886+
#[deprecated(since = "2.0.0", note = "Use env::log_str for logging messages.")]
887887
pub fn log(message: &[u8]) {
888888
#[cfg(all(debug_assertions, not(target_arch = "wasm32")))]
889889
eprintln!("{}", String::from_utf8_lossy(message));

unc-sdk/src/json_types/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub use integers::{I128, I64, U128, U64};
1111
pub use vector::Base64VecU8;
1212

1313
#[deprecated(
14-
since = "4.0.0",
14+
since = "2.0.0",
1515
note = "ValidAccountId is no longer maintained, and AccountId should be used instead"
1616
)]
1717
pub type ValidAccountId = AccountId;
@@ -20,13 +20,13 @@ pub type ValidAccountId = AccountId;
2020
// but will likely work in the future. Also included just to note that it is
2121
// indeed deprecated and not just a random export.
2222
#[deprecated(
23-
since = "4.0.0",
23+
since = "2.0.0",
2424
note = "This import is deprecated. Best to import directly from unc_sdk"
2525
)]
2626
pub use crate::types::CurveType;
2727

2828
#[deprecated(
29-
since = "4.0.0",
29+
since = "2.0.0",
3030
note = "PublicKey type is now unified with Base58PublicKey. It is \
3131
recommended to use PublicKey going forward to avoid using \
3232
similar sounding types for the same thing."

unc-sdk/src/test_utils/context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ impl VMContextBuilder {
186186
}
187187

188188
/// Initializes the [`MockedBlockchain`] with a single promise result during execution.
189-
#[deprecated(since = "4.0.0", note = "Use `testing_env!` macro to initialize with promise results")]
189+
#[deprecated(since = "2.0.0", note = "Use `testing_env!` macro to initialize with promise results")]
190190
pub fn testing_env_with_promise_results(context: VMContext, promise_result: PromiseResult) {
191191
let storage = crate::mock::with_mocked_blockchain(|b| b.take_storage());
192192

unc-sdk/src/test_utils/test_env.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pub fn carol() -> AccountId {
1515

1616
/// Updates the blockchain interface with the config passed in.
1717
#[deprecated(
18-
since = "4.0.0",
18+
since = "2.0.0",
1919
note = "Use `testing_env!` macro to initialize with specific VMConfig"
2020
)]
2121
pub fn setup_with_config(vm_config: unc_parameters::vm::Config) {
@@ -24,7 +24,7 @@ pub fn setup_with_config(vm_config: unc_parameters::vm::Config) {
2424

2525
/// Setup the blockchain interface with a default configuration.
2626
#[deprecated(
27-
since = "4.0.0",
27+
since = "2.0.0",
2828
note = "Mocked blockchain is now setup by default, use `testing_env!`"
2929
)]
3030
pub fn setup() {

0 commit comments

Comments
 (0)