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: 8 additions & 8 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ jobs:

steps:
- name: Install dependencies
run: apt-get update && apt-get -y install curl git build-essential pkg-config libssl-dev lsb-release wget software-properties-common gnupg
- name: Install llvm 18
run: wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 18 && rm llvm.sh
run: apt-get update && apt-get -y install curl git build-essential pkg-config libssl-dev lsb-release wget gnupg
- name: Install llvm 19
run: wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 19 && rm llvm.sh
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: clippy
Expand Down Expand Up @@ -189,8 +189,8 @@ jobs:
- uses: actions/checkout@v3
with:
submodules: true
- name: Install llvm 18
run: brew install llvm@18
- name: Install llvm 19
run: brew install llvm@19
- name: Install riscv64 target
run: rustup target add riscv64imac-unknown-none-elf
- name: Install cargo generate
Expand Down Expand Up @@ -228,7 +228,7 @@ jobs:
shell: pwsh
# https://github.com/ScoopInstaller/Install#for-admin
#
# Note that on Windows we cannot choose LLVM 18 here, we have to settle on latest stable LLVM
# Note that on Windows we cannot choose LLVM 19 here, we have to settle on latest stable LLVM
run: |
iex "& {$(irm get.scoop.sh)} -RunAsAdmin"
scoop install llvm yasm
Expand Down Expand Up @@ -272,14 +272,14 @@ jobs:
usesh: true
prepare: |
set -ex
pkg install -y llvm18 git gmake bash
pkg install -y llvm19 git gmake bash
curl https://sh.rustup.rs -sSf | sh -s -- -y
. $HOME/.cargo/env
rustup target add riscv64imac-unknown-none-elf
cargo install cargo-generate
run: |
set -ex
. $HOME/.cargo/env
. $HOME/.cargo/env
cargo generate --path . standalone-contract --name test-contract
cd test-contract
gmake build test check clippy
Expand Down
6 changes: 3 additions & 3 deletions atomics-contract/.cargo-generate/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ fn test_{{crate_name}}() {
// prepare cells
let input_out_point = context.create_cell(
CellOutput::new_builder()
.capacity(1000u64.pack())
.capacity(1000)
.lock(lock_script.clone())
.build(),
Bytes::new(),
Expand All @@ -25,11 +25,11 @@ fn test_{{crate_name}}() {
.build();
let outputs = vec![
CellOutput::new_builder()
.capacity(500u64.pack())
.capacity(500)
.lock(lock_script.clone())
.build(),
CellOutput::new_builder()
.capacity(500u64.pack())
.capacity(500)
.lock(lock_script)
.build(),
];
Expand Down
4 changes: 2 additions & 2 deletions atomics-contract/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[package]
name = "{{project-name}}"
version = "0.1.0"
edition = "2021"
edition = "2024"

[dependencies]
ckb-std = { version = "0.17.0", default-features = false, features = ["allocator", "calc-hash", "ckb-types", "libc"] }
ckb-std = { version = "1.0", default-features = false, features = ["allocator", "calc-hash", "ckb-types", "libc"] }
log = { version = "0.4.20", default-features = false }

[build-dependencies]
Expand Down
1 change: 0 additions & 1 deletion atomics-contract/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ fn main() {
);
build
.file(format!("{top}/deps/lib-dummy-atomics/atomics.c"))
.static_flag(true)
.include(format!("{top}/deps/ckb-c-stdlib"))
.include(format!("{top}/deps/ckb-c-stdlib/libc"))
.no_default_flags(true)
Expand Down
2 changes: 1 addition & 1 deletion c-wrapper-crate/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "{{project-name}}"
version = "0.1.0"
edition = "2021"
edition = "2024"

[dependencies]

Expand Down
1 change: 0 additions & 1 deletion c-wrapper-crate/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ fn main() {
);
build
.file("c.c")
.static_flag(true)
.include(format!("{top}/deps/ckb-c-stdlib"))
.include(format!("{top}/deps/ckb-c-stdlib/libc"))
.no_default_flags(true)
Expand Down
6 changes: 3 additions & 3 deletions contract-without-simulator/.cargo-generate/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ fn test_{{crate_name}}() {
// prepare cells
let input_out_point = context.create_cell(
CellOutput::new_builder()
.capacity(1000u64.pack())
.capacity(1000)
.lock(lock_script.clone())
.build(),
Bytes::new(),
Expand All @@ -25,11 +25,11 @@ fn test_{{crate_name}}() {
.build();
let outputs = vec![
CellOutput::new_builder()
.capacity(500u64.pack())
.capacity(500)
.lock(lock_script.clone())
.build(),
CellOutput::new_builder()
.capacity(500u64.pack())
.capacity(500)
.lock(lock_script)
.build(),
];
Expand Down
4 changes: 2 additions & 2 deletions contract-without-simulator/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "{{project-name}}"
version = "0.1.0"
edition = "2021"
edition = "2024"

[dependencies]
ckb-std = "0.17.0"
ckb-std = "1.0"
6 changes: 3 additions & 3 deletions contract/.cargo-generate/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ fn test_{{crate_name}}() {
// prepare cells
let input_out_point = context.create_cell(
CellOutput::new_builder()
.capacity(1000u64.pack())
.capacity(1000)
.lock(lock_script.clone())
.build(),
Bytes::new(),
Expand All @@ -25,11 +25,11 @@ fn test_{{crate_name}}() {
.build();
let outputs = vec![
CellOutput::new_builder()
.capacity(500u64.pack())
.capacity(500)
.lock(lock_script.clone())
.build(),
CellOutput::new_builder()
.capacity(500u64.pack())
.capacity(500)
.lock(lock_script)
.build(),
];
Expand Down
4 changes: 2 additions & 2 deletions contract/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[package]
name = "{{project-name}}"
version = "0.1.0"
edition = "2021"
edition = "2024"

[dependencies]
ckb-std = "0.17.0"
ckb-std = "1.0"

[features]
library = []
Expand Down
4 changes: 2 additions & 2 deletions native-simulator/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[package]
name = "{{project-name}}"
version = "0.1.0"
edition = "2021"
edition = "2024"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
{{project-name | append: "@@SIMULATOR_PLACEHOLDER@@" | remove: "-sim@@SIMULATOR_PLACEHOLDER@@"}} = { path = "../../contracts/{{project-name | append: "@@SIMULATOR_PLACEHOLDER@@" | remove: "-sim@@SIMULATOR_PLACEHOLDER@@"}}", features = ["native-simulator"] }
ckb-std = { version = "0.17.0", features = ["native-simulator"] }
ckb-std = { version = "1.0", features = ["native-simulator"] }

[lib]
crate-type = ["cdylib"]
6 changes: 3 additions & 3 deletions stack-reorder-contract/.cargo-generate/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ fn test_{{crate_name}}() {
// prepare cells
let input_out_point = context.create_cell(
CellOutput::new_builder()
.capacity(1000u64.pack())
.capacity(1000)
.lock(lock_script.clone())
.build(),
Bytes::new(),
Expand All @@ -25,11 +25,11 @@ fn test_{{crate_name}}() {
.build();
let outputs = vec![
CellOutput::new_builder()
.capacity(500u64.pack())
.capacity(500)
.lock(lock_script.clone())
.build(),
CellOutput::new_builder()
.capacity(500u64.pack())
.capacity(500)
.lock(lock_script)
.build(),
];
Expand Down
4 changes: 2 additions & 2 deletions stack-reorder-contract/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[package]
name = "{{project-name}}"
version = "0.1.0"
edition = "2021"
edition = "2024"

[dependencies]
ckb-std = "0.17.0"
ckb-std = "1.0"

[build-dependencies]
cc = "1.0"
1 change: 0 additions & 1 deletion stack-reorder-contract/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ fn main() {
);
build
.file("bootloader.S")
.static_flag(true)
.no_default_flags(true)
.flag("--target=riscv64")
.flag("-march=rv64imc_zba_zbb_zbc_zbs")
Expand Down
6 changes: 3 additions & 3 deletions standalone-contract/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
name = "{{project-name}}"
version = "0.1.0"
edition = "2021"
edition = "2024"

[dependencies]
ckb-std = "0.17.0"
ckb-std = "1.0"

[dev-dependencies]
ckb-testtool = "0.15.0"
ckb-testtool = "1.0"
serde_json = "1.0"
4 changes: 3 additions & 1 deletion standalone-contract/scripts/find_clang
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@ fi
# at the end.
SEARCH_TARGET="${SEARCH_TARGET:-llvm-strip}"

CANDIDATES=("${SEARCH_TARGET}" "${SEARCH_TARGET}-19" "${SEARCH_TARGET}-18" "${SEARCH_TARGET}-17" "${SEARCH_TARGET}-16")
CANDIDATES=("${SEARCH_TARGET}" "${SEARCH_TARGET}-19" "${SEARCH_TARGET}-20" "${SEARCH_TARGET}-21" "${SEARCH_TARGET}-18" "${SEARCH_TARGET}-17" "${SEARCH_TARGET}-16")

BREW_PREFIX=$(brew --prefix 2> /dev/null)
if [[ -n "${BREW_PREFIX}" ]]; then
CANDIDATES+=(
"${BREW_PREFIX}/opt/llvm/bin/${SEARCH_TARGET}"
"${BREW_PREFIX}/opt/llvm@19/bin/${SEARCH_TARGET}"
"${BREW_PREFIX}/opt/llvm@20/bin/${SEARCH_TARGET}"
"${BREW_PREFIX}/opt/llvm@21/bin/${SEARCH_TARGET}"
"${BREW_PREFIX}/opt/llvm@18/bin/${SEARCH_TARGET}"
"${BREW_PREFIX}/opt/llvm@17/bin/${SEARCH_TARGET}"
"${BREW_PREFIX}/opt/llvm@16/bin/${SEARCH_TARGET}"
Expand Down
6 changes: 3 additions & 3 deletions standalone-contract/src/tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ fn test_{{crate_name}}() {
// prepare cells
let input_out_point = context.create_cell(
CellOutput::new_builder()
.capacity(1000u64.pack())
.capacity(1000)
.lock(lock_script.clone())
.build(),
Bytes::new(),
Expand All @@ -36,11 +36,11 @@ fn test_{{crate_name}}() {
.build();
let outputs = vec![
CellOutput::new_builder()
.capacity(500u64.pack())
.capacity(500)
.lock(lock_script.clone())
.build(),
CellOutput::new_builder()
.capacity(500u64.pack())
.capacity(500)
.lock(lock_script)
.build(),
];
Expand Down
4 changes: 3 additions & 1 deletion workspace/scripts/find_clang
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@ fi
# at the end.
SEARCH_TARGET="${SEARCH_TARGET:-llvm-strip}"

CANDIDATES=("${SEARCH_TARGET}" "${SEARCH_TARGET}-19" "${SEARCH_TARGET}-18" "${SEARCH_TARGET}-17" "${SEARCH_TARGET}-16")
CANDIDATES=("${SEARCH_TARGET}" "${SEARCH_TARGET}-19" "${SEARCH_TARGET}-20" "${SEARCH_TARGET}-21" "${SEARCH_TARGET}-18" "${SEARCH_TARGET}-17" "${SEARCH_TARGET}-16")

BREW_PREFIX=$(brew --prefix 2> /dev/null)
if [[ -n "${BREW_PREFIX}" ]]; then
CANDIDATES+=(
"${BREW_PREFIX}/opt/llvm/bin/${SEARCH_TARGET}"
"${BREW_PREFIX}/opt/llvm@19/bin/${SEARCH_TARGET}"
"${BREW_PREFIX}/opt/llvm@20/bin/${SEARCH_TARGET}"
"${BREW_PREFIX}/opt/llvm@21/bin/${SEARCH_TARGET}"
"${BREW_PREFIX}/opt/llvm@18/bin/${SEARCH_TARGET}"
"${BREW_PREFIX}/opt/llvm@17/bin/${SEARCH_TARGET}"
"${BREW_PREFIX}/opt/llvm@16/bin/${SEARCH_TARGET}"
Expand Down
4 changes: 2 additions & 2 deletions workspace/tests/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
name = "tests"
version = "0.1.0"
edition = "2021"
edition = "2024"

[features]
native-simulator = [ "ckb-testtool/native-simulator" ]

[dependencies]
ckb-testtool = "0.15.0"
ckb-testtool = "1.0"
serde_json = "1.0"
8 changes: 4 additions & 4 deletions x64-simulator-crate/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
[package]
name = "{{project-name}}"
version = "0.1.0"
edition = "2021"
edition = "2024"

[dependencies]
ckb-std = "0.17.0"
ckb-std = "1.0"

# Supporting native tests powered by ckb-x64-simulator
[target.'cfg(all(target_arch = "x86_64", unix))'.dependencies.ckb-std]
version = "0.17.0"
version = "1.0"
features = ["native-simulator"]

[target.'cfg(all(target_arch = "x86_64", unix))'.dev-dependencies]
ckb-testtool = "0.15.0"
ckb-testtool = "1.0"
rusty-fork = "0.3.0"
rand = "0.8.5"
serde_json = "1.0"
Expand Down
2 changes: 1 addition & 1 deletion x64-simulator-crate/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ mod tests {
let mut file = tempfile::NamedTempFile::new().expect("tempfile");
file.write_all(json.as_ref()).expect("write");
file.flush().expect("flush");
std::env::set_var("CKB_TX_FILE", file.path());
unsafe { std::env::set_var("CKB_TX_FILE", file.path()); }
file
};

Expand Down