Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix exclude unchanged values #574

Merged
merged 1 commit into from
Nov 29, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -10499,6 +10499,18 @@ exports[`run-block > should work 1`] = `
"value": "0xa9aa0200a7ff0f00",
},
},
{
"parsed": {
"key": [],
"method": "transactionLevel",
"section": "substrate",
"value": undefined,
},
"raw": {
"key": "0x3a7472616e73616374696f6e5f6c6576656c3a",
"value": undefined,
},
},
{
"parsed": {
"key": [],
Expand Down Expand Up @@ -13222,12 +13234,36 @@ exports[`run-block > should work 1`] = `
"value": "0x03000000",
},
},
{
"parsed": {
"key": [],
"method": "transactionLevel",
"section": "substrate",
"value": undefined,
},
"raw": {
"key": "0x3a7472616e73616374696f6e5f6c6576656c3a",
"value": undefined,
},
},
],
},
{
"logs": [],
"phase": "Finalization",
"storageDiff": [
{
"parsed": {
"key": [],
"method": "lateness",
"section": "babe",
"value": null,
},
"raw": {
"key": "0x1cb6f36e027abb2091cfb5110ab5087f0323475657e0890fbdbf66fb24b4649e",
"value": undefined,
},
},
{
"parsed": {
"key": [
Expand Down Expand Up @@ -13438,6 +13474,18 @@ exports[`run-block > should work 1`] = `
"value": "0x015cb5774bf1b129e1b575e3e78e4a5c2e7a619b2c0528dcf11c871de874be4af9",
},
},
{
"parsed": {
"key": [],
"method": "initialized",
"section": "babe",
"value": null,
},
"raw": {
"key": "0x1cb6f36e027abb2091cfb5110ab5087ffa92de910a7ce2bd58e99729c69727c1",
"value": undefined,
},
},
{
"parsed": {
"key": [],
Expand Down Expand Up @@ -13477,6 +13525,102 @@ exports[`run-block > should work 1`] = `
"value": undefined,
},
},
{
"parsed": {
"key": [],
"method": "allExtrinsicsLen",
"section": "system",
"value": null,
},
"raw": {
"key": "0x26aa394eea5630e07c48ae0c9558cef7a86da5a932684f199539836fcb8c886f",
"value": undefined,
},
},
{
"parsed": {
"key": [],
"method": "executionPhase",
"section": "system",
"value": null,
},
"raw": {
"key": "0x26aa394eea5630e07c48ae0c9558cef7ff553b5a9862a516939d82b3d3d8661a",
"value": undefined,
},
},
{
"parsed": {
"key": [],
"method": "hasInitialized",
"section": "initializer",
"value": null,
},
"raw": {
"key": "0x31a3a2ce3603138b8b352e8f192ca55ac9e06aebb5bcb51e5f883784b1269289",
"value": undefined,
},
},
{
"parsed": {
"key": [],
"method": "extrinsicIndex",
"section": "substrate",
"value": undefined,
},
"raw": {
"key": "0x3a65787472696e7369635f696e646578",
"value": undefined,
},
},
{
"parsed": {
"key": [],
"method": "intrablockEntropy",
"section": "substrate",
"value": undefined,
},
"raw": {
"key": "0x3a696e747261626c6f636b5f656e74726f7079",
"value": undefined,
},
},
{
"parsed": {
"key": [],
"method": "included",
"section": "paraInherent",
"value": null,
},
"raw": {
"key": "0x42b50b77ef717947e7043bb52127d665e2b2d1966457295060d0b3c7e44dca63",
"value": undefined,
},
},
{
"parsed": {
"key": [],
"method": "author",
"section": "authorship",
"value": null,
},
"raw": {
"key": "0xd57bce545fb382c34570e5dfbf338f5e326d21bc67a4b34023d577585d72bfd7",
"value": undefined,
},
},
{
"parsed": {
"key": [],
"method": "didUpdate",
"section": "timestamp",
"value": null,
},
"raw": {
"key": "0xf0c365c3cf59d671eb72da0e7a4113c4bbd108c4899964f707fdaffb82636065",
"value": undefined,
},
},
],
},
],
Expand Down
3 changes: 2 additions & 1 deletion packages/chopsticks/src/plugins/run-block/rpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ export const rpc = async ({ chain }: Context, [params]: [RunBlockParams]): Promi
const resp = { storageDiff: [] } as Omit<RunBlockResponse['phases'][number], 'phase'>
const raw = result.Call.storageDiff

const previousLayer = newBlock.storage
newBlock.pushStorageLayer().setAll(raw)

for (const [key, value] of raw) {
Expand All @@ -190,7 +191,7 @@ export const rpc = async ({ chain }: Context, [params]: [RunBlockParams]): Promi
continue
}

const oldVal = await parentBlock.get(key)
const oldVal = await previousLayer.get(key, false)
if (value === oldVal) {
continue
}
Expand Down