Skip to content

Commit 589735c

Browse files
authored
Update ckb-std and ckb-testtool to v1.0 (#35)
* Update ckb-std and ckb-testtool to v1.0 * Fix ci * Deprecated method * software-properties-common is not available in Debian Trixie * Fix tests * Call to unsafe function * Support llvm-20, llvm-21 in find_clang
1 parent 1e4e61d commit 589735c

File tree

21 files changed

+50
-49
lines changed

21 files changed

+50
-49
lines changed

.github/workflows/rust.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ jobs:
6666

6767
steps:
6868
- name: Install dependencies
69-
run: apt-get update && apt-get -y install curl git build-essential pkg-config libssl-dev lsb-release wget software-properties-common gnupg
70-
- name: Install llvm 18
71-
run: wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 18 && rm llvm.sh
69+
run: apt-get update && apt-get -y install curl git build-essential pkg-config libssl-dev lsb-release wget gnupg
70+
- name: Install llvm 19
71+
run: wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 19 && rm llvm.sh
7272
- uses: actions-rust-lang/setup-rust-toolchain@v1
7373
with:
7474
components: clippy
@@ -189,8 +189,8 @@ jobs:
189189
- uses: actions/checkout@v3
190190
with:
191191
submodules: true
192-
- name: Install llvm 18
193-
run: brew install llvm@18
192+
- name: Install llvm 19
193+
run: brew install llvm@19
194194
- name: Install riscv64 target
195195
run: rustup target add riscv64imac-unknown-none-elf
196196
- name: Install cargo generate
@@ -228,7 +228,7 @@ jobs:
228228
shell: pwsh
229229
# https://github.com/ScoopInstaller/Install#for-admin
230230
#
231-
# Note that on Windows we cannot choose LLVM 18 here, we have to settle on latest stable LLVM
231+
# Note that on Windows we cannot choose LLVM 19 here, we have to settle on latest stable LLVM
232232
run: |
233233
iex "& {$(irm get.scoop.sh)} -RunAsAdmin"
234234
scoop install llvm yasm
@@ -272,14 +272,14 @@ jobs:
272272
usesh: true
273273
prepare: |
274274
set -ex
275-
pkg install -y llvm18 git gmake bash
275+
pkg install -y llvm19 git gmake bash
276276
curl https://sh.rustup.rs -sSf | sh -s -- -y
277277
. $HOME/.cargo/env
278278
rustup target add riscv64imac-unknown-none-elf
279279
cargo install cargo-generate
280280
run: |
281281
set -ex
282-
. $HOME/.cargo/env
282+
. $HOME/.cargo/env
283283
cargo generate --path . standalone-contract --name test-contract
284284
cd test-contract
285285
gmake build test check clippy

atomics-contract/.cargo-generate/tests.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ fn test_{{crate_name}}() {
1515
// prepare cells
1616
let input_out_point = context.create_cell(
1717
CellOutput::new_builder()
18-
.capacity(1000u64.pack())
18+
.capacity(1000)
1919
.lock(lock_script.clone())
2020
.build(),
2121
Bytes::new(),
@@ -25,11 +25,11 @@ fn test_{{crate_name}}() {
2525
.build();
2626
let outputs = vec![
2727
CellOutput::new_builder()
28-
.capacity(500u64.pack())
28+
.capacity(500)
2929
.lock(lock_script.clone())
3030
.build(),
3131
CellOutput::new_builder()
32-
.capacity(500u64.pack())
32+
.capacity(500)
3333
.lock(lock_script)
3434
.build(),
3535
];

atomics-contract/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[package]
22
name = "{{project-name}}"
33
version = "0.1.0"
4-
edition = "2021"
4+
edition = "2024"
55

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

1010
[build-dependencies]

atomics-contract/build.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ fn main() {
1515
);
1616
build
1717
.file(format!("{top}/deps/lib-dummy-atomics/atomics.c"))
18-
.static_flag(true)
1918
.include(format!("{top}/deps/ckb-c-stdlib"))
2019
.include(format!("{top}/deps/ckb-c-stdlib/libc"))
2120
.no_default_flags(true)

c-wrapper-crate/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "{{project-name}}"
33
version = "0.1.0"
4-
edition = "2021"
4+
edition = "2024"
55

66
[dependencies]
77

c-wrapper-crate/build.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ fn main() {
1515
);
1616
build
1717
.file("c.c")
18-
.static_flag(true)
1918
.include(format!("{top}/deps/ckb-c-stdlib"))
2019
.include(format!("{top}/deps/ckb-c-stdlib/libc"))
2120
.no_default_flags(true)

contract-without-simulator/.cargo-generate/tests.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ fn test_{{crate_name}}() {
1515
// prepare cells
1616
let input_out_point = context.create_cell(
1717
CellOutput::new_builder()
18-
.capacity(1000u64.pack())
18+
.capacity(1000)
1919
.lock(lock_script.clone())
2020
.build(),
2121
Bytes::new(),
@@ -25,11 +25,11 @@ fn test_{{crate_name}}() {
2525
.build();
2626
let outputs = vec![
2727
CellOutput::new_builder()
28-
.capacity(500u64.pack())
28+
.capacity(500)
2929
.lock(lock_script.clone())
3030
.build(),
3131
CellOutput::new_builder()
32-
.capacity(500u64.pack())
32+
.capacity(500)
3333
.lock(lock_script)
3434
.build(),
3535
];
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "{{project-name}}"
33
version = "0.1.0"
4-
edition = "2021"
4+
edition = "2024"
55

66
[dependencies]
7-
ckb-std = "0.17.0"
7+
ckb-std = "1.0"

contract/.cargo-generate/tests.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ fn test_{{crate_name}}() {
1515
// prepare cells
1616
let input_out_point = context.create_cell(
1717
CellOutput::new_builder()
18-
.capacity(1000u64.pack())
18+
.capacity(1000)
1919
.lock(lock_script.clone())
2020
.build(),
2121
Bytes::new(),
@@ -25,11 +25,11 @@ fn test_{{crate_name}}() {
2525
.build();
2626
let outputs = vec![
2727
CellOutput::new_builder()
28-
.capacity(500u64.pack())
28+
.capacity(500)
2929
.lock(lock_script.clone())
3030
.build(),
3131
CellOutput::new_builder()
32-
.capacity(500u64.pack())
32+
.capacity(500)
3333
.lock(lock_script)
3434
.build(),
3535
];

contract/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[package]
22
name = "{{project-name}}"
33
version = "0.1.0"
4-
edition = "2021"
4+
edition = "2024"
55

66
[dependencies]
7-
ckb-std = "0.17.0"
7+
ckb-std = "1.0"
88

99
[features]
1010
library = []

0 commit comments

Comments
 (0)