Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,28 @@ on:
- master
pull_request:

env:
RUST_BACKTRACE: full
MSRV: 1.76.0
Comment thread
mooori marked this conversation as resolved.

jobs:
tests:
name: Tests
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: 1.74.0 # MSRV
toolchain: ${{ env.MSRV }}
override: true
target: wasm32-unknown-unknown

- uses: Swatinem/rust-cache@v1
with:
key: rust-version-1.74.0-msrv-2
key: rust-version-${{ env.MSRV }}-msrv-2

- name: add wasm32-unknown-unknown
run: rustup target add wasm32-unknown-unknown
Expand All @@ -36,18 +40,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: 1.74.0 # MSRV
toolchain: ${{ env.MSRV }}
override: true
components: rustfmt, clippy

- uses: Swatinem/rust-cache@v1
with:
key: rust-version-1.74.0-msrv-2
key: rust-version-${{ env.MSRV }}-msrv-2

- name: cargo fmt
run: cargo fmt --all -- --check
Expand Down
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ authors = ["Aurora Labs <hello@aurora.dev>"]
# An update of the MSRV requires updating:
# - `rust-toolchain` files in `near-plugins-derive/tests/contracts/**`
# - the toolchain installed in CI via the `toolchain` parameter of `actions-rs/toolchain@v1`
rust-version = "1.74.0"
rust-version = "1.76.0"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the MSRV bump required due to dependency updates?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately yes. The near-workspaces 0.11 required 1.76.0.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heads up for the Bridge team that the MSRV is bumped here, cc @karim-en.

description = "Ergonomic plugin system to extend NEAR contracts."
license = "CC0-1.0"
readme = "README.md"
Expand All @@ -23,14 +23,14 @@ keywords = ["near", "smart contract", "plugin"]

[workspace.dependencies]
bitflags = "1.3"
near-sdk = "5.1.0"
near-sdk = "5.2"
Comment thread
mooori marked this conversation as resolved.
near-plugins = { path = "near-plugins" }
near-plugins-derive = { path = "near-plugins-derive" }
serde = "1"
anyhow = "1.0"
tokio = { version = "1", features = ["full"] }
near-workspaces = "0.10"
toml = "0.5"
near-workspaces = "0.11"
toml = "0.8"
darling = "0.13.1"
proc-macro2 = "1.0"
quote = "1.0.9"
Expand Down
6 changes: 3 additions & 3 deletions near-plugins-derive/src/access_controllable.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
use crate::access_control_role::new_bitflags_type_ident;
use crate::utils;
use crate::utils::{cratename, is_near_bindgen_wrapped_or_marshall};
use darling::FromMeta;
use proc_macro::TokenStream;
use proc_macro2::Span;
use quote::quote;
use syn::{parse_macro_input, AttributeArgs, ItemFn, ItemStruct};

use crate::access_control_role::new_bitflags_type_ident;
use crate::utils::{self, cratename, is_near_bindgen_wrapped_or_marshall};

