Skip to content

Commit

Permalink
Merge pull request #491 from classicalliu/replace-secp-lock-cell
Browse files Browse the repository at this point in the history
chore: update lock cell for segwit and address format

Replace `resource/specs/cells/secp256k1_blake2b_lock` to `secp256k1_blake160_sighash_all` for support segwit and [address format](https://github.com/nervosnetwork/ckb/wiki/Common-Address-Format)

BREAKING CHANGE: Testchain spec has changed the system cells, which leads to different genesis block hash.
  • Loading branch information
doitian committed Apr 18, 2019
2 parents 62bcb82 + 0100ba6 commit 364c380
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
Binary file not shown.
2 changes: 1 addition & 1 deletion resource/specs/testnet.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ cycle_length = 12
# An array list paths to system cell files, which is absolute or relative to
# the directory containing this config file.
[[system_cells]]
path = "cells/secp256k1_blake2b_lock"
path = "cells/secp256k1_blake160_sighash_all"
9 changes: 5 additions & 4 deletions resource/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -295,9 +295,9 @@ mod tests {
Some(Resource::Bundled("specs/cells/always_success".into()))
);
assert_eq!(
locator.resolve_relative_to("cells/secp256k1_blake2b_lock".into(), &ckb),
locator.resolve_relative_to("cells/secp256k1_blake160_sighash_all".into(), &ckb),
Some(Resource::Bundled(
"specs/cells/secp256k1_blake2b_lock".into()
"specs/cells/secp256k1_blake160_sighash_all".into()
))
);
assert_eq!(locator.resolve_relative_to("x".into(), &ckb), None);
Expand All @@ -316,9 +316,10 @@ mod tests {
Some(Resource::FileSystem(always_success_path.clone()))
);
assert_eq!(
locator.resolve_relative_to("cells/secp256k1_blake2b_lock".into(), &spec_dev),
locator
.resolve_relative_to("cells/secp256k1_blake160_sighash_all".into(), &spec_dev),
Some(Resource::Bundled(
"specs/cells/secp256k1_blake2b_lock".into()
"specs/cells/secp256k1_blake160_sighash_all".into()
))
);
assert_eq!(locator.resolve_relative_to("x".into(), &spec_dev), None);
Expand Down
2 changes: 1 addition & 1 deletion spec/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ pub mod test {
let data_hash = tx.outputs()[0].data_hash();
assert_eq!(
format!("{:x}", data_hash),
"fe1cf5a297023a3c5282ecd9b0ca88d6736424d75fbe4dcf47a7c8b303e4d339"
"55a809b92c5c404989bfe523639a741f4368ecaa3d4c42d1eb8854445b1b798b"
);
}
}

0 comments on commit 364c380

Please sign in to comment.