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

Add force ref flag #18

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

TrueCarry
Copy link

Sometimes after deserialization - serialization procedure transaction gets changed. To avoid it, we store original ref value and use it in serialization stage. This code could be suboptimal, but it helped in my case.
Example:
Original boc:

b5ee9c72410221010006830003b577170dd71789f9a3188326ddbbdd3adb65fc0b954909750c9b93046ec61ed5cf5000026fe7a46a9c55392e3e9726ae00bfebcb314d22337763476dbd3489a212cb83779928b64e06f000026fe7192e15d656605ad0003477940168050401021704604905f5e100187085fb110302006fc9d4a7e04ce1bec8000000000002000000000002195f9a3c3ef09ea3608b434fa955c58e3cf8c5b85257e231b4c001b66b9c6ace45d10cd4009e443aec186a000000000000000000b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008272ee1547b701d5cf2f1f33fa4bb2e4a78438ef86915bdf03c3658825a71447e53867988495ccd16d0fb77a312793f2b4427cc12f1dcdd959f33420716be50ecc2f0201e01d060101df0702b16800e2e1bae2f13f34631064dbb77ba75b6cbf8172a9212ea19372608dd8c3dab9eb00148e6dc6b14398b15df989b304abc51ac22d92938ba5c63f516708c0396c816f505aa811a006e1c01c00004dfcf48d538ccacc0b5be0090801b1178d4519000000000000000053a8e917300801d52089cd68e4b01cccaee1a99987256674665967360b887cde681aaf283849df003aa41139ad1c96039995dc353330e4acce8ccb2ce6c1710f9bcd0355e507093bd053724e031f0201340b0a018708006216e3668030472deb741120610343ded569beae34794f60bdff489894761f250026a36945355d74808d30fec4e57ba44e3d7c6b60e2af2417710b08e26d1af405600b0114ff00f4a413f4bcf2c80b0c0201620e0d001ba0f605da89a1f401f481f481a8610202cb170f0201621110008148020d721ed44d0fa00fa40fa40d43004d31f218210178d4519ba0282107bdd97deba12b1f2e2c5d33f31fa003013a05023c85004fa0258cf1601cf16ccc9ed548020120131200e33b51343e803e903e90350c01f4cffe803e903d010c1458a85492b1c17cb8b04a30bffcb8b0a0822625a02a8005e805ef3cb8b0e0841ef765f7b232c7f2cfd4017e808873c59400f3c5bd00325c60063232c14933c59c3e80b2dab33260103ec01004f214013e809633c58073c5b3327b552003f73b51343e803e903e90350c0234cffe80145468017e903e9014d6f1c1551cdb5c150804d50500f214013e809633c58073c5b33248b232c044bd003d0032c0327e401c1d3232c0b281f2fff274140371c1472c7cb8b0c2be80146a2860822625a020822625a004ad822860822625a028062849f8c3c975c2c070c008e01615140076c200b08e218210d53276db708010c8cb055008cf165004fa0216cb6a12cb1f12cb3fc972fb0093356c21e203c85004fa0258cf1601cf16ccc9ed54000e10491038375f0400705279a018a182107362d09cc8cb1f5230cb3f58fa025007cf165007cf16c9718010c8cb0524cf165006fa0215cb6a14ccc971fb00102410230201201a1801f1f81e99ffd007d2010f801f6a2687d007d207d206a18289b50a9156382f9716094617ff971612a1a21382a1009aa0a01e428027d012c678b00e78b666491646580897a007a00658064907c80383a6465816503e5ffe4e8027d207a0218fd00106ba4e1007971623bc00c646582a804678b387d010be5b589e641900ae8210178d4519c8cb1f19cb3f5007fa0222cf165006cf1625fa025003cf16c95005cc2391729171e25008a813a08208989680aa008208989680a0a014bcf2e2c504c98040fb001023c85004fa0258cf1601cf16ccc9ed540201481c1b00115fa443070baf2e14d800b7420c700925f04e001d0d3030171b095135f03f012e0fa40fa4031fa003171d721fa0031fa003002d31f2182100f8a7ea5ba95313459f00fe0218210178d4519ba9631444403f010e0358210595f07bcba9359f011e05f04840ff2f0801b16801d52089cd68e4b01cccaee1a99987256674665967360b887cde681aaf283849df001c5c375c5e27e68c620c9b76ef74eb6d97f02e552425d4326e4c11bb187b573d505f5e10000634b1b000004dfcf48d5388cacc0b5ac01e02b20f8a7ea5000000000000000053a8e9173008006216e3668030472deb741120610343ded569beae34794f60bdff489894761f25003aa41139ad1c96039995dc353330e4acce8ccb2ce6c1710f9bcd0355e507093be829b92701201f0091801351b4a29aaeba4046987f6272bdd2271ebe35b07157920bb8858471368d7a02b0026ca31398401d4a7cec2bce4b3a96839031f71e3ba311b4de3cc49e8abbc468d96f51108228e0000072b3a2ea

