Skip to content

Commit

Permalink
refactor: remove first genesis transaction (#1443)
Browse files Browse the repository at this point in the history
  • Loading branch information
yangby-cryptape authored Sep 25, 2023
1 parent 49cdb7c commit 83ea6f2
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 2,446 deletions.
4 changes: 2 additions & 2 deletions core/run/src/components/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ impl ChainSpecExt for ChainSpec {
for (idx, tx) in genesis.txs.iter_mut().enumerate() {
let mut utx = tx.transaction.unsigned.clone();

if idx == 1 {
if idx == 0 {
utx.set_data(data_0.clone().into());
} else if idx == 2 {
} else if idx == 1 {
utx.set_data(data_1.clone().into())
}

Expand Down
12 changes: 6 additions & 6 deletions core/run/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,26 +40,26 @@ const TESTCASES: &[TestCase] = &[
chain_spec_file: "specs/single_node/chain-spec.toml",
key_file: "debug.key",
input_genesis_hash: "0x4e06dc4a01178db42c029f7d65f65a5763702a21082cfcb626c6c41054a7a276",
genesis_state_root: "0x601bd874d41eb9adb32021ee3ab934e0481065c58abfe7e757e33fb01be18dd5",
genesis_receipts_root: "0x8544b530238201f1620b139861a6841040b37f78f8bdae8736ef5cec474e979b",
genesis_state_root: "0xb6c51706f77a788606c8b932ad4f752c3f9a54008cd82e85f417d3a7e900d5c2",
genesis_receipts_root: "0x7e747618f612d08dfe54bcb67f58f13a49e8b1bafee9a8f19a3a0f7122f44d02",
},
TestCase {
chain_name: "multi_nodes",
config_file: "nodes/node_1.toml",
chain_spec_file: "specs/multi_nodes/chain-spec.toml",
key_file: "debug.key",
input_genesis_hash: "0xf16db25ca1a0cff5339d76e9802c75c43faac35ee4a9294a51234b167c69159f",
genesis_state_root: "0xc36f75519a047fec6a34c7be5dfca783a40eafa0d7418ad7b3ba99ad9c2dc655",
genesis_receipts_root: "0x8544b530238201f1620b139861a6841040b37f78f8bdae8736ef5cec474e979b",
genesis_state_root: "0x9f76f02e823115e7b9887d07678f40b8ff50f82d4d09214fa481bdad68f5192a",
genesis_receipts_root: "0x7e747618f612d08dfe54bcb67f58f13a49e8b1bafee9a8f19a3a0f7122f44d02",
},
TestCase {
chain_name: "multi_nodes_short_epoch_len",
config_file: "nodes/node_1.toml",
chain_spec_file: "specs/multi_nodes_short_epoch_len/chain-spec.toml",
key_file: "debug.key",
input_genesis_hash: "0x4e06dc4a01178db42c029f7d65f65a5763702a21082cfcb626c6c41054a7a276",
genesis_state_root: "0x42886558baab8a3c310d5a8313398e5f353cc4f8192838b578c857a329e9bb65",
genesis_receipts_root: "0x8544b530238201f1620b139861a6841040b37f78f8bdae8736ef5cec474e979b",
genesis_state_root: "0x9dddf9df077b2bb98f72686256dae92fb975d416fa3093956151056b913a065d",
genesis_receipts_root: "0x7e747618f612d08dfe54bcb67f58f13a49e8b1bafee9a8f19a3a0f7122f44d02",
},
];

Expand Down
5 changes: 2 additions & 3 deletions devtools/chain/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# The meaning of each transactions in Genesis.json
1. `nonce = 0` means: Creation wCKB contract
2. `nonce = 1` means: Append the metadata of epoch 0
3. `nonce = 2` means: Append the metadata of epoch 1
1. `nonce = 0` means: Append the metadata of epoch 0
2. `nonce = 1` means: Append the metadata of epoch 1
804 changes: 1 addition & 803 deletions devtools/chain/specs/multi_nodes/genesis_transactions.json

Large diffs are not rendered by default.

Large diffs are not rendered by default.

828 changes: 1 addition & 827 deletions devtools/chain/specs/single_node/genesis_transactions.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions tests/e2e/src/eth_feeHistory.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ describe("eth_feeHistory", () => {
baseFeePerGas: ["0x539", "0x539"],
gasUsedRatio: [0],
oldestBlock: "0x0",
reward: [["0x24f304", "0x0"]],
reward: [["0x0", "0x0"]],
});
}, 100000);

Expand Down Expand Up @@ -79,7 +79,7 @@ describe("eth_feeHistory", () => {
baseFeePerGas: ["0x539", "0x539"],
gasUsedRatio: [0],
oldestBlock: "0x0",
reward: [["0x24f304", "0x0"]],
reward: [["0x0", "0x0"]],
});
}, 100000);
});

0 comments on commit 83ea6f2

Please sign in to comment.