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
2 changes: 2 additions & 0 deletions benches/benches/benchmarks/resolve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ pub fn setup_chain(txs_size: usize) -> (Shared, ChainController) {
.map(|_| IssuedCell {
capacity: capacity_bytes!(100_000),
lock: secp_script.clone().into(),
data: None,
type_: None,
})
.collect();

Expand Down
15 changes: 13 additions & 2 deletions spec/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use crate::versionbits::{ActiveMode, Deployment, DeploymentPos};
use ckb_constant::hardfork::{mainnet, testnet};
use ckb_crypto::secp::Privkey;
use ckb_hash::{blake2b_256, new_blake2b};
use ckb_jsonrpc_types::Script;
use ckb_jsonrpc_types::{JsonBytes, Script};
use ckb_pow::{Pow, PowEngine};
use ckb_resource::{
CODE_HASH_DAO, CODE_HASH_SECP256K1_BLAKE160_MULTISIG_ALL,
Expand Down Expand Up @@ -400,6 +400,11 @@ pub struct GenesisCell {
pub struct IssuedCell {
/// The cell capacity
pub capacity: Capacity,
/// The cell data, can be ignored in spec
pub data: Option<JsonBytes>,
/// The cell type script
#[serde(rename = "type")]
pub type_: Option<Script>,
/// The cell lock
pub lock: Script,
}
Expand Down Expand Up @@ -826,7 +831,12 @@ impl ChainSpec {
.iter()
.map(IssuedCell::build_output),
);
outputs_data.extend(self.genesis.issued_cells.iter().map(|_| Bytes::new()));
outputs_data.extend(
self.genesis
.issued_cells
.iter()
.map(|x| x.data.clone().unwrap_or_default().into_bytes()),
);

let script: packed::Script = self.genesis.bootstrap_lock.clone().into();

Expand Down Expand Up @@ -953,6 +963,7 @@ impl IssuedCell {
packed::CellOutput::new_builder()
.lock(self.lock.clone())
.capacity(self.capacity)
.type_(self.type_.clone().map(|x| x.into()))
.build()
}
}
Expand Down
2 changes: 2 additions & 0 deletions test/src/specs/dao/satoshi_dao_occupied.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,5 +154,7 @@ fn issue_satoshi_cell() -> IssuedCell {
IssuedCell {
capacity: SATOSHI_CELL_CAPACITY,
lock: lock.into(),
data: None,
type_: None,
}
}
Loading