Boc after serialization:

b5ee9c72410221010006830003b577170dd71789f9a3188326ddbbdd3adb65fc0b954909750c9b93046ec61ed5cf5000026fe7a46a9c55392e3e9726ae00bfebcb314d22337763476dbd3489a212cb83779928b64e06f000026fe7192e15d656605ad0003477940168050401021704604905f5e100187085fb110302006fc9d4a7e04ce1bec8000000000002000000000002195f9a3c3ef09ea3608b434fa955c58e3cf8c5b85257e231b4c001b66b9c6ace45d10cd4009e443aec186a000000000000000000b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008272ee1547b701d5cf2f1f33fa4bb2e4a78438ef86915bdf03c3658825a71447e53867988495ccd16d0fb77a312793f2b4427cc12f1dcdd959f33420716be50ecc2f0201e01d060101df0702b16800e2e1bae2f13f34631064dbb77ba75b6cbf8172a9212ea19372608dd8c3dab9eb00148e6dc6b14398b15df989b304abc51ac22d92938ba5c63f516708c0396c816f505aa811a006e1c01c00004dfcf48d538ccacc0b5be0090801b1178d4519000000000000000053a8e917300801d52089cd68e4b01cccaee1a99987256674665967360b887cde681aaf283849df003aa41139ad1c96039995dc353330e4acce8ccb2ce6c1710f9bcd0355e507093bd053724e031f0201340b0a018708006216e3668030472deb741120610343ded569beae34794f60bdff489894761f250026a36945355d74808d30fec4e57ba44e3d7c6b60e2af2417710b08e26d1af405600b0114ff00f4a413f4bcf2c80b0c0201620e0d001ba0f605da89a1f401f481f481a8610202cb170f0201621110008148020d721ed44d0fa00fa40fa40d43004d31f218210178d4519ba0282107bdd97deba12b1f2e2c5d33f31fa003013a05023c85004fa0258cf1601cf16ccc9ed548020120131200e33b51343e803e903e90350c01f4cffe803e903d010c1458a85492b1c17cb8b04a30bffcb8b0a0822625a02a8005e805ef3cb8b0e0841ef765f7b232c7f2cfd4017e808873c59400f3c5bd00325c60063232c14933c59c3e80b2dab33260103ec01004f214013e809633c58073c5b3327b552003f73b51343e803e903e90350c0234cffe80145468017e903e9014d6f1c1551cdb5c150804d50500f214013e809633c58073c5b33248b232c044bd003d0032c0327e401c1d3232c0b281f2fff274140371c1472c7cb8b0c2be80146a2860822625a020822625a004ad822860822625a028062849f8c3c975c2c070c008e01615140076c200b08e218210d53276db708010c8cb055008cf165004fa0216cb6a12cb1f12cb3fc972fb0093356c21e203c85004fa0258cf1601cf16ccc9ed54000e10491038375f0400705279a018a182107362d09cc8cb1f5230cb3f58fa025007cf165007cf16c9718010c8cb0524cf165006fa0215cb6a14ccc971fb00102410230201201a1801f1f81e99ffd007d2010f801f6a2687d007d207d206a18289b50a9156382f9716094617ff971612a1a21382a1009aa0a01e428027d012c678b00e78b666491646580897a007a00658064907c80383a6465816503e5ffe4e8027d207a0218fd00106ba4e1007971623bc00c646582a804678b387d010be5b589e641900ae8210178d4519c8cb1f19cb3f5007fa0222cf165006cf1625fa025003cf16c95005cc2391729171e25008a813a08208989680aa008208989680a0a014bcf2e2c504c98040fb001023c85004fa0258cf1601cf16ccc9ed540201481c1b00115fa443070baf2e14d800b7420c700925f04e001d0d3030171b095135f03f012e0fa40fa4031fa003171d721fa0031fa003002d31f2182100f8a7ea5ba95313459f00fe0218210178d4519ba9631444403f010e0358210595f07bcba9359f011e05f04840ff2f0801b16801d52089cd68e4b01cccaee1a99987256674665967360b887cde681aaf283849df001c5c375c5e27e68c620c9b76ef74eb6d97f02e552425d4326e4c11bb187b573d505f5e10000634b1b000004dfcf48d5388cacc0b5ac01e02b20f8a7ea5000000000000000053a8e9173008006216e3668030472deb741120610343ded569beae34794f60bdff489894761f25003aa41139ad1c96039995dc353330e4acce8ccb2ce6c1710f9bcd0355e507093be829b92701201f0091801351b4a29aaeba4046987f6272bdd2271ebe35b07157920bb8858471368d7a02b0026ca31398401d4a7cec2bce4b3a96839031f71e3ba311b4de3cc49e8abbc468d96f51108228e0000072b3a2ea

Difference:
image

Copy link

@Re2906 Re2906 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0:4818f679ede118884806590b9b705a00fa6aa0cf7009d4b3d128ff263b031c88

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants