Skip to content

Latest commit

 

History

History
104 lines (74 loc) · 2.49 KB

File metadata and controls

104 lines (74 loc) · 2.49 KB

capsule_bytes_inconsistent_length

Executing these tests on Capsule 0.9.0 with rustc 1.63.0 exhibits the following behavior.

From Lumos JavaScript:

{
    codeHash: DATA_FILE_HASH_1,
    hashType: "data1",
    args: "0x"
};

But then from the rust code:

debug!("script.args().len(): {:#?}", script.args().len());
debug!("script.args().as_slice().len(): {:#?}", script.args().as_slice().len());

And the output is:

script.args().len(): 0
script.args().as_slice().len(): 4

Setup

Environment Setup

  1. Install Git
  2. Install Node.js 16 LTS
  3. Download latest ckb (Portable), tested with ckb 0.109.0
  4. Extract the ckb compressed folder and renamed it to ~/ckb

Devchain configuration

This is section takes material from both Nervos devchain guide and Ian instructions.

From within ~/ckb:

  1. Init devchain:
ckb init --chain dev
  1. In the ckb.toml file under the [block_assembler] section set:
[block_assembler]
code_hash = "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8"
args = "0xc8328aabcd9b9e8e64fbc566c4385c3bdeb219d7" # ckt1...gwga account
hash_type = "type"
message = "0x"
  1. In the ckb.toml file under the [block_assembler] section set:
[logger]
filter = "info,ckb-script=debug"# instead of "info"
# Other parameters...
  1. In the specs/dev.toml file under the [params] section set:
[params]
# Other parameters...
epoch_duration_target = 2 # instead of 14400
genesis_epoch_length = 2 # instead of 1000
permanent_difficulty_in_dummy = true
  1. In the miner-ckb.toml file under the [[miner.workers]] section set:
[[miner.workers]]
# Other parameters...
value = 200 # instead of 5000

Configure project with local devchain

  1. Download this repo in a folder of your choice:
git clone https://github.com/ickb/capsule_len_error.git
  1. Enter into the repo:
cd capsule_len_error
  1. Run runner:
./runner.sh