/// Defines attributes for the `access_controllable` macro.
#[derive(Debug, FromMeta)]
pub struct MacroArgs {
Expand Down
4 changes: 2 additions & 2 deletions near-plugins-derive/tests/common/repo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use std::path::{Path, PathBuf};
use std::process::Output;

async fn read_toolchain(project_path: &Path) -> anyhow::Result<String> {
let bytes = tokio::fs::read(project_path.join("rust-toolchain")).await?;
let value: toml::Value = toml::from_slice(&bytes)?;
let content = tokio::fs::read_to_string(project_path.join("rust-toolchain")).await?;
let value: toml::Value = toml::from_str(&content)?;
let result = value
.as_table()
.and_then(|t| t.get("toolchain"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ crate-type = ["cdylib", "rlib"]

[dependencies]
near-plugins = { path = "../../../../near-plugins" }
near-sdk = "5.1"
near-sdk = "5.2"

[profile.release]
codegen-units = 1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[toolchain]
channel = "1.74.0"
channel = "1.76.0"
components = ["clippy", "rustfmt"]
targets = [ "wasm32-unknown-unknown" ]
4 changes: 2 additions & 2 deletions near-plugins-derive/tests/contracts/ownable/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[package]
name = "ownable"
version = "0.0.0"
edition = "2018"
edition = "2021"

[lib]
crate-type = ["cdylib", "rlib"]

[dependencies]
near-plugins = { path = "../../../../near-plugins" }
near-sdk = "5.1.0"
near-sdk = "5.2"

[profile.release]
codegen-units = 1
Expand Down
2 changes: 1 addition & 1 deletion near-plugins-derive/tests/contracts/ownable/rust-toolchain
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[toolchain]
channel = "1.74.0"
channel = "1.76.0"
components = ["clippy", "rustfmt"]
targets = [ "wasm32-unknown-unknown" ]
4 changes: 2 additions & 2 deletions near-plugins-derive/tests/contracts/pausable/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[package]
name = "pausable"
version = "0.0.0"
edition = "2018"
edition = "2021"

[lib]
crate-type = ["cdylib", "rlib"]

[dependencies]
near-plugins = { path = "../../../../near-plugins" }
near-sdk = "5.1.0"
near-sdk = "5.2"

[profile.release]
codegen-units = 1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[toolchain]
channel = "1.74.0"
channel = "1.76.0"
components = ["clippy", "rustfmt"]
targets = [ "wasm32-unknown-unknown" ]
4 changes: 2 additions & 2 deletions near-plugins-derive/tests/contracts/upgradable/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[package]
name = "upgradable"
version = "0.0.0"
edition = "2018"
edition = "2021"

[lib]
crate-type = ["cdylib", "rlib"]

[dependencies]
near-plugins = { path = "../../../../near-plugins" }
near-sdk = "5.1.0"
near-sdk = "5.2"

[profile.release]
codegen-units = 1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[toolchain]
channel = "1.74.0"
channel = "1.76.0"
components = ["clippy", "rustfmt"]
targets = [ "wasm32-unknown-unknown" ]
4 changes: 2 additions & 2 deletions near-plugins-derive/tests/contracts/upgradable_2/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[package]
name = "upgradable_2"
version = "0.0.0"
edition = "2018"
edition = "2021"

[lib]
crate-type = ["cdylib", "rlib"]

[dependencies]
near-plugins = { path = "../../../../near-plugins" }
near-sdk = "5.1.0"
near-sdk = "5.2"

[profile.release]
codegen-units = 1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[toolchain]
channel = "1.74.0"
channel = "1.76.0"
components = ["clippy", "rustfmt"]
targets = [ "wasm32-unknown-unknown" ]
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[package]
name = "upgradable_state_migration"
version = "0.0.0"
edition = "2018"
edition = "2021"

[lib]
crate-type = ["cdylib", "rlib"]

[dependencies]
near-plugins = { path = "../../../../near-plugins" }
near-sdk = "5.1.0"
near-sdk = "5.2"

[profile.release]
codegen-units = 1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[toolchain]
channel = "1.74.0"
channel = "1.76.0"
components = ["clippy", "rustfmt"]
targets = [ "wasm32-unknown-unknown" ]
6 changes: 3 additions & 3 deletions near-plugins-derive/tests/upgradable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ async fn test_deploy_code_with_migration() -> anyhow::Result<()> {
function_name: "migrate".to_string(),
arguments: Vec::new(),
amount: NearToken::from_yoctonear(0),
gas: Gas::from_tgas(1),
gas: Gas::from_tgas(3),
};
let res = setup
.upgradable_contract
Expand Down Expand Up @@ -552,7 +552,7 @@ async fn test_deploy_code_with_migration_failure_rollback() -> anyhow::Result<()
function_name: "migrate_with_failure".to_string(),
arguments: Vec::new(),
amount: NearToken::from_yoctonear(0),
gas: Gas::from_tgas(1),
gas: Gas::from_tgas(2),
};
let res = setup
.upgradable_contract
Expand Down Expand Up @@ -600,7 +600,7 @@ async fn test_deploy_code_in_batch_transaction_pitfall() -> anyhow::Result<()> {
function_name: "migrate_with_failure".to_string(),
arguments: Vec::new(),
amount: NearToken::from_yoctonear(0),
gas: Gas::from_tgas(1),
gas: Gas::from_tgas(2),
} }))
.gas(Gas::from_tgas(201));
let fn_call_remove_code = near_workspaces::operations::Function::new("up_stage_code")
Expand Down
2 changes: 1 addition & 1 deletion near-plugins/src/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pub trait AsEvent<T: Serialize> {

/// Emits the event on chain.
fn emit(&self) {
near_sdk::log!(self.event());
near_sdk::log!("{}", self.event());
}
}

Expand Down