From 96743bfe03ac1c5a62eb7dd30cef6d343407ed90 Mon Sep 17 00:00:00 2001 From: Gusarich Date: Fri, 25 Oct 2024 09:42:47 +0400 Subject: [PATCH 1/9] fix: use `BigVarUint` ts function for coins map value serizaliation type --- src/bindings/typescript/serializers.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/bindings/typescript/serializers.ts b/src/bindings/typescript/serializers.ts index ef9c46311..2f23a8583 100644 --- a/src/bindings/typescript/serializers.ts +++ b/src/bindings/typescript/serializers.ts @@ -620,6 +620,7 @@ type MapSerializerDescrKey = | { kind: "address" }; type MapSerializerDescrValue = | { kind: "int" | "uint"; bits: number } + | { kind: "varuint"; length: number } | { kind: "boolean" } | { kind: "address" } | { kind: "cell" } @@ -665,6 +666,9 @@ function getValueParser(src: MapSerializerDescrValue) { return `Dictionary.Values.BigUint(${src.bits})`; } } + case "varuint": { + return `Dictionary.Values.BigVarUint(${src.length})`; + } case "address": { return "Dictionary.Values.Address()"; } @@ -739,7 +743,7 @@ const map: Serializer = { ) { value = { kind: "uint", bits: 256 }; } else if (src.valueFormat === "coins") { - value = { kind: "uint", bits: 124 }; + value = { kind: "varuint", length: 4 }; } } if (src.value === "address") { @@ -809,6 +813,10 @@ const map: Serializer = { } } break; + case "varuint": { + valueT = `bigint`; + break; + } case "boolean": { valueT = `boolean`; From a242fabea63a1f734c86ddd46e42629d16f5e142 Mon Sep 17 00:00:00 2001 From: Gusarich Date: Fri, 25 Oct 2024 09:44:20 +0400 Subject: [PATCH 2/9] chore: update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a2183371..dbc2f87b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - The `SendDefaultMode` send mode constant to the standard library: PR [#1010](https://github.com/tact-lang/tact/pull/1010) - Docs: initial semi-automated Chinese translation of the documentation: PR [#942](https://github.com/tact-lang/tact/pull/942) - The `replace` and `replaceGet` methods for the `Map` type: PR [#941](https://github.com/tact-lang/tact/pull/941) +- `as coins` map value serialization type is now handled correctly in generated TypeScript bindings: PR [#987](https://github.com/tact-lang/tact/pull/987) ### Changed From 97368489927c2383278c3f9e6f8cea880433d59e Mon Sep 17 00:00:00 2001 From: Gusarich Date: Sat, 2 Nov 2024 10:17:17 +0400 Subject: [PATCH 3/9] feat: `coins` value type func codegen --- src/abi/map.ts | 16 ++++++++ src/generator/writers/writeStdlib.ts | 55 ++++++++++++++++++++++++---- 2 files changed, 64 insertions(+), 7 deletions(-) diff --git a/src/abi/map.ts b/src/abi/map.ts index bc44095cc..23370bcb1 100644 --- a/src/abi/map.ts +++ b/src/abi/map.ts @@ -160,6 +160,10 @@ export const MapFunctions: Map = new Map([ } else if (self.valueAs?.startsWith("uint")) { vBits = parseInt(self.valueAs.slice(4), 10); vKind = "uint"; + } else if (self.valueAs?.startsWith("coins")) { + vKind = "coins"; + ctx.used(`__tact_dict_set_${kind}_${vKind}`); + return `${resolved[0]}~__tact_dict_set_${kind}_${vKind}(${bits}, ${resolved[1]}, ${resolved[2]})`; } ctx.used(`__tact_dict_set_${kind}_${vKind}`); return `${resolved[0]}~__tact_dict_set_${kind}_${vKind}(${bits}, ${resolved[1]}, ${resolved[2]}, ${vBits})`; @@ -226,6 +230,10 @@ export const MapFunctions: Map = new Map([ } else if (self.valueAs?.startsWith("uint")) { vBits = parseInt(self.valueAs.slice(4), 10); vKind = "uint"; + } else if (self.valueAs?.startsWith("coins")) { + vKind = "coins"; + ctx.used(`__tact_dict_get_${kind}_${vKind}`); + return `__tact_dict_get_${kind}_${vKind}(${resolved[0]}, ${bits}, ${resolved[1]})`; } ctx.used(`__tact_dict_get_${kind}_${vKind}`); return `__tact_dict_get_${kind}_${vKind}(${resolved[0]}, ${bits}, ${resolved[1]}, ${vBits})`; @@ -571,6 +579,10 @@ export const MapFunctions: Map = new Map([ } else if (self.valueAs?.startsWith("uint")) { vBits = parseInt(self.valueAs.slice(4), 10); vKind = "uint"; + } else if (self.valueAs?.startsWith("coins")) { + vKind = "coins"; + ctx.used(`__tact_dict_replace_${kind}_${vKind}`); + return `${resolved[0]}~__tact_dict_replace_${kind}_${vKind}(${bits}, ${resolved[1]}, ${resolved[2]})`; } ctx.used(`__tact_dict_replace_${kind}_${vKind}`); return `${resolved[0]}~__tact_dict_replace_${kind}_${vKind}(${bits}, ${resolved[1]}, ${resolved[2]}, ${vBits})`; @@ -649,6 +661,10 @@ export const MapFunctions: Map = new Map([ } else if (self.valueAs?.startsWith("uint")) { vBits = parseInt(self.valueAs.slice(4), 10); vKind = "uint"; + } else if (self.valueAs?.startsWith("coins")) { + vKind = "coins"; + ctx.used(`__tact_dict_replaceget_${kind}_${vKind}`); + return `${resolved[0]}~__tact_dict_replaceget_${kind}_${vKind}(${bits}, ${resolved[1]}, ${resolved[2]})`; } ctx.used(`__tact_dict_replaceget_${kind}_${vKind}`); return `${resolved[0]}~__tact_dict_replaceget_${kind}_${vKind}(${bits}, ${resolved[1]}, ${resolved[2]}, ${vBits})`; diff --git a/src/generator/writers/writeStdlib.ts b/src/generator/writers/writeStdlib.ts index 5ca630c6d..69833fd1a 100644 --- a/src/generator/writers/writeStdlib.ts +++ b/src/generator/writers/writeStdlib.ts @@ -1152,7 +1152,7 @@ export function writeStdlib(ctx: WriterContext): void { const keyTypes = ["slice", "uint", "int"] as const; type KeyType = (typeof keyTypes)[number]; -const valTypes = ["slice", "int", "uint", "cell"] as const; +const valTypes = ["slice", "int", "uint", "cell", "coins"] as const; type ValType = (typeof valTypes)[number]; function genTactDictGet( @@ -1161,7 +1161,8 @@ function genTactDictGet( value: ValType, ): void { const signatureKeyType = key === "uint" ? "int" : key; - const signatureRetType = value === "uint" ? "int" : value; + const signatureRetType = + value === "uint" || value === "coins" ? "int" : value; const dictGet = () => { const cellSuffix = value === "cell" ? "_ref" : ""; switch (key) { @@ -1182,12 +1183,15 @@ function genTactDictGet( return "r~load_uint(vl)"; case "int": return "r~load_int(vl)"; + case "coins": + return "r~load_coins()"; } }; const valBitsArg = () => { switch (value) { case "slice": case "cell": + case "coins": return ""; case "uint": case "int": @@ -1246,11 +1250,13 @@ function genTactDictSet( value: ValType, ): void { const signatureKeyType = key === "uint" ? "int" : key; - const signatureValueType = value === "uint" ? "int" : value; + const signatureValueType = + value === "uint" || value === "coins" ? "int" : value; const valBitsArg = () => { switch (value) { case "slice": case "cell": + case "coins": return ""; case "uint": case "int": @@ -1273,14 +1279,20 @@ function genTactDictSet( return "(idict_set_builder(d, kl, k, begin_cell().store_int(v, vl)), ())"; case "int:uint": return "(idict_set_builder(d, kl, k, begin_cell().store_uint(v, vl)), ())"; + case "int:coins": + return "(idict_set_builder(d, kl, k, begin_cell().store_coins(v)), ())"; case "uint:int": return "(udict_set_builder(d, kl, k, begin_cell().store_int(v, vl)), ())"; case "uint:uint": return "(udict_set_builder(d, kl, k, begin_cell().store_uint(v, vl)), ())"; + case "uint:coins": + return "(udict_set_builder(d, kl, k, begin_cell().store_coins(v)), ())"; case "slice:int": return "(dict_set_builder(d, kl, k, begin_cell().store_int(v, vl)), ())"; case "slice:uint": return "(dict_set_builder(d, kl, k, begin_cell().store_uint(v, vl)), ())"; + case "slice:coins": + return "(dict_set_builder(d, kl, k, begin_cell().store_coins(v)), ())"; case "int:cell": return "(idict_set_ref(d, kl, k, v), ())"; case "uint:cell": @@ -1324,11 +1336,13 @@ function genTactDictGetMin( value: ValType, ): void { const signatureKeyType = key === "uint" ? "int" : key; - const signatureValType = value === "uint" ? "int" : value; + const signatureValType = + value === "uint" || value === "coins" ? "int" : value; const valBitsArg = () => { switch (value) { case "slice": case "cell": + case "coins": return ""; case "uint": case "int": @@ -1339,14 +1353,17 @@ function genTactDictGetMin( switch (`${key}:${value}`) { case "int:int": case "int:uint": + case "int:coins": case "int:slice": return "idict_get_min?"; case "uint:int": case "uint:uint": + case "uint:coins": case "uint:slice": return "udict_get_min?"; case "slice:int": case "slice:uint": + case "slice:coins": case "slice:slice": return ctx.used("__tact_dict_min"); case "int:cell": @@ -1367,6 +1384,8 @@ function genTactDictGetMin( return "value~load_int(vl)"; case "uint": return "value~load_uint(vl)"; + case "coins": + return "value~load_coins()"; case "slice": case "cell": return "value"; @@ -1397,11 +1416,13 @@ function genTactDictGetNext( value: ValType, ): void { const signatureKeyType = key === "uint" ? "int" : key; - const signatureValType = value === "uint" ? "int" : value; + const signatureValType = + value === "uint" || value === "coins" ? "int" : value; const valBitsArg = () => { switch (value) { case "slice": case "cell": + case "coins": return ""; case "uint": case "int": @@ -1424,6 +1445,8 @@ function genTactDictGetNext( return "value~load_int(vl)"; case "uint": return "value~load_uint(vl)"; + case "coins": + return "value~load_coins()"; case "slice": return "value"; case "cell": @@ -1461,11 +1484,13 @@ function genTactDictReplace( value: ValType, ): void { const signatureKeyType = key === "uint" ? "int" : key; - const signatureValueType = value === "uint" ? "int" : value; + const signatureValueType = + value === "uint" || value === "coins" ? "int" : value; const valBitsArg = () => { switch (value) { case "slice": case "cell": + case "coins": return ""; case "uint": case "int": @@ -1488,14 +1513,20 @@ function genTactDictReplace( return "idict_replace_builder?(d, kl, k, begin_cell().store_int(v, vl))"; case "int:uint": return "idict_replace_builder?(d, kl, k, begin_cell().store_uint(v, vl))"; + case "int:coins": + return "idict_replace_builder?(d, kl, k, begin_cell().store_coins(v))"; case "uint:int": return "udict_replace_builder?(d, kl, k, begin_cell().store_int(v, vl))"; case "uint:uint": return "udict_replace_builder?(d, kl, k, begin_cell().store_uint(v, vl))"; + case "uint:coins": + return "udict_replace_builder?(d, kl, k, begin_cell().store_coins(v))"; case "slice:int": return "dict_replace_builder?(d, kl, k, begin_cell().store_int(v, vl))"; case "slice:uint": return "dict_replace_builder?(d, kl, k, begin_cell().store_uint(v, vl))"; + case "slice:coins": + return "dict_replace_builder?(d, kl, k, begin_cell().store_coins(v))"; case "int:cell": return "idict_replace_ref?(d, kl, k, v)"; case "uint:cell": @@ -1539,11 +1570,13 @@ function genTactDictReplaceGet( value: ValType, ): void { const signatureKeyType = key === "uint" ? "int" : key; - const signatureValueType = value === "uint" ? "int" : value; + const signatureValueType = + value === "uint" || value === "coins" ? "int" : value; const valBitsArg = () => { switch (value) { case "slice": case "cell": + case "coins": return ""; case "uint": case "int": @@ -1567,14 +1600,20 @@ function genTactDictReplaceGet( return "d~idict_replaceget?(kl, k, begin_cell().store_int(v, vl).end_cell().begin_parse())"; case "int:uint": return "d~idict_replaceget?(kl, k, begin_cell().store_uint(v, vl).end_cell().begin_parse())"; + case "int:coins": + return "d~idict_replaceget?(kl, k, begin_cell().store_coins(v).end_cell().begin_parse())"; case "uint:int": return "d~udict_replaceget?(kl, k, begin_cell().store_int(v, vl).end_cell().begin_parse())"; case "uint:uint": return "d~udict_replaceget?(kl, k, begin_cell().store_uint(v, vl).end_cell().begin_parse())"; + case "uint:coins": + return "d~udict_replaceget?(kl, k, begin_cell().store_coins(v).end_cell().begin_parse())"; case "slice:int": return "d~dict_replaceget?(kl, k, begin_cell().store_int(v, vl).end_cell().begin_parse())"; case "slice:uint": return "d~dict_replaceget?(kl, k, begin_cell().store_uint(v, vl).end_cell().begin_parse())"; + case "slice:coins": + return "d~dict_replaceget?(kl, k, begin_cell().store_coins(v).end_cell().begin_parse())"; case "int:cell": return "d~idict_replaceget_ref?(kl, k, v)"; case "uint:cell": @@ -1602,6 +1641,8 @@ function genTactDictReplaceGet( return "old~load_uint(vl)"; case "int": return "old~load_int(vl)"; + case "coins": + return "old~load_coins()"; } }; ctx.fun(`__tact_dict_replaceget_${key}_${value}`, () => { From c0b69d3f7fddf139e7858643029b92cfbd512441 Mon Sep 17 00:00:00 2001 From: Gusarich Date: Sat, 2 Nov 2024 10:17:34 +0400 Subject: [PATCH 4/9] feat: tests --- src/test/e2e-emulated/contracts/maps.tact | 141 ++++++++++++++++++++++ src/test/e2e-emulated/map.spec.ts | 18 +++ 2 files changed, 159 insertions(+) diff --git a/src/test/e2e-emulated/contracts/maps.tact b/src/test/e2e-emulated/contracts/maps.tact index 64ddf2f8e..2fb55bddc 100644 --- a/src/test/e2e-emulated/contracts/maps.tact +++ b/src/test/e2e-emulated/contracts/maps.tact @@ -20,6 +20,7 @@ struct GetAllMapsResult { int_uint8: Int?; int_uint42: Int?; int_uint256: Int?; + int_coins: Int?; int_bool: Bool?; int_cell: Cell?; int_address: Address?; @@ -32,6 +33,7 @@ struct GetAllMapsResult { int8_uint8: Int?; int8_uint42: Int?; int8_uint256: Int?; + int8_coins: Int?; int8_bool: Bool?; int8_cell: Cell?; int8_address: Address?; @@ -44,6 +46,7 @@ struct GetAllMapsResult { int42_uint8: Int?; int42_uint42: Int?; int42_uint256: Int?; + int42_coins: Int?; int42_bool: Bool?; int42_cell: Cell?; int42_address: Address?; @@ -56,6 +59,7 @@ struct GetAllMapsResult { int256_uint8: Int?; int256_uint42: Int?; int256_uint256: Int?; + int256_coins: Int?; int256_bool: Bool?; int256_cell: Cell?; int256_address: Address?; @@ -68,6 +72,7 @@ struct GetAllMapsResult { uint8_uint8: Int?; uint8_uint42: Int?; uint8_uint256: Int?; + uint8_coins: Int?; uint8_bool: Bool?; uint8_cell: Cell?; uint8_address: Address?; @@ -80,6 +85,7 @@ struct GetAllMapsResult { uint42_uint8: Int?; uint42_uint42: Int?; uint42_uint256: Int?; + uint42_coins: Int?; uint42_bool: Bool?; uint42_cell: Cell?; uint42_address: Address?; @@ -92,6 +98,7 @@ struct GetAllMapsResult { uint256_uint8: Int?; uint256_uint42: Int?; uint256_uint256: Int?; + uint256_coins: Int?; uint256_bool: Bool?; uint256_cell: Cell?; uint256_address: Address?; @@ -105,6 +112,7 @@ struct GetAllMapsResult { address_uint8: Int?; address_uint42: Int?; address_uint256: Int?; + address_coins: Int?; address_bool: Bool?; address_cell: Cell?; address_address: Address?; @@ -120,6 +128,7 @@ struct ReplaceAllMapsResult { int_uint8: Bool; int_uint42: Bool; int_uint256: Bool; + int_coins: Bool; int_bool: Bool; int_cell: Bool; int_address: Bool; @@ -132,6 +141,7 @@ struct ReplaceAllMapsResult { int8_uint8: Bool; int8_uint42: Bool; int8_uint256: Bool; + int8_coins: Bool; int8_bool: Bool; int8_cell: Bool; int8_address: Bool; @@ -144,6 +154,7 @@ struct ReplaceAllMapsResult { int42_uint8: Bool; int42_uint42: Bool; int42_uint256: Bool; + int42_coins: Bool; int42_bool: Bool; int42_cell: Bool; int42_address: Bool; @@ -156,6 +167,7 @@ struct ReplaceAllMapsResult { int256_uint8: Bool; int256_uint42: Bool; int256_uint256: Bool; + int256_coins: Bool; int256_bool: Bool; int256_cell: Bool; int256_address: Bool; @@ -168,6 +180,7 @@ struct ReplaceAllMapsResult { uint8_uint8: Bool; uint8_uint42: Bool; uint8_uint256: Bool; + uint8_coins: Bool; uint8_bool: Bool; uint8_cell: Bool; uint8_address: Bool; @@ -180,6 +193,7 @@ struct ReplaceAllMapsResult { uint42_uint8: Bool; uint42_uint42: Bool; uint42_uint256: Bool; + uint42_coins: Bool; uint42_bool: Bool; uint42_cell: Bool; uint42_address: Bool; @@ -192,6 +206,7 @@ struct ReplaceAllMapsResult { uint256_uint8: Bool; uint256_uint42: Bool; uint256_uint256: Bool; + uint256_coins: Bool; uint256_bool: Bool; uint256_cell: Bool; uint256_address: Bool; @@ -205,6 +220,7 @@ struct ReplaceAllMapsResult { address_uint8: Bool; address_uint42: Bool; address_uint256: Bool; + address_coins: Bool; address_bool: Bool; address_cell: Bool; address_address: Bool; @@ -220,6 +236,7 @@ struct ReplaceGetAllMapsResult { int_uint8: Int?; int_uint42: Int?; int_uint256: Int?; + int_coins: Int?; int_bool: Bool?; int_cell: Cell?; int_address: Address?; @@ -232,6 +249,7 @@ struct ReplaceGetAllMapsResult { int8_uint8: Int?; int8_uint42: Int?; int8_uint256: Int?; + int8_coins: Int?; int8_bool: Bool?; int8_cell: Cell?; int8_address: Address?; @@ -244,6 +262,7 @@ struct ReplaceGetAllMapsResult { int42_uint8: Int?; int42_uint42: Int?; int42_uint256: Int?; + int42_coins: Int?; int42_bool: Bool?; int42_cell: Cell?; int42_address: Address?; @@ -256,6 +275,7 @@ struct ReplaceGetAllMapsResult { int256_uint8: Int?; int256_uint42: Int?; int256_uint256: Int?; + int256_coins: Int?; int256_bool: Bool?; int256_cell: Cell?; int256_address: Address?; @@ -268,6 +288,7 @@ struct ReplaceGetAllMapsResult { uint8_uint8: Int?; uint8_uint42: Int?; uint8_uint256: Int?; + uint8_coins: Int?; uint8_bool: Bool?; uint8_cell: Cell?; uint8_address: Address?; @@ -280,6 +301,7 @@ struct ReplaceGetAllMapsResult { uint42_uint8: Int?; uint42_uint42: Int?; uint42_uint256: Int?; + uint42_coins: Int?; uint42_bool: Bool?; uint42_cell: Cell?; uint42_address: Address?; @@ -292,6 +314,7 @@ struct ReplaceGetAllMapsResult { uint256_uint8: Int?; uint256_uint42: Int?; uint256_uint256: Int?; + uint256_coins: Int?; uint256_bool: Bool?; uint256_cell: Cell?; uint256_address: Address?; @@ -305,6 +328,7 @@ struct ReplaceGetAllMapsResult { address_uint8: Int?; address_uint42: Int?; address_uint256: Int?; + address_coins: Int?; address_bool: Bool?; address_cell: Cell?; address_address: Address?; @@ -320,6 +344,7 @@ struct ExistsAllMapsResult { int_uint8: Bool; int_uint42: Bool; int_uint256: Bool; + int_coins: Bool; int_bool: Bool; int_cell: Bool; int_address: Bool; @@ -332,6 +357,7 @@ struct ExistsAllMapsResult { int8_uint8: Bool; int8_uint42: Bool; int8_uint256: Bool; + int8_coins: Bool; int8_bool: Bool; int8_cell: Bool; int8_address: Bool; @@ -344,6 +370,7 @@ struct ExistsAllMapsResult { int42_uint8: Bool; int42_uint42: Bool; int42_uint256: Bool; + int42_coins: Bool; int42_bool: Bool; int42_cell: Bool; int42_address: Bool; @@ -356,6 +383,7 @@ struct ExistsAllMapsResult { int256_uint8: Bool; int256_uint42: Bool; int256_uint256: Bool; + int256_coins: Bool; int256_bool: Bool; int256_cell: Bool; int256_address: Bool; @@ -368,6 +396,7 @@ struct ExistsAllMapsResult { uint8_uint8: Bool; uint8_uint42: Bool; uint8_uint256: Bool; + uint8_coins: Bool; uint8_bool: Bool; uint8_cell: Bool; uint8_address: Bool; @@ -380,6 +409,7 @@ struct ExistsAllMapsResult { uint42_uint8: Bool; uint42_uint42: Bool; uint42_uint256: Bool; + uint42_coins: Bool; uint42_bool: Bool; uint42_cell: Bool; uint42_address: Bool; @@ -392,6 +422,7 @@ struct ExistsAllMapsResult { uint256_uint8: Bool; uint256_uint42: Bool; uint256_uint256: Bool; + uint256_coins: Bool; uint256_bool: Bool; uint256_cell: Bool; uint256_address: Bool; @@ -405,6 +436,7 @@ struct ExistsAllMapsResult { address_uint8: Bool; address_uint42: Bool; address_uint256: Bool; + address_coins: Bool; address_bool: Bool; address_cell: Bool; address_address: Bool; @@ -420,6 +452,7 @@ struct IsEmptyAllMapsResult { int_uint8: Bool; int_uint42: Bool; int_uint256: Bool; + int_coins: Bool; int_bool: Bool; int_cell: Bool; int_address: Bool; @@ -432,6 +465,7 @@ struct IsEmptyAllMapsResult { int8_uint8: Bool; int8_uint42: Bool; int8_uint256: Bool; + int8_coins: Bool; int8_bool: Bool; int8_cell: Bool; int8_address: Bool; @@ -444,6 +478,7 @@ struct IsEmptyAllMapsResult { int42_uint8: Bool; int42_uint42: Bool; int42_uint256: Bool; + int42_coins: Bool; int42_bool: Bool; int42_cell: Bool; int42_address: Bool; @@ -456,6 +491,7 @@ struct IsEmptyAllMapsResult { int256_uint8: Bool; int256_uint42: Bool; int256_uint256: Bool; + int256_coins: Bool; int256_bool: Bool; int256_cell: Bool; int256_address: Bool; @@ -468,6 +504,7 @@ struct IsEmptyAllMapsResult { uint8_uint8: Bool; uint8_uint42: Bool; uint8_uint256: Bool; + uint8_coins: Bool; uint8_bool: Bool; uint8_cell: Bool; uint8_address: Bool; @@ -480,6 +517,7 @@ struct IsEmptyAllMapsResult { uint42_uint8: Bool; uint42_uint42: Bool; uint42_uint256: Bool; + uint42_coins: Bool; uint42_bool: Bool; uint42_cell: Bool; uint42_address: Bool; @@ -492,6 +530,7 @@ struct IsEmptyAllMapsResult { uint256_uint8: Bool; uint256_uint42: Bool; uint256_uint256: Bool; + uint256_coins: Bool; uint256_bool: Bool; uint256_cell: Bool; uint256_address: Bool; @@ -505,6 +544,7 @@ struct IsEmptyAllMapsResult { address_uint8: Bool; address_uint42: Bool; address_uint256: Bool; + address_coins: Bool; address_bool: Bool; address_cell: Bool; address_address: Bool; @@ -520,6 +560,7 @@ struct AsCellAllMapsResult { int_uint8: Cell?; int_uint42: Cell?; int_uint256: Cell?; + int_coins: Cell?; int_bool: Cell?; int_cell: Cell?; int_address: Cell?; @@ -532,6 +573,7 @@ struct AsCellAllMapsResult { int8_uint8: Cell?; int8_uint42: Cell?; int8_uint256: Cell?; + int8_coins: Cell?; int8_bool: Cell?; int8_cell: Cell?; int8_address: Cell?; @@ -544,6 +586,7 @@ struct AsCellAllMapsResult { int42_uint8: Cell?; int42_uint42: Cell?; int42_uint256: Cell?; + int42_coins: Cell?; int42_bool: Cell?; int42_cell: Cell?; int42_address: Cell?; @@ -556,6 +599,7 @@ struct AsCellAllMapsResult { int256_uint8: Cell?; int256_uint42: Cell?; int256_uint256: Cell?; + int256_coins: Cell?; int256_bool: Cell?; int256_cell: Cell?; int256_address: Cell?; @@ -568,6 +612,7 @@ struct AsCellAllMapsResult { uint8_uint8: Cell?; uint8_uint42: Cell?; uint8_uint256: Cell?; + uint8_coins: Cell?; uint8_bool: Cell?; uint8_cell: Cell?; uint8_address: Cell?; @@ -580,6 +625,7 @@ struct AsCellAllMapsResult { uint42_uint8: Cell?; uint42_uint42: Cell?; uint42_uint256: Cell?; + uint42_coins: Cell?; uint42_bool: Cell?; uint42_cell: Cell?; uint42_address: Cell?; @@ -592,6 +638,7 @@ struct AsCellAllMapsResult { uint256_uint8: Cell?; uint256_uint42: Cell?; uint256_uint256: Cell?; + uint256_coins: Cell?; uint256_bool: Cell?; uint256_cell: Cell?; uint256_address: Cell?; @@ -605,6 +652,7 @@ struct AsCellAllMapsResult { address_uint8: Cell?; address_uint42: Cell?; address_uint256: Cell?; + address_coins: Cell?; address_bool: Cell?; address_cell: Cell?; address_address: Cell?; @@ -634,6 +682,7 @@ message SetAllMaps { valueUint8: Int?; valueUint42: Int?; valueUint256: Int?; + valueCoins: Int?; valueBool: Bool?; valueCell: Cell?; valueAddress: Address?; @@ -671,6 +720,7 @@ message ReplaceAllMaps { valueUint8: Int?; valueUint42: Int?; valueUint256: Int?; + valueCoins: Int?; valueBool: Bool?; valueCell: Cell?; valueAddress: Address?; @@ -696,6 +746,7 @@ message ReplaceGetAllMaps { valueUint8: Int?; valueUint42: Int?; valueUint256: Int?; + valueCoins: Int?; valueBool: Bool?; valueCell: Cell?; valueAddress: Address?; @@ -724,6 +775,7 @@ contract MapTestContract { int_uint8: map; int_uint42: map; int_uint256: map; + int_coins: map; int_bool: map; int_cell: map; int_address: map; @@ -740,6 +792,7 @@ contract MapTestContract { int8_uint8: map; int8_uint42: map; int8_uint256: map; + int8_coins: map; int8_bool: map; int8_cell: map; int8_address: map; @@ -756,6 +809,7 @@ contract MapTestContract { int42_uint8: map; int42_uint42: map; int42_uint256: map; + int42_coins: map; int42_bool: map; int42_cell: map; int42_address: map; @@ -772,6 +826,7 @@ contract MapTestContract { int256_uint8: map; int256_uint42: map; int256_uint256: map; + int256_coins: map; int256_bool: map; int256_cell: map; int256_address: map; @@ -788,6 +843,7 @@ contract MapTestContract { uint8_uint8: map; uint8_uint42: map; uint8_uint256: map; + uint8_coins: map; uint8_bool: map; uint8_cell: map; uint8_address: map; @@ -804,6 +860,7 @@ contract MapTestContract { uint42_uint8: map; uint42_uint42: map; uint42_uint256: map; + uint42_coins: map; uint42_bool: map; uint42_cell: map; uint42_address: map; @@ -820,6 +877,7 @@ contract MapTestContract { uint256_uint8: map; uint256_uint42: map; uint256_uint256: map; + uint256_coins: map; uint256_bool: map; uint256_cell: map; uint256_address: map; @@ -836,6 +894,7 @@ contract MapTestContract { address_uint8: map; address_uint42: map; address_uint256: map; + address_coins: map; address_bool: map; address_cell: map; address_address: map; @@ -854,6 +913,7 @@ contract MapTestContract { self.int_uint8.set(msg.keyInt, msg.valueUint8); self.int_uint42.set(msg.keyInt, msg.valueUint42); self.int_uint256.set(msg.keyInt, msg.valueUint256); + self.int_coins.set(msg.keyInt, msg.valueCoins); self.int_bool.set(msg.keyInt, msg.valueBool); self.int_cell.set(msg.keyInt, msg.valueCell); self.int_address.set(msg.keyInt, msg.valueAddress); @@ -866,6 +926,7 @@ contract MapTestContract { self.int8_uint8.set(msg.keyInt8, msg.valueUint8); self.int8_uint42.set(msg.keyInt8, msg.valueUint42); self.int8_uint256.set(msg.keyInt8, msg.valueUint256); + self.int8_coins.set(msg.keyInt8, msg.valueCoins); self.int8_bool.set(msg.keyInt8, msg.valueBool); self.int8_cell.set(msg.keyInt8, msg.valueCell); self.int8_address.set(msg.keyInt8, msg.valueAddress); @@ -878,6 +939,7 @@ contract MapTestContract { self.int42_uint8.set(msg.keyInt42, msg.valueUint8); self.int42_uint42.set(msg.keyInt42, msg.valueUint42); self.int42_uint256.set(msg.keyInt42, msg.valueUint256); + self.int42_coins.set(msg.keyInt42, msg.valueCoins); self.int42_bool.set(msg.keyInt42, msg.valueBool); self.int42_cell.set(msg.keyInt42, msg.valueCell); self.int42_address.set(msg.keyInt42, msg.valueAddress); @@ -890,6 +952,7 @@ contract MapTestContract { self.int256_uint8.set(msg.keyInt256, msg.valueUint8); self.int256_uint42.set(msg.keyInt256, msg.valueUint42); self.int256_uint256.set(msg.keyInt256, msg.valueUint256); + self.int256_coins.set(msg.keyInt256, msg.valueCoins); self.int256_bool.set(msg.keyInt256, msg.valueBool); self.int256_cell.set(msg.keyInt256, msg.valueCell); self.int256_address.set(msg.keyInt256, msg.valueAddress); @@ -902,6 +965,7 @@ contract MapTestContract { self.uint8_uint8.set(msg.keyUint8, msg.valueUint8); self.uint8_uint42.set(msg.keyUint8, msg.valueUint42); self.uint8_uint256.set(msg.keyUint8, msg.valueUint256); + self.uint8_coins.set(msg.keyUint8, msg.valueCoins); self.uint8_bool.set(msg.keyUint8, msg.valueBool); self.uint8_cell.set(msg.keyUint8, msg.valueCell); self.uint8_address.set(msg.keyUint8, msg.valueAddress); @@ -914,6 +978,7 @@ contract MapTestContract { self.uint42_uint8.set(msg.keyUint42, msg.valueUint8); self.uint42_uint42.set(msg.keyUint42, msg.valueUint42); self.uint42_uint256.set(msg.keyUint42, msg.valueUint256); + self.uint42_coins.set(msg.keyUint42, msg.valueCoins); self.uint42_bool.set(msg.keyUint42, msg.valueBool); self.uint42_cell.set(msg.keyUint42, msg.valueCell); self.uint42_address.set(msg.keyUint42, msg.valueAddress); @@ -926,6 +991,7 @@ contract MapTestContract { self.uint256_uint8.set(msg.keyUint256, msg.valueUint8); self.uint256_uint42.set(msg.keyUint256, msg.valueUint42); self.uint256_uint256.set(msg.keyUint256, msg.valueUint256); + self.uint256_coins.set(msg.keyUint256, msg.valueCoins); self.uint256_bool.set(msg.keyUint256, msg.valueBool); self.uint256_cell.set(msg.keyUint256, msg.valueCell); self.uint256_address.set(msg.keyUint256, msg.valueAddress); @@ -939,6 +1005,7 @@ contract MapTestContract { self.address_uint8.set(msg.keyAddress, msg.valueUint8); self.address_uint42.set(msg.keyAddress, msg.valueUint42); self.address_uint256.set(msg.keyAddress, msg.valueUint256); + self.address_coins.set(msg.keyAddress, msg.valueCoins); self.address_bool.set(msg.keyAddress, msg.valueBool); self.address_cell.set(msg.keyAddress, msg.valueCell); self.address_address.set(msg.keyAddress, msg.valueAddress); @@ -954,6 +1021,7 @@ contract MapTestContract { self.int_uint8.del(msg.keyInt); self.int_uint42.del(msg.keyInt); self.int_uint256.del(msg.keyInt); + self.int_coins.del(msg.keyInt); self.int_bool.del(msg.keyInt); self.int_cell.del(msg.keyInt); self.int_address.del(msg.keyInt); @@ -966,6 +1034,7 @@ contract MapTestContract { self.int8_uint8.del(msg.keyInt8); self.int8_uint42.del(msg.keyInt8); self.int8_uint256.del(msg.keyInt8); + self.int8_coins.del(msg.keyInt8); self.int8_bool.del(msg.keyInt8); self.int8_cell.del(msg.keyInt8); self.int8_address.del(msg.keyInt8); @@ -978,6 +1047,7 @@ contract MapTestContract { self.int42_uint8.del(msg.keyInt42); self.int42_uint42.del(msg.keyInt42); self.int42_uint256.del(msg.keyInt42); + self.int42_coins.del(msg.keyInt42); self.int42_bool.del(msg.keyInt42); self.int42_cell.del(msg.keyInt42); self.int42_address.del(msg.keyInt42); @@ -990,6 +1060,7 @@ contract MapTestContract { self.int256_uint8.del(msg.keyInt256); self.int256_uint42.del(msg.keyInt256); self.int256_uint256.del(msg.keyInt256); + self.int256_coins.del(msg.keyInt256); self.int256_bool.del(msg.keyInt256); self.int256_cell.del(msg.keyInt256); self.int256_address.del(msg.keyInt256); @@ -1002,6 +1073,7 @@ contract MapTestContract { self.uint8_uint8.del(msg.keyUint8); self.uint8_uint42.del(msg.keyUint8); self.uint8_uint256.del(msg.keyUint8); + self.uint8_coins.del(msg.keyUint8); self.uint8_bool.del(msg.keyUint8); self.uint8_cell.del(msg.keyUint8); self.uint8_address.del(msg.keyUint8); @@ -1014,6 +1086,7 @@ contract MapTestContract { self.uint42_uint8.del(msg.keyUint42); self.uint42_uint42.del(msg.keyUint42); self.uint42_uint256.del(msg.keyUint42); + self.uint42_coins.del(msg.keyUint42); self.uint42_bool.del(msg.keyUint42); self.uint42_cell.del(msg.keyUint42); self.uint42_address.del(msg.keyUint42); @@ -1026,6 +1099,7 @@ contract MapTestContract { self.uint256_uint8.del(msg.keyUint256); self.uint256_uint42.del(msg.keyUint256); self.uint256_uint256.del(msg.keyUint256); + self.uint256_coins.del(msg.keyUint256); self.uint256_bool.del(msg.keyUint256); self.uint256_cell.del(msg.keyUint256); self.uint256_address.del(msg.keyUint256); @@ -1039,6 +1113,7 @@ contract MapTestContract { self.address_uint8.del(msg.keyAddress); self.address_uint42.del(msg.keyAddress); self.address_uint256.del(msg.keyAddress); + self.address_coins.del(msg.keyAddress); self.address_bool.del(msg.keyAddress); self.address_cell.del(msg.keyAddress); self.address_address.del(msg.keyAddress); @@ -1054,6 +1129,7 @@ contract MapTestContract { self.int_uint8.replace(msg.keyInt, msg.valueUint8); self.int_uint42.replace(msg.keyInt, msg.valueUint42); self.int_uint256.replace(msg.keyInt, msg.valueUint256); + self.int_coins.replace(msg.keyInt, msg.valueCoins); self.int_bool.replace(msg.keyInt, msg.valueBool); self.int_cell.replace(msg.keyInt, msg.valueCell); self.int_address.replace(msg.keyInt, msg.valueAddress); @@ -1066,6 +1142,7 @@ contract MapTestContract { self.int8_uint8.replace(msg.keyInt8, msg.valueUint8); self.int8_uint42.replace(msg.keyInt8, msg.valueUint42); self.int8_uint256.replace(msg.keyInt8, msg.valueUint256); + self.int8_coins.replace(msg.keyInt8, msg.valueCoins); self.int8_bool.replace(msg.keyInt8, msg.valueBool); self.int8_cell.replace(msg.keyInt8, msg.valueCell); self.int8_address.replace(msg.keyInt8, msg.valueAddress); @@ -1078,6 +1155,7 @@ contract MapTestContract { self.int42_uint8.replace(msg.keyInt42, msg.valueUint8); self.int42_uint42.replace(msg.keyInt42, msg.valueUint42); self.int42_uint256.replace(msg.keyInt42, msg.valueUint256); + self.int42_coins.replace(msg.keyInt42, msg.valueCoins); self.int42_bool.replace(msg.keyInt42, msg.valueBool); self.int42_cell.replace(msg.keyInt42, msg.valueCell); self.int42_address.replace(msg.keyInt42, msg.valueAddress); @@ -1090,6 +1168,7 @@ contract MapTestContract { self.int256_uint8.replace(msg.keyInt256, msg.valueUint8); self.int256_uint42.replace(msg.keyInt256, msg.valueUint42); self.int256_uint256.replace(msg.keyInt256, msg.valueUint256); + self.int256_coins.replace(msg.keyInt256, msg.valueCoins); self.int256_bool.replace(msg.keyInt256, msg.valueBool); self.int256_cell.replace(msg.keyInt256, msg.valueCell); self.int256_address.replace(msg.keyInt256, msg.valueAddress); @@ -1102,6 +1181,7 @@ contract MapTestContract { self.uint8_uint8.replace(msg.keyUint8, msg.valueUint8); self.uint8_uint42.replace(msg.keyUint8, msg.valueUint42); self.uint8_uint256.replace(msg.keyUint8, msg.valueUint256); + self.uint8_coins.replace(msg.keyUint8, msg.valueCoins); self.uint8_bool.replace(msg.keyUint8, msg.valueBool); self.uint8_cell.replace(msg.keyUint8, msg.valueCell); self.uint8_address.replace(msg.keyUint8, msg.valueAddress); @@ -1114,6 +1194,7 @@ contract MapTestContract { self.uint42_uint8.replace(msg.keyUint42, msg.valueUint8); self.uint42_uint42.replace(msg.keyUint42, msg.valueUint42); self.uint42_uint256.replace(msg.keyUint42, msg.valueUint256); + self.uint42_coins.replace(msg.keyUint42, msg.valueCoins); self.uint42_bool.replace(msg.keyUint42, msg.valueBool); self.uint42_cell.replace(msg.keyUint42, msg.valueCell); self.uint42_address.replace(msg.keyUint42, msg.valueAddress); @@ -1126,6 +1207,7 @@ contract MapTestContract { self.uint256_uint8.replace(msg.keyUint256, msg.valueUint8); self.uint256_uint42.replace(msg.keyUint256, msg.valueUint42); self.uint256_uint256.replace(msg.keyUint256, msg.valueUint256); + self.uint256_coins.replace(msg.keyUint256, msg.valueCoins); self.uint256_bool.replace(msg.keyUint256, msg.valueBool); self.uint256_cell.replace(msg.keyUint256, msg.valueCell); self.uint256_address.replace(msg.keyUint256, msg.valueAddress); @@ -1139,6 +1221,7 @@ contract MapTestContract { self.address_uint8.replace(msg.keyAddress, msg.valueUint8); self.address_uint42.replace(msg.keyAddress, msg.valueUint42); self.address_uint256.replace(msg.keyAddress, msg.valueUint256); + self.address_coins.replace(msg.keyAddress, msg.valueCoins); self.address_bool.replace(msg.keyAddress, msg.valueBool); self.address_cell.replace(msg.keyAddress, msg.valueCell); self.address_address.replace(msg.keyAddress, msg.valueAddress); @@ -1154,6 +1237,7 @@ contract MapTestContract { self.int_uint8.replaceGet(msg.keyInt, msg.valueUint8); self.int_uint42.replaceGet(msg.keyInt, msg.valueUint42); self.int_uint256.replaceGet(msg.keyInt, msg.valueUint256); + self.int_coins.replaceGet(msg.keyInt, msg.valueCoins); self.int_bool.replaceGet(msg.keyInt, msg.valueBool); self.int_cell.replaceGet(msg.keyInt, msg.valueCell); self.int_address.replaceGet(msg.keyInt, msg.valueAddress); @@ -1166,6 +1250,7 @@ contract MapTestContract { self.int8_uint8.replaceGet(msg.keyInt8, msg.valueUint8); self.int8_uint42.replaceGet(msg.keyInt8, msg.valueUint42); self.int8_uint256.replaceGet(msg.keyInt8, msg.valueUint256); + self.int8_coins.replaceGet(msg.keyInt8, msg.valueCoins); self.int8_bool.replaceGet(msg.keyInt8, msg.valueBool); self.int8_cell.replaceGet(msg.keyInt8, msg.valueCell); self.int8_address.replaceGet(msg.keyInt8, msg.valueAddress); @@ -1178,6 +1263,7 @@ contract MapTestContract { self.int42_uint8.replaceGet(msg.keyInt42, msg.valueUint8); self.int42_uint42.replaceGet(msg.keyInt42, msg.valueUint42); self.int42_uint256.replaceGet(msg.keyInt42, msg.valueUint256); + self.int42_coins.replaceGet(msg.keyInt42, msg.valueCoins); self.int42_bool.replaceGet(msg.keyInt42, msg.valueBool); self.int42_cell.replaceGet(msg.keyInt42, msg.valueCell); self.int42_address.replaceGet(msg.keyInt42, msg.valueAddress); @@ -1190,6 +1276,7 @@ contract MapTestContract { self.int256_uint8.replaceGet(msg.keyInt256, msg.valueUint8); self.int256_uint42.replaceGet(msg.keyInt256, msg.valueUint42); self.int256_uint256.replaceGet(msg.keyInt256, msg.valueUint256); + self.int256_coins.replaceGet(msg.keyInt256, msg.valueCoins); self.int256_bool.replaceGet(msg.keyInt256, msg.valueBool); self.int256_cell.replaceGet(msg.keyInt256, msg.valueCell); self.int256_address.replaceGet(msg.keyInt256, msg.valueAddress); @@ -1202,6 +1289,7 @@ contract MapTestContract { self.uint8_uint8.replaceGet(msg.keyUint8, msg.valueUint8); self.uint8_uint42.replaceGet(msg.keyUint8, msg.valueUint42); self.uint8_uint256.replaceGet(msg.keyUint8, msg.valueUint256); + self.uint8_coins.replaceGet(msg.keyUint8, msg.valueCoins); self.uint8_bool.replaceGet(msg.keyUint8, msg.valueBool); self.uint8_cell.replaceGet(msg.keyUint8, msg.valueCell); self.uint8_address.replaceGet(msg.keyUint8, msg.valueAddress); @@ -1214,6 +1302,7 @@ contract MapTestContract { self.uint42_uint8.replaceGet(msg.keyUint42, msg.valueUint8); self.uint42_uint42.replaceGet(msg.keyUint42, msg.valueUint42); self.uint42_uint256.replaceGet(msg.keyUint42, msg.valueUint256); + self.uint42_coins.replaceGet(msg.keyUint42, msg.valueCoins); self.uint42_bool.replaceGet(msg.keyUint42, msg.valueBool); self.uint42_cell.replaceGet(msg.keyUint42, msg.valueCell); self.uint42_address.replaceGet(msg.keyUint42, msg.valueAddress); @@ -1226,6 +1315,7 @@ contract MapTestContract { self.uint256_uint8.replaceGet(msg.keyUint256, msg.valueUint8); self.uint256_uint42.replaceGet(msg.keyUint256, msg.valueUint42); self.uint256_uint256.replaceGet(msg.keyUint256, msg.valueUint256); + self.uint256_coins.replaceGet(msg.keyUint256, msg.valueCoins); self.uint256_bool.replaceGet(msg.keyUint256, msg.valueBool); self.uint256_cell.replaceGet(msg.keyUint256, msg.valueCell); self.uint256_address.replaceGet(msg.keyUint256, msg.valueAddress); @@ -1239,6 +1329,7 @@ contract MapTestContract { self.address_uint8.replaceGet(msg.keyAddress, msg.valueUint8); self.address_uint42.replaceGet(msg.keyAddress, msg.valueUint42); self.address_uint256.replaceGet(msg.keyAddress, msg.valueUint256); + self.address_coins.replaceGet(msg.keyAddress, msg.valueCoins); self.address_bool.replaceGet(msg.keyAddress, msg.valueBool); self.address_cell.replaceGet(msg.keyAddress, msg.valueCell); self.address_address.replaceGet(msg.keyAddress, msg.valueAddress); @@ -1272,6 +1363,7 @@ contract MapTestContract { int_uint8: self.int_uint8.get(keyInt), int_uint42: self.int_uint42.get(keyInt), int_uint256: self.int_uint256.get(keyInt), + int_coins: self.int_coins.get(keyInt), int_bool: self.int_bool.get(keyInt), int_cell: self.int_cell.get(keyInt), int_address: self.int_address.get(keyInt), @@ -1284,6 +1376,7 @@ contract MapTestContract { int8_uint8: self.int8_uint8.get(keyInt8), int8_uint42: self.int8_uint42.get(keyInt8), int8_uint256: self.int8_uint256.get(keyInt8), + int8_coins: self.int8_coins.get(keyInt8), int8_bool: self.int8_bool.get(keyInt8), int8_cell: self.int8_cell.get(keyInt8), int8_address: self.int8_address.get(keyInt8), @@ -1296,6 +1389,7 @@ contract MapTestContract { int42_uint8: self.int42_uint8.get(keyInt42), int42_uint42: self.int42_uint42.get(keyInt42), int42_uint256: self.int42_uint256.get(keyInt42), + int42_coins: self.int42_coins.get(keyInt42), int42_bool: self.int42_bool.get(keyInt42), int42_cell: self.int42_cell.get(keyInt42), int42_address: self.int42_address.get(keyInt42), @@ -1308,6 +1402,7 @@ contract MapTestContract { int256_uint8: self.int256_uint8.get(keyInt256), int256_uint42: self.int256_uint42.get(keyInt256), int256_uint256: self.int256_uint256.get(keyInt256), + int256_coins: self.int256_coins.get(keyInt256), int256_bool: self.int256_bool.get(keyInt256), int256_cell: self.int256_cell.get(keyInt256), int256_address: self.int256_address.get(keyInt256), @@ -1320,6 +1415,7 @@ contract MapTestContract { uint8_uint8: self.uint8_uint8.get(keyUint8), uint8_uint42: self.uint8_uint42.get(keyUint8), uint8_uint256: self.uint8_uint256.get(keyUint8), + uint8_coins: self.uint8_coins.get(keyUint8), uint8_bool: self.uint8_bool.get(keyUint8), uint8_cell: self.uint8_cell.get(keyUint8), uint8_address: self.uint8_address.get(keyUint8), @@ -1332,6 +1428,7 @@ contract MapTestContract { uint42_uint8: self.uint42_uint8.get(keyUint42), uint42_uint42: self.uint42_uint42.get(keyUint42), uint42_uint256: self.uint42_uint256.get(keyUint42), + uint42_coins: self.uint42_coins.get(keyUint42), uint42_bool: self.uint42_bool.get(keyUint42), uint42_cell: self.uint42_cell.get(keyUint42), uint42_address: self.uint42_address.get(keyUint42), @@ -1344,6 +1441,7 @@ contract MapTestContract { uint256_uint8: self.uint256_uint8.get(keyUint256), uint256_uint42: self.uint256_uint42.get(keyUint256), uint256_uint256: self.uint256_uint256.get(keyUint256), + uint256_coins: self.uint256_coins.get(keyUint256), uint256_bool: self.uint256_bool.get(keyUint256), uint256_cell: self.uint256_cell.get(keyUint256), uint256_address: self.uint256_address.get(keyUint256), @@ -1357,6 +1455,7 @@ contract MapTestContract { address_uint8: self.address_uint8.get(keyAddress), address_uint42: self.address_uint42.get(keyAddress), address_uint256: self.address_uint256.get(keyAddress), + address_coins: self.address_coins.get(keyAddress), address_bool: self.address_bool.get(keyAddress), address_cell: self.address_cell.get(keyAddress), address_address: self.address_address.get(keyAddress), @@ -1380,6 +1479,7 @@ contract MapTestContract { valueUint8: Int, valueUint42: Int, valueUint256: Int, + valueCoins: Int, valueBool: Bool, valueCell: Cell, valueAddress: Address, @@ -1394,6 +1494,7 @@ contract MapTestContract { int_uint8: self.int_uint8.replace(keyInt, valueUint8), int_uint42: self.int_uint42.replace(keyInt, valueUint42), int_uint256: self.int_uint256.replace(keyInt, valueUint256), + int_coins: self.int_coins.replace(keyInt, valueCoins), int_bool: self.int_bool.replace(keyInt, valueBool), int_cell: self.int_cell.replace(keyInt, valueCell), int_address: self.int_address.replace(keyInt, valueAddress), @@ -1406,6 +1507,7 @@ contract MapTestContract { int8_uint8: self.int8_uint8.replace(keyInt8, valueUint8), int8_uint42: self.int8_uint42.replace(keyInt8, valueUint42), int8_uint256: self.int8_uint256.replace(keyInt8, valueUint256), + int8_coins: self.int8_coins.replace(keyInt8, valueCoins), int8_bool: self.int8_bool.replace(keyInt8, valueBool), int8_cell: self.int8_cell.replace(keyInt8, valueCell), int8_address: self.int8_address.replace(keyInt8, valueAddress), @@ -1418,6 +1520,7 @@ contract MapTestContract { int42_uint8: self.int42_uint8.replace(keyInt42, valueUint8), int42_uint42: self.int42_uint42.replace(keyInt42, valueUint42), int42_uint256: self.int42_uint256.replace(keyInt42, valueUint256), + int42_coins: self.int42_coins.replace(keyInt42, valueCoins), int42_bool: self.int42_bool.replace(keyInt42, valueBool), int42_cell: self.int42_cell.replace(keyInt42, valueCell), int42_address: self.int42_address.replace(keyInt42, valueAddress), @@ -1430,6 +1533,7 @@ contract MapTestContract { int256_uint8: self.int256_uint8.replace(keyInt256, valueUint8), int256_uint42: self.int256_uint42.replace(keyInt256, valueUint42), int256_uint256: self.int256_uint256.replace(keyInt256, valueUint256), + int256_coins: self.int256_coins.replace(keyInt256, valueCoins), int256_bool: self.int256_bool.replace(keyInt256, valueBool), int256_cell: self.int256_cell.replace(keyInt256, valueCell), int256_address: self.int256_address.replace(keyInt256, valueAddress), @@ -1442,6 +1546,7 @@ contract MapTestContract { uint8_uint8: self.uint8_uint8.replace(keyUint8, valueUint8), uint8_uint42: self.uint8_uint42.replace(keyUint8, valueUint42), uint8_uint256: self.uint8_uint256.replace(keyUint8, valueUint256), + uint8_coins: self.uint8_coins.replace(keyUint8, valueCoins), uint8_bool: self.uint8_bool.replace(keyUint8, valueBool), uint8_cell: self.uint8_cell.replace(keyUint8, valueCell), uint8_address: self.uint8_address.replace(keyUint8, valueAddress), @@ -1454,6 +1559,7 @@ contract MapTestContract { uint42_uint8: self.uint42_uint8.replace(keyUint42, valueUint8), uint42_uint42: self.uint42_uint42.replace(keyUint42, valueUint42), uint42_uint256: self.uint42_uint256.replace(keyUint42, valueUint256), + uint42_coins: self.uint42_coins.replace(keyUint42, valueCoins), uint42_bool: self.uint42_bool.replace(keyUint42, valueBool), uint42_cell: self.uint42_cell.replace(keyUint42, valueCell), uint42_address: self.uint42_address.replace(keyUint42, valueAddress), @@ -1466,6 +1572,7 @@ contract MapTestContract { uint256_uint8: self.uint256_uint8.replace(keyUint256, valueUint8), uint256_uint42: self.uint256_uint42.replace(keyUint256, valueUint42), uint256_uint256: self.uint256_uint256.replace(keyUint256, valueUint256), + uint256_coins: self.uint256_coins.replace(keyUint256, valueCoins), uint256_bool: self.uint256_bool.replace(keyUint256, valueBool), uint256_cell: self.uint256_cell.replace(keyUint256, valueCell), uint256_address: self.uint256_address.replace(keyUint256, valueAddress), @@ -1479,6 +1586,7 @@ contract MapTestContract { address_uint8: self.address_uint8.replace(keyAddress, valueUint8), address_uint42: self.address_uint42.replace(keyAddress, valueUint42), address_uint256: self.address_uint256.replace(keyAddress, valueUint256), + address_coins: self.address_coins.replace(keyAddress, valueCoins), address_bool: self.address_bool.replace(keyAddress, valueBool), address_cell: self.address_cell.replace(keyAddress, valueCell), address_address: self.address_address.replace(keyAddress, valueAddress), @@ -1502,6 +1610,7 @@ contract MapTestContract { valueUint8: Int, valueUint42: Int, valueUint256: Int, + valueCoins: Int, valueBool: Bool, valueCell: Cell, valueAddress: Address, @@ -1516,6 +1625,7 @@ contract MapTestContract { int_uint8: self.int_uint8.replaceGet(keyInt, valueUint8), int_uint42: self.int_uint42.replaceGet(keyInt, valueUint42), int_uint256: self.int_uint256.replaceGet(keyInt, valueUint256), + int_coins: self.int_coins.replaceGet(keyInt, valueCoins), int_bool: self.int_bool.replaceGet(keyInt, valueBool), int_cell: self.int_cell.replaceGet(keyInt, valueCell), int_address: self.int_address.replaceGet(keyInt, valueAddress), @@ -1528,6 +1638,7 @@ contract MapTestContract { int8_uint8: self.int8_uint8.replaceGet(keyInt8, valueUint8), int8_uint42: self.int8_uint42.replaceGet(keyInt8, valueUint42), int8_uint256: self.int8_uint256.replaceGet(keyInt8, valueUint256), + int8_coins: self.int8_coins.replaceGet(keyInt8, valueCoins), int8_bool: self.int8_bool.replaceGet(keyInt8, valueBool), int8_cell: self.int8_cell.replaceGet(keyInt8, valueCell), int8_address: self.int8_address.replaceGet(keyInt8, valueAddress), @@ -1540,6 +1651,7 @@ contract MapTestContract { int42_uint8: self.int42_uint8.replaceGet(keyInt42, valueUint8), int42_uint42: self.int42_uint42.replaceGet(keyInt42, valueUint42), int42_uint256: self.int42_uint256.replaceGet(keyInt42, valueUint256), + int42_coins: self.int42_coins.replaceGet(keyInt42, valueCoins), int42_bool: self.int42_bool.replaceGet(keyInt42, valueBool), int42_cell: self.int42_cell.replaceGet(keyInt42, valueCell), int42_address: self.int42_address.replaceGet(keyInt42, valueAddress), @@ -1552,6 +1664,7 @@ contract MapTestContract { int256_uint8: self.int256_uint8.replaceGet(keyInt256, valueUint8), int256_uint42: self.int256_uint42.replaceGet(keyInt256, valueUint42), int256_uint256: self.int256_uint256.replaceGet(keyInt256, valueUint256), + int256_coins: self.int256_coins.replaceGet(keyInt256, valueCoins), int256_bool: self.int256_bool.replaceGet(keyInt256, valueBool), int256_cell: self.int256_cell.replaceGet(keyInt256, valueCell), int256_address: self.int256_address.replaceGet(keyInt256, valueAddress), @@ -1564,6 +1677,7 @@ contract MapTestContract { uint8_uint8: self.uint8_uint8.replaceGet(keyUint8, valueUint8), uint8_uint42: self.uint8_uint42.replaceGet(keyUint8, valueUint42), uint8_uint256: self.uint8_uint256.replaceGet(keyUint8, valueUint256), + uint8_coins: self.uint8_coins.replaceGet(keyUint8, valueCoins), uint8_bool: self.uint8_bool.replaceGet(keyUint8, valueBool), uint8_cell: self.uint8_cell.replaceGet(keyUint8, valueCell), uint8_address: self.uint8_address.replaceGet(keyUint8, valueAddress), @@ -1576,6 +1690,7 @@ contract MapTestContract { uint42_uint8: self.uint42_uint8.replaceGet(keyUint42, valueUint8), uint42_uint42: self.uint42_uint42.replaceGet(keyUint42, valueUint42), uint42_uint256: self.uint42_uint256.replaceGet(keyUint42, valueUint256), + uint42_coins: self.uint42_coins.replaceGet(keyUint42, valueCoins), uint42_bool: self.uint42_bool.replaceGet(keyUint42, valueBool), uint42_cell: self.uint42_cell.replaceGet(keyUint42, valueCell), uint42_address: self.uint42_address.replaceGet(keyUint42, valueAddress), @@ -1588,6 +1703,7 @@ contract MapTestContract { uint256_uint8: self.uint256_uint8.replaceGet(keyUint256, valueUint8), uint256_uint42: self.uint256_uint42.replaceGet(keyUint256, valueUint42), uint256_uint256: self.uint256_uint256.replaceGet(keyUint256, valueUint256), + uint256_coins: self.uint256_coins.replaceGet(keyUint256, valueCoins), uint256_bool: self.uint256_bool.replaceGet(keyUint256, valueBool), uint256_cell: self.uint256_cell.replaceGet(keyUint256, valueCell), uint256_address: self.uint256_address.replaceGet(keyUint256, valueAddress), @@ -1601,6 +1717,7 @@ contract MapTestContract { address_uint8: self.address_uint8.replaceGet(keyAddress, valueUint8), address_uint42: self.address_uint42.replaceGet(keyAddress, valueUint42), address_uint256: self.address_uint256.replaceGet(keyAddress, valueUint256), + address_coins: self.address_coins.replaceGet(keyAddress, valueCoins), address_bool: self.address_bool.replaceGet(keyAddress, valueBool), address_cell: self.address_cell.replaceGet(keyAddress, valueCell), address_address: self.address_address.replaceGet(keyAddress, valueAddress), @@ -1627,6 +1744,7 @@ contract MapTestContract { int_uint8: self.int_uint8.exists(keyInt), int_uint42: self.int_uint42.exists(keyInt), int_uint256: self.int_uint256.exists(keyInt), + int_coins: self.int_coins.exists(keyInt), int_bool: self.int_bool.exists(keyInt), int_cell: self.int_cell.exists(keyInt), int_address: self.int_address.exists(keyInt), @@ -1639,6 +1757,7 @@ contract MapTestContract { int8_uint8: self.int8_uint8.exists(keyInt8), int8_uint42: self.int8_uint42.exists(keyInt8), int8_uint256: self.int8_uint256.exists(keyInt8), + int8_coins: self.int8_coins.exists(keyInt8), int8_bool: self.int8_bool.exists(keyInt8), int8_cell: self.int8_cell.exists(keyInt8), int8_address: self.int8_address.exists(keyInt8), @@ -1651,6 +1770,7 @@ contract MapTestContract { int42_uint8: self.int42_uint8.exists(keyInt42), int42_uint42: self.int42_uint42.exists(keyInt42), int42_uint256: self.int42_uint256.exists(keyInt42), + int42_coins: self.int42_coins.exists(keyInt42), int42_bool: self.int42_bool.exists(keyInt42), int42_cell: self.int42_cell.exists(keyInt42), int42_address: self.int42_address.exists(keyInt42), @@ -1663,6 +1783,7 @@ contract MapTestContract { int256_uint8: self.int256_uint8.exists(keyInt256), int256_uint42: self.int256_uint42.exists(keyInt256), int256_uint256: self.int256_uint256.exists(keyInt256), + int256_coins: self.int256_coins.exists(keyInt256), int256_bool: self.int256_bool.exists(keyInt256), int256_cell: self.int256_cell.exists(keyInt256), int256_address: self.int256_address.exists(keyInt256), @@ -1675,6 +1796,7 @@ contract MapTestContract { uint8_uint8: self.uint8_uint8.exists(keyUint8), uint8_uint42: self.uint8_uint42.exists(keyUint8), uint8_uint256: self.uint8_uint256.exists(keyUint8), + uint8_coins: self.uint8_coins.exists(keyUint8), uint8_bool: self.uint8_bool.exists(keyUint8), uint8_cell: self.uint8_cell.exists(keyUint8), uint8_address: self.uint8_address.exists(keyUint8), @@ -1687,6 +1809,7 @@ contract MapTestContract { uint42_uint8: self.uint42_uint8.exists(keyUint42), uint42_uint42: self.uint42_uint42.exists(keyUint42), uint42_uint256: self.uint42_uint256.exists(keyUint42), + uint42_coins: self.uint42_coins.exists(keyUint42), uint42_bool: self.uint42_bool.exists(keyUint42), uint42_cell: self.uint42_cell.exists(keyUint42), uint42_address: self.uint42_address.exists(keyUint42), @@ -1699,6 +1822,7 @@ contract MapTestContract { uint256_uint8: self.uint256_uint8.exists(keyUint256), uint256_uint42: self.uint256_uint42.exists(keyUint256), uint256_uint256: self.uint256_uint256.exists(keyUint256), + uint256_coins: self.uint256_coins.exists(keyUint256), uint256_bool: self.uint256_bool.exists(keyUint256), uint256_cell: self.uint256_cell.exists(keyUint256), uint256_address: self.uint256_address.exists(keyUint256), @@ -1712,6 +1836,7 @@ contract MapTestContract { address_uint8: self.address_uint8.exists(keyAddress), address_uint42: self.address_uint42.exists(keyAddress), address_uint256: self.address_uint256.exists(keyAddress), + address_coins: self.address_coins.exists(keyAddress), address_bool: self.address_bool.exists(keyAddress), address_cell: self.address_cell.exists(keyAddress), address_address: self.address_address.exists(keyAddress), @@ -1729,6 +1854,7 @@ contract MapTestContract { int_uint8: self.int_uint8.isEmpty(), int_uint42: self.int_uint42.isEmpty(), int_uint256: self.int_uint256.isEmpty(), + int_coins: self.int_coins.isEmpty(), int_bool: self.int_bool.isEmpty(), int_cell: self.int_cell.isEmpty(), int_address: self.int_address.isEmpty(), @@ -1741,6 +1867,7 @@ contract MapTestContract { int8_uint8: self.int8_uint8.isEmpty(), int8_uint42: self.int8_uint42.isEmpty(), int8_uint256: self.int8_uint256.isEmpty(), + int8_coins: self.int8_coins.isEmpty(), int8_bool: self.int8_bool.isEmpty(), int8_cell: self.int8_cell.isEmpty(), int8_address: self.int8_address.isEmpty(), @@ -1753,6 +1880,7 @@ contract MapTestContract { int42_uint8: self.int42_uint8.isEmpty(), int42_uint42: self.int42_uint42.isEmpty(), int42_uint256: self.int42_uint256.isEmpty(), + int42_coins: self.int42_coins.isEmpty(), int42_bool: self.int42_bool.isEmpty(), int42_cell: self.int42_cell.isEmpty(), int42_address: self.int42_address.isEmpty(), @@ -1765,6 +1893,7 @@ contract MapTestContract { int256_uint8: self.int256_uint8.isEmpty(), int256_uint42: self.int256_uint42.isEmpty(), int256_uint256: self.int256_uint256.isEmpty(), + int256_coins: self.int256_coins.isEmpty(), int256_bool: self.int256_bool.isEmpty(), int256_cell: self.int256_cell.isEmpty(), int256_address: self.int256_address.isEmpty(), @@ -1777,6 +1906,7 @@ contract MapTestContract { uint8_uint8: self.uint8_uint8.isEmpty(), uint8_uint42: self.uint8_uint42.isEmpty(), uint8_uint256: self.uint8_uint256.isEmpty(), + uint8_coins: self.uint8_coins.isEmpty(), uint8_bool: self.uint8_bool.isEmpty(), uint8_cell: self.uint8_cell.isEmpty(), uint8_address: self.uint8_address.isEmpty(), @@ -1789,6 +1919,7 @@ contract MapTestContract { uint42_uint8: self.uint42_uint8.isEmpty(), uint42_uint42: self.uint42_uint42.isEmpty(), uint42_uint256: self.uint42_uint256.isEmpty(), + uint42_coins: self.uint42_coins.isEmpty(), uint42_bool: self.uint42_bool.isEmpty(), uint42_cell: self.uint42_cell.isEmpty(), uint42_address: self.uint42_address.isEmpty(), @@ -1801,6 +1932,7 @@ contract MapTestContract { uint256_uint8: self.uint256_uint8.isEmpty(), uint256_uint42: self.uint256_uint42.isEmpty(), uint256_uint256: self.uint256_uint256.isEmpty(), + uint256_coins: self.uint256_coins.isEmpty(), uint256_bool: self.uint256_bool.isEmpty(), uint256_cell: self.uint256_cell.isEmpty(), uint256_address: self.uint256_address.isEmpty(), @@ -1814,6 +1946,7 @@ contract MapTestContract { address_uint8: self.address_uint8.isEmpty(), address_uint42: self.address_uint42.isEmpty(), address_uint256: self.address_uint256.isEmpty(), + address_coins: self.address_coins.isEmpty(), address_bool: self.address_bool.isEmpty(), address_cell: self.address_cell.isEmpty(), address_address: self.address_address.isEmpty(), @@ -1831,6 +1964,7 @@ contract MapTestContract { int_uint8: self.int_uint8.asCell(), int_uint42: self.int_uint42.asCell(), int_uint256: self.int_uint256.asCell(), + int_coins: self.int_coins.asCell(), int_bool: self.int_bool.asCell(), int_cell: self.int_cell.asCell(), int_address: self.int_address.asCell(), @@ -1843,6 +1977,7 @@ contract MapTestContract { int8_uint8: self.int8_uint8.asCell(), int8_uint42: self.int8_uint42.asCell(), int8_uint256: self.int8_uint256.asCell(), + int8_coins: self.int8_coins.asCell(), int8_bool: self.int8_bool.asCell(), int8_cell: self.int8_cell.asCell(), int8_address: self.int8_address.asCell(), @@ -1855,6 +1990,7 @@ contract MapTestContract { int42_uint8: self.int42_uint8.asCell(), int42_uint42: self.int42_uint42.asCell(), int42_uint256: self.int42_uint256.asCell(), + int42_coins: self.int42_coins.asCell(), int42_bool: self.int42_bool.asCell(), int42_cell: self.int42_cell.asCell(), int42_address: self.int42_address.asCell(), @@ -1867,6 +2003,7 @@ contract MapTestContract { int256_uint8: self.int256_uint8.asCell(), int256_uint42: self.int256_uint42.asCell(), int256_uint256: self.int256_uint256.asCell(), + int256_coins: self.int256_coins.asCell(), int256_bool: self.int256_bool.asCell(), int256_cell: self.int256_cell.asCell(), int256_address: self.int256_address.asCell(), @@ -1879,6 +2016,7 @@ contract MapTestContract { uint8_uint8: self.uint8_uint8.asCell(), uint8_uint42: self.uint8_uint42.asCell(), uint8_uint256: self.uint8_uint256.asCell(), + uint8_coins: self.uint8_coins.asCell(), uint8_bool: self.uint8_bool.asCell(), uint8_cell: self.uint8_cell.asCell(), uint8_address: self.uint8_address.asCell(), @@ -1891,6 +2029,7 @@ contract MapTestContract { uint42_uint8: self.uint42_uint8.asCell(), uint42_uint42: self.uint42_uint42.asCell(), uint42_uint256: self.uint42_uint256.asCell(), + uint42_coins: self.uint42_coins.asCell(), uint42_bool: self.uint42_bool.asCell(), uint42_cell: self.uint42_cell.asCell(), uint42_address: self.uint42_address.asCell(), @@ -1903,6 +2042,7 @@ contract MapTestContract { uint256_uint8: self.uint256_uint8.asCell(), uint256_uint42: self.uint256_uint42.asCell(), uint256_uint256: self.uint256_uint256.asCell(), + uint256_coins: self.uint256_coins.asCell(), uint256_bool: self.uint256_bool.asCell(), uint256_cell: self.uint256_cell.asCell(), uint256_address: self.uint256_address.asCell(), @@ -1916,6 +2056,7 @@ contract MapTestContract { address_uint8: self.address_uint8.asCell(), address_uint42: self.address_uint42.asCell(), address_uint256: self.address_uint256.asCell(), + address_coins: self.address_coins.asCell(), address_bool: self.address_bool.asCell(), address_cell: self.address_cell.asCell(), address_address: self.address_address.asCell(), diff --git a/src/test/e2e-emulated/map.spec.ts b/src/test/e2e-emulated/map.spec.ts index def08f733..245196f1e 100644 --- a/src/test/e2e-emulated/map.spec.ts +++ b/src/test/e2e-emulated/map.spec.ts @@ -65,6 +65,7 @@ type TestValues = { valueUint8: bigint; valueUint42: bigint; valueUint256: bigint; + valueCoins: bigint; valueBool: boolean; valueCell: Cell; valueAddress: Address; @@ -105,6 +106,7 @@ const testCases: TestCase[] = [ valueUint8: 255n, valueUint42: 123_456_789n, valueUint256: 999_999_999_999n, + valueCoins: 100_000_000n, valueBool: true, valueCell: beginCell().storeUint(42, 32).endCell(), valueAddress: randomAddress(0, "address"), @@ -137,6 +139,7 @@ const testCases: TestCase[] = [ valueUint8: 0n, // Min unsigned int valueUint42: 0n, // Min unsigned int valueUint256: 0n, // Min unsigned int + valueCoins: 0n, valueBool: false, valueCell: beginCell() .storeUint(2n ** 32n - 1n, 32) @@ -171,6 +174,7 @@ const testCases: TestCase[] = [ valueUint8: 1n, valueUint42: 1n, valueUint256: 1n, + valueCoins: 1n, valueBool: false, valueCell: beginCell().storeUint(0, 32).endCell(), valueAddress: randomAddress(0, "address"), @@ -203,6 +207,7 @@ const testCases: TestCase[] = [ valueUint8: 128n, // Middle value valueUint42: 2n ** 41n, // Large power of 2 valueUint256: 2n ** 255n, // Large power of 2 + valueCoins: 2n ** 120n - 1n, valueBool: true, valueCell: beginCell() .storeUint(2n ** 31n, 32) @@ -591,6 +596,7 @@ describe("MapTestContract", () => { valueUint8: null, valueUint42: null, valueUint256: null, + valueCoins: null, valueBool: null, valueCell: null, valueAddress: null, @@ -680,6 +686,7 @@ describe("MapTestContract", () => { valueUint8: null, valueUint42: null, valueUint256: null, + valueCoins: null, valueBool: null, valueCell: null, valueAddress: null, @@ -767,6 +774,7 @@ describe("MapTestContract", () => { valueUint8: null, valueUint42: null, valueUint256: null, + valueCoins: null, valueBool: null, valueCell: null, valueAddress: null, @@ -862,6 +870,7 @@ describe("MapTestContract", () => { valueUint8: null, valueUint42: null, valueUint256: null, + valueCoins: null, valueBool: null, valueCell: null, valueAddress: null, @@ -1504,6 +1513,7 @@ describe("MapTestContract", () => { valueUint8: null, valueUint42: null, valueUint256: null, + valueCoins: null, valueBool: null, valueCell: null, valueAddress: null, @@ -1578,6 +1588,7 @@ describe("MapTestContract", () => { valueUint8: null, valueUint42: null, valueUint256: null, + valueCoins: null, valueBool: null, valueCell: null, valueAddress: null, @@ -1672,6 +1683,7 @@ describe("MapTestContract", () => { valueUint8: null, valueUint42: null, valueUint256: null, + valueCoins: null, valueBool: null, valueCell: null, valueAddress: null, @@ -1764,6 +1776,7 @@ describe("MapTestContract", () => { valueUint8: null, valueUint42: null, valueUint256: null, + valueCoins: null, valueBool: null, valueCell: null, valueAddress: null, @@ -1830,6 +1843,7 @@ describe("MapTestContract", () => { values.valueUint8, values.valueUint42, values.valueUint256, + values.valueCoins, values.valueBool, values.valueCell, values.valueAddress, @@ -1873,6 +1887,7 @@ describe("MapTestContract", () => { values.valueUint8, values.valueUint42, values.valueUint256, + values.valueCoins, values.valueBool, values.valueCell, values.valueAddress, @@ -1966,6 +1981,7 @@ describe("MapTestContract", () => { valueUint8: null, valueUint42: null, valueUint256: null, + valueCoins: null, valueBool: null, valueCell: null, valueAddress: null, @@ -2032,6 +2048,7 @@ describe("MapTestContract", () => { values.valueUint8, values.valueUint42, values.valueUint256, + values.valueCoins, values.valueBool, values.valueCell, values.valueAddress, @@ -2076,6 +2093,7 @@ describe("MapTestContract", () => { values.valueUint8, values.valueUint42, values.valueUint256, + values.valueCoins, values.valueBool, values.valueCell, values.valueAddress, From fc6f31adc44917a5674910dbd58a9528d578bb4e Mon Sep 17 00:00:00 2001 From: Gusarich Date: Sat, 2 Nov 2024 10:18:30 +0400 Subject: [PATCH 5/9] chore: fix changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dbc2f87b2..51a8bd118 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,7 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - The `SendDefaultMode` send mode constant to the standard library: PR [#1010](https://github.com/tact-lang/tact/pull/1010) - Docs: initial semi-automated Chinese translation of the documentation: PR [#942](https://github.com/tact-lang/tact/pull/942) - The `replace` and `replaceGet` methods for the `Map` type: PR [#941](https://github.com/tact-lang/tact/pull/941) -- `as coins` map value serialization type is now handled correctly in generated TypeScript bindings: PR [#987](https://github.com/tact-lang/tact/pull/987) +- `as coins` map value serialization type is now handled correctly: PR [#987](https://github.com/tact-lang/tact/pull/987) ### Changed From f6f57c491bfa48c2302838b1639dc9bd685ba65f Mon Sep 17 00:00:00 2001 From: Gusarich Date: Sat, 2 Nov 2024 10:26:20 +0400 Subject: [PATCH 6/9] chore: update serialization snapshots --- .../writeSerialization.spec.ts.snap | 1254 +++++++++++++++-- 1 file changed, 1158 insertions(+), 96 deletions(-) diff --git a/src/generator/writers/__snapshots__/writeSerialization.spec.ts.snap b/src/generator/writers/__snapshots__/writeSerialization.spec.ts.snap index fbf26704e..30db3674f 100644 --- a/src/generator/writers/__snapshots__/writeSerialization.spec.ts.snap +++ b/src/generator/writers/__snapshots__/writeSerialization.spec.ts.snap @@ -2243,6 +2243,132 @@ if (ok) { "name": "__tact_dict_replaceget_slice_cell", "signature": "(cell, (cell)) __tact_dict_replaceget_slice_cell(cell d, int kl, slice k, cell v)", }, + { + "code": { + "code": "var (r, ok) = __tact_dict_get(d, kl, k); +if (ok) { + return r~load_coins(); +} else { + return null(); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_get", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_get_slice_coins", + "signature": "int __tact_dict_get_slice_coins(cell d, int kl, slice k)", + }, + { + "code": { + "code": "var (key, value, flag) = __tact_dict_min(d, kl); +if (flag) { + return (key, value~load_coins(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_min", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_min_slice_coins", + "signature": "(slice, int, int) __tact_dict_min_slice_coins(cell d, int kl)", + }, + { + "code": { + "code": "var (key, value, flag) = __tact_dict_next(d, kl, pivot); +if (flag) { + return (key, value~load_coins(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_next", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_next_slice_coins", + "signature": "(slice, int, int) __tact_dict_next_slice_coins(cell d, int kl, slice pivot)", + }, + { + "code": { + "code": "if (null?(v)) { + var (r, ok) = __tact_dict_delete(d, kl, k); + return (r, ()); +} else { + return (dict_set_builder(d, kl, k, begin_cell().store_coins(v)), ()); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_set_slice_coins", + "signature": "(cell, ()) __tact_dict_set_slice_coins(cell d, int kl, slice k, int v)", + }, + { + "code": { + "code": "if (null?(v)) { + var (r, ok) = __tact_dict_delete(d, kl, k); + return (r, (ok)); +} else { + return dict_replace_builder?(d, kl, k, begin_cell().store_coins(v)); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_replace_slice_coins", + "signature": "(cell, (int)) __tact_dict_replace_slice_coins(cell d, int kl, slice k, int v)", + }, + { + "code": { + "code": "var (old, ok) = null?(v) ? d~__tact_dict_delete_get(kl, k) : d~dict_replaceget?(kl, k, begin_cell().store_coins(v).end_cell().begin_parse()); +if (ok) { + return (d, old~load_coins()); +} else { + return (d, null()); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete_get", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_replaceget_slice_coins", + "signature": "(cell, (int)) __tact_dict_replaceget_slice_coins(cell d, int kl, slice k, int v)", + }, { "code": { "code": "var (r, ok) = udict_get?(d, kl, k); @@ -2699,6 +2825,120 @@ if (ok) { "name": "__tact_dict_replaceget_uint_cell", "signature": "(cell, (cell)) __tact_dict_replaceget_uint_cell(cell d, int kl, int k, cell v)", }, + { + "code": { + "code": "var (r, ok) = udict_get?(d, kl, k); +if (ok) { + return r~load_coins(); +} else { + return null(); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_dict_get_uint_coins", + "signature": "int __tact_dict_get_uint_coins(cell d, int kl, int k)", + }, + { + "code": { + "code": "var (key, value, flag) = udict_get_min?(d, kl); +if (flag) { + return (key, value~load_coins(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_dict_min_uint_coins", + "signature": "(int, int, int) __tact_dict_min_uint_coins(cell d, int kl)", + }, + { + "code": { + "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); +if (flag) { + return (key, value~load_coins(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_dict_next_uint_coins", + "signature": "(int, int, int) __tact_dict_next_uint_coins(cell d, int kl, int pivot)", + }, + { + "code": { + "code": "if (null?(v)) { + var (r, ok) = udict_delete?(d, kl, k); + return (r, ()); +} else { + return (udict_set_builder(d, kl, k, begin_cell().store_coins(v)), ()); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_dict_set_uint_coins", + "signature": "(cell, ()) __tact_dict_set_uint_coins(cell d, int kl, int k, int v)", + }, + { + "code": { + "code": "if (null?(v)) { + var (r, ok) = udict_delete?(d, kl, k); + return (r, (ok)); +} else { + return udict_replace_builder?(d, kl, k, begin_cell().store_coins(v)); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_dict_replace_uint_coins", + "signature": "(cell, (int)) __tact_dict_replace_uint_coins(cell d, int kl, int k, int v)", + }, + { + "code": { + "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, begin_cell().store_coins(v).end_cell().begin_parse()); +if (ok) { + return (d, old~load_coins()); +} else { + return (d, null()); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_dict_replaceget_uint_coins", + "signature": "(cell, (int)) __tact_dict_replaceget_uint_coins(cell d, int kl, int k, int v)", + }, { "code": { "code": "var (r, ok) = idict_get?(d, kl, k); @@ -3019,14 +3259,128 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_replace_int_uint", - "signature": "(cell, (int)) __tact_dict_replace_int_uint(cell d, int kl, int k, int v, int vl)", + "name": "__tact_dict_replace_int_uint", + "signature": "(cell, (int)) __tact_dict_replace_int_uint(cell d, int kl, int k, int v, int vl)", + }, + { + "code": { + "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, begin_cell().store_uint(v, vl).end_cell().begin_parse()); +if (ok) { + return (d, old~load_uint(vl)); +} else { + return (d, null()); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_dict_replaceget_int_uint", + "signature": "(cell, (int)) __tact_dict_replaceget_int_uint(cell d, int kl, int k, int v, int vl)", + }, + { + "code": { + "code": "var (r, ok) = idict_get_ref?(d, kl, k); +if (ok) { + return r; +} else { + return null(); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_dict_get_int_cell", + "signature": "cell __tact_dict_get_int_cell(cell d, int kl, int k)", + }, + { + "code": { + "code": "var (key, value, flag) = idict_get_min_ref?(d, kl); +if (flag) { + return (key, value, flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_dict_min_int_cell", + "signature": "(int, cell, int) __tact_dict_min_int_cell(cell d, int kl)", + }, + { + "code": { + "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); +if (flag) { + return (key, value~load_ref(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_dict_next_int_cell", + "signature": "(int, cell, int) __tact_dict_next_int_cell(cell d, int kl, int pivot)", + }, + { + "code": { + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, ()); +} else { + return (idict_set_ref(d, kl, k, v), ()); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_dict_set_int_cell", + "signature": "(cell, ()) __tact_dict_set_int_cell(cell d, int kl, int k, cell v)", + }, + { + "code": { + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, (ok)); +} else { + return idict_replace_ref?(d, kl, k, v); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_dict_replace_int_cell", + "signature": "(cell, (int)) __tact_dict_replace_int_cell(cell d, int kl, int k, cell v)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, begin_cell().store_uint(v, vl).end_cell().begin_parse()); + "code": "var (old, ok) = null?(v) ? d~idict_delete_get_ref?(kl, k) : d~idict_replaceget_ref?(kl, k, v); if (ok) { - return (d, old~load_uint(vl)); + return (d, old); } else { return (d, null()); }", @@ -3038,14 +3392,14 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_int_uint", - "signature": "(cell, (int)) __tact_dict_replaceget_int_uint(cell d, int kl, int k, int v, int vl)", + "name": "__tact_dict_replaceget_int_cell", + "signature": "(cell, (cell)) __tact_dict_replaceget_int_cell(cell d, int kl, int k, cell v)", }, { "code": { - "code": "var (r, ok) = idict_get_ref?(d, kl, k); + "code": "var (r, ok) = idict_get?(d, kl, k); if (ok) { - return r; + return r~load_coins(); } else { return null(); }", @@ -3057,14 +3411,14 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_get_int_cell", - "signature": "cell __tact_dict_get_int_cell(cell d, int kl, int k)", + "name": "__tact_dict_get_int_coins", + "signature": "int __tact_dict_get_int_coins(cell d, int kl, int k)", }, { "code": { - "code": "var (key, value, flag) = idict_get_min_ref?(d, kl); + "code": "var (key, value, flag) = idict_get_min?(d, kl); if (flag) { - return (key, value, flag); + return (key, value~load_coins(), flag); } else { return (null(), null(), flag); }", @@ -3076,14 +3430,14 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_min_int_cell", - "signature": "(int, cell, int) __tact_dict_min_int_cell(cell d, int kl)", + "name": "__tact_dict_min_int_coins", + "signature": "(int, int, int) __tact_dict_min_int_coins(cell d, int kl)", }, { "code": { "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); if (flag) { - return (key, value~load_ref(), flag); + return (key, value~load_coins(), flag); } else { return (null(), null(), flag); }", @@ -3095,8 +3449,8 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_next_int_cell", - "signature": "(int, cell, int) __tact_dict_next_int_cell(cell d, int kl, int pivot)", + "name": "__tact_dict_next_int_coins", + "signature": "(int, int, int) __tact_dict_next_int_coins(cell d, int kl, int pivot)", }, { "code": { @@ -3104,7 +3458,7 @@ if (flag) { var (r, ok) = idict_delete?(d, kl, k); return (r, ()); } else { - return (idict_set_ref(d, kl, k, v), ()); + return (idict_set_builder(d, kl, k, begin_cell().store_coins(v)), ()); }", "kind": "generic", }, @@ -3114,8 +3468,8 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_set_int_cell", - "signature": "(cell, ()) __tact_dict_set_int_cell(cell d, int kl, int k, cell v)", + "name": "__tact_dict_set_int_coins", + "signature": "(cell, ()) __tact_dict_set_int_coins(cell d, int kl, int k, int v)", }, { "code": { @@ -3123,7 +3477,7 @@ if (flag) { var (r, ok) = idict_delete?(d, kl, k); return (r, (ok)); } else { - return idict_replace_ref?(d, kl, k, v); + return idict_replace_builder?(d, kl, k, begin_cell().store_coins(v)); }", "kind": "generic", }, @@ -3133,14 +3487,14 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_replace_int_cell", - "signature": "(cell, (int)) __tact_dict_replace_int_cell(cell d, int kl, int k, cell v)", + "name": "__tact_dict_replace_int_coins", + "signature": "(cell, (int)) __tact_dict_replace_int_coins(cell d, int kl, int k, int v)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~idict_delete_get_ref?(kl, k) : d~idict_replaceget_ref?(kl, k, v); + "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, begin_cell().store_coins(v).end_cell().begin_parse()); if (ok) { - return (d, old); + return (d, old~load_coins()); } else { return (d, null()); }", @@ -3152,8 +3506,8 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_int_cell", - "signature": "(cell, (cell)) __tact_dict_replaceget_int_cell(cell d, int kl, int k, cell v)", + "name": "__tact_dict_replaceget_int_coins", + "signature": "(cell, (int)) __tact_dict_replaceget_int_coins(cell d, int kl, int k, int v)", }, { "code": { @@ -6315,6 +6669,132 @@ if (ok) { "name": "__tact_dict_replaceget_slice_cell", "signature": "(cell, (cell)) __tact_dict_replaceget_slice_cell(cell d, int kl, slice k, cell v)", }, + { + "code": { + "code": "var (r, ok) = __tact_dict_get(d, kl, k); +if (ok) { + return r~load_coins(); +} else { + return null(); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_get", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_get_slice_coins", + "signature": "int __tact_dict_get_slice_coins(cell d, int kl, slice k)", + }, + { + "code": { + "code": "var (key, value, flag) = __tact_dict_min(d, kl); +if (flag) { + return (key, value~load_coins(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_min", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_min_slice_coins", + "signature": "(slice, int, int) __tact_dict_min_slice_coins(cell d, int kl)", + }, + { + "code": { + "code": "var (key, value, flag) = __tact_dict_next(d, kl, pivot); +if (flag) { + return (key, value~load_coins(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_next", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_next_slice_coins", + "signature": "(slice, int, int) __tact_dict_next_slice_coins(cell d, int kl, slice pivot)", + }, + { + "code": { + "code": "if (null?(v)) { + var (r, ok) = __tact_dict_delete(d, kl, k); + return (r, ()); +} else { + return (dict_set_builder(d, kl, k, begin_cell().store_coins(v)), ()); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_set_slice_coins", + "signature": "(cell, ()) __tact_dict_set_slice_coins(cell d, int kl, slice k, int v)", + }, + { + "code": { + "code": "if (null?(v)) { + var (r, ok) = __tact_dict_delete(d, kl, k); + return (r, (ok)); +} else { + return dict_replace_builder?(d, kl, k, begin_cell().store_coins(v)); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_replace_slice_coins", + "signature": "(cell, (int)) __tact_dict_replace_slice_coins(cell d, int kl, slice k, int v)", + }, + { + "code": { + "code": "var (old, ok) = null?(v) ? d~__tact_dict_delete_get(kl, k) : d~dict_replaceget?(kl, k, begin_cell().store_coins(v).end_cell().begin_parse()); +if (ok) { + return (d, old~load_coins()); +} else { + return (d, null()); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete_get", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_replaceget_slice_coins", + "signature": "(cell, (int)) __tact_dict_replaceget_slice_coins(cell d, int kl, slice k, int v)", + }, { "code": { "code": "var (r, ok) = udict_get?(d, kl, k); @@ -6625,7 +7105,121 @@ if (flag) { var (r, ok) = udict_delete?(d, kl, k); return (r, (ok)); } else { - return udict_replace_builder?(d, kl, k, begin_cell().store_uint(v, vl)); + return udict_replace_builder?(d, kl, k, begin_cell().store_uint(v, vl)); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_dict_replace_uint_uint", + "signature": "(cell, (int)) __tact_dict_replace_uint_uint(cell d, int kl, int k, int v, int vl)", + }, + { + "code": { + "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, begin_cell().store_uint(v, vl).end_cell().begin_parse()); +if (ok) { + return (d, old~load_uint(vl)); +} else { + return (d, null()); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_dict_replaceget_uint_uint", + "signature": "(cell, (int)) __tact_dict_replaceget_uint_uint(cell d, int kl, int k, int v, int vl)", + }, + { + "code": { + "code": "var (r, ok) = udict_get_ref?(d, kl, k); +if (ok) { + return r; +} else { + return null(); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_dict_get_uint_cell", + "signature": "cell __tact_dict_get_uint_cell(cell d, int kl, int k)", + }, + { + "code": { + "code": "var (key, value, flag) = udict_get_min_ref?(d, kl); +if (flag) { + return (key, value, flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_dict_min_uint_cell", + "signature": "(int, cell, int) __tact_dict_min_uint_cell(cell d, int kl)", + }, + { + "code": { + "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); +if (flag) { + return (key, value~load_ref(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_dict_next_uint_cell", + "signature": "(int, cell, int) __tact_dict_next_uint_cell(cell d, int kl, int pivot)", + }, + { + "code": { + "code": "if (null?(v)) { + var (r, ok) = udict_delete?(d, kl, k); + return (r, ()); +} else { + return (udict_set_ref(d, kl, k, v), ()); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_dict_set_uint_cell", + "signature": "(cell, ()) __tact_dict_set_uint_cell(cell d, int kl, int k, cell v)", + }, + { + "code": { + "code": "if (null?(v)) { + var (r, ok) = udict_delete?(d, kl, k); + return (r, (ok)); +} else { + return udict_replace_ref?(d, kl, k, v); }", "kind": "generic", }, @@ -6635,14 +7229,14 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_replace_uint_uint", - "signature": "(cell, (int)) __tact_dict_replace_uint_uint(cell d, int kl, int k, int v, int vl)", + "name": "__tact_dict_replace_uint_cell", + "signature": "(cell, (int)) __tact_dict_replace_uint_cell(cell d, int kl, int k, cell v)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, begin_cell().store_uint(v, vl).end_cell().begin_parse()); + "code": "var (old, ok) = null?(v) ? d~udict_delete_get_ref?(kl, k) : d~udict_replaceget_ref?(kl, k, v); if (ok) { - return (d, old~load_uint(vl)); + return (d, old); } else { return (d, null()); }", @@ -6654,14 +7248,14 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_uint_uint", - "signature": "(cell, (int)) __tact_dict_replaceget_uint_uint(cell d, int kl, int k, int v, int vl)", + "name": "__tact_dict_replaceget_uint_cell", + "signature": "(cell, (cell)) __tact_dict_replaceget_uint_cell(cell d, int kl, int k, cell v)", }, { "code": { - "code": "var (r, ok) = udict_get_ref?(d, kl, k); + "code": "var (r, ok) = udict_get?(d, kl, k); if (ok) { - return r; + return r~load_coins(); } else { return null(); }", @@ -6673,14 +7267,14 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_get_uint_cell", - "signature": "cell __tact_dict_get_uint_cell(cell d, int kl, int k)", + "name": "__tact_dict_get_uint_coins", + "signature": "int __tact_dict_get_uint_coins(cell d, int kl, int k)", }, { "code": { - "code": "var (key, value, flag) = udict_get_min_ref?(d, kl); + "code": "var (key, value, flag) = udict_get_min?(d, kl); if (flag) { - return (key, value, flag); + return (key, value~load_coins(), flag); } else { return (null(), null(), flag); }", @@ -6692,14 +7286,14 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_min_uint_cell", - "signature": "(int, cell, int) __tact_dict_min_uint_cell(cell d, int kl)", + "name": "__tact_dict_min_uint_coins", + "signature": "(int, int, int) __tact_dict_min_uint_coins(cell d, int kl)", }, { "code": { "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); if (flag) { - return (key, value~load_ref(), flag); + return (key, value~load_coins(), flag); } else { return (null(), null(), flag); }", @@ -6711,8 +7305,8 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_next_uint_cell", - "signature": "(int, cell, int) __tact_dict_next_uint_cell(cell d, int kl, int pivot)", + "name": "__tact_dict_next_uint_coins", + "signature": "(int, int, int) __tact_dict_next_uint_coins(cell d, int kl, int pivot)", }, { "code": { @@ -6720,7 +7314,7 @@ if (flag) { var (r, ok) = udict_delete?(d, kl, k); return (r, ()); } else { - return (udict_set_ref(d, kl, k, v), ()); + return (udict_set_builder(d, kl, k, begin_cell().store_coins(v)), ()); }", "kind": "generic", }, @@ -6730,8 +7324,8 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_set_uint_cell", - "signature": "(cell, ()) __tact_dict_set_uint_cell(cell d, int kl, int k, cell v)", + "name": "__tact_dict_set_uint_coins", + "signature": "(cell, ()) __tact_dict_set_uint_coins(cell d, int kl, int k, int v)", }, { "code": { @@ -6739,7 +7333,7 @@ if (flag) { var (r, ok) = udict_delete?(d, kl, k); return (r, (ok)); } else { - return udict_replace_ref?(d, kl, k, v); + return udict_replace_builder?(d, kl, k, begin_cell().store_coins(v)); }", "kind": "generic", }, @@ -6749,14 +7343,14 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_replace_uint_cell", - "signature": "(cell, (int)) __tact_dict_replace_uint_cell(cell d, int kl, int k, cell v)", + "name": "__tact_dict_replace_uint_coins", + "signature": "(cell, (int)) __tact_dict_replace_uint_coins(cell d, int kl, int k, int v)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~udict_delete_get_ref?(kl, k) : d~udict_replaceget_ref?(kl, k, v); + "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, begin_cell().store_coins(v).end_cell().begin_parse()); if (ok) { - return (d, old); + return (d, old~load_coins()); } else { return (d, null()); }", @@ -6768,8 +7362,8 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_uint_cell", - "signature": "(cell, (cell)) __tact_dict_replaceget_uint_cell(cell d, int kl, int k, cell v)", + "name": "__tact_dict_replaceget_uint_coins", + "signature": "(cell, (int)) __tact_dict_replaceget_uint_coins(cell d, int kl, int k, int v)", }, { "code": { @@ -7227,6 +7821,120 @@ if (ok) { "name": "__tact_dict_replaceget_int_cell", "signature": "(cell, (cell)) __tact_dict_replaceget_int_cell(cell d, int kl, int k, cell v)", }, + { + "code": { + "code": "var (r, ok) = idict_get?(d, kl, k); +if (ok) { + return r~load_coins(); +} else { + return null(); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_dict_get_int_coins", + "signature": "int __tact_dict_get_int_coins(cell d, int kl, int k)", + }, + { + "code": { + "code": "var (key, value, flag) = idict_get_min?(d, kl); +if (flag) { + return (key, value~load_coins(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_dict_min_int_coins", + "signature": "(int, int, int) __tact_dict_min_int_coins(cell d, int kl)", + }, + { + "code": { + "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); +if (flag) { + return (key, value~load_coins(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_dict_next_int_coins", + "signature": "(int, int, int) __tact_dict_next_int_coins(cell d, int kl, int pivot)", + }, + { + "code": { + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, ()); +} else { + return (idict_set_builder(d, kl, k, begin_cell().store_coins(v)), ()); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_dict_set_int_coins", + "signature": "(cell, ()) __tact_dict_set_int_coins(cell d, int kl, int k, int v)", + }, + { + "code": { + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, (ok)); +} else { + return idict_replace_builder?(d, kl, k, begin_cell().store_coins(v)); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_dict_replace_int_coins", + "signature": "(cell, (int)) __tact_dict_replace_int_coins(cell d, int kl, int k, int v)", + }, + { + "code": { + "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, begin_cell().store_coins(v).end_cell().begin_parse()); +if (ok) { + return (d, old~load_coins()); +} else { + return (d, null()); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_dict_replaceget_int_coins", + "signature": "(cell, (int)) __tact_dict_replaceget_int_coins(cell d, int kl, int k, int v)", + }, { "code": { "code": "var (r, ok) = __tact_dict_get(d, kl, k); @@ -10178,7 +10886,133 @@ if (flag) { "code": { "code": "var (key, value, flag) = __tact_dict_next(d, kl, pivot); if (flag) { - return (key, value~load_uint(vl), flag); + return (key, value~load_uint(vl), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_next", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_next_slice_uint", + "signature": "(slice, int, int) __tact_dict_next_slice_uint(cell d, int kl, slice pivot, int vl)", + }, + { + "code": { + "code": "if (null?(v)) { + var (r, ok) = __tact_dict_delete(d, kl, k); + return (r, ()); +} else { + return (dict_set_builder(d, kl, k, begin_cell().store_uint(v, vl)), ()); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_set_slice_uint", + "signature": "(cell, ()) __tact_dict_set_slice_uint(cell d, int kl, slice k, int v, int vl)", + }, + { + "code": { + "code": "if (null?(v)) { + var (r, ok) = __tact_dict_delete(d, kl, k); + return (r, (ok)); +} else { + return dict_replace_builder?(d, kl, k, begin_cell().store_uint(v, vl)); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_replace_slice_uint", + "signature": "(cell, (int)) __tact_dict_replace_slice_uint(cell d, int kl, slice k, int v, int vl)", + }, + { + "code": { + "code": "var (old, ok) = null?(v) ? d~__tact_dict_delete_get(kl, k) : d~dict_replaceget?(kl, k, begin_cell().store_uint(v, vl).end_cell().begin_parse()); +if (ok) { + return (d, old~load_uint(vl)); +} else { + return (d, null()); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete_get", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_replaceget_slice_uint", + "signature": "(cell, (int)) __tact_dict_replaceget_slice_uint(cell d, int kl, slice k, int v, int vl)", + }, + { + "code": { + "code": "var (r, ok) = __tact_dict_get_ref(d, kl, k); +if (ok) { + return r; +} else { + return null(); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_get_ref", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_get_slice_cell", + "signature": "cell __tact_dict_get_slice_cell(cell d, int kl, slice k)", + }, + { + "code": { + "code": "var (key, value, flag) = __tact_dict_min_ref(d, kl); +if (flag) { + return (key, value, flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_min_ref", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_min_slice_cell", + "signature": "(slice, cell, int) __tact_dict_min_slice_cell(cell d, int kl)", + }, + { + "code": { + "code": "var (key, value, flag) = __tact_dict_next(d, kl, pivot); +if (flag) { + return (key, value~load_ref(), flag); } else { return (null(), null(), flag); }", @@ -10192,8 +11026,8 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_next_slice_uint", - "signature": "(slice, int, int) __tact_dict_next_slice_uint(cell d, int kl, slice pivot, int vl)", + "name": "__tact_dict_next_slice_cell", + "signature": "(slice, cell, int) __tact_dict_next_slice_cell(cell d, int kl, slice pivot)", }, { "code": { @@ -10201,7 +11035,7 @@ if (flag) { var (r, ok) = __tact_dict_delete(d, kl, k); return (r, ()); } else { - return (dict_set_builder(d, kl, k, begin_cell().store_uint(v, vl)), ()); + return __tact_dict_set_ref(d, kl, k, v); }", "kind": "generic", }, @@ -10209,12 +11043,13 @@ if (flag) { "context": "stdlib", "depends": Set { "__tact_dict_delete", + "__tact_dict_set_ref", }, "flags": Set { "inline", }, - "name": "__tact_dict_set_slice_uint", - "signature": "(cell, ()) __tact_dict_set_slice_uint(cell d, int kl, slice k, int v, int vl)", + "name": "__tact_dict_set_slice_cell", + "signature": "(cell, ()) __tact_dict_set_slice_cell(cell d, int kl, slice k, cell v)", }, { "code": { @@ -10222,7 +11057,7 @@ if (flag) { var (r, ok) = __tact_dict_delete(d, kl, k); return (r, (ok)); } else { - return dict_replace_builder?(d, kl, k, begin_cell().store_uint(v, vl)); + return __tact_dict_replace_ref(d, kl, k, v); }", "kind": "generic", }, @@ -10230,18 +11065,19 @@ if (flag) { "context": "stdlib", "depends": Set { "__tact_dict_delete", + "__tact_dict_replace_ref", }, "flags": Set { "inline", }, - "name": "__tact_dict_replace_slice_uint", - "signature": "(cell, (int)) __tact_dict_replace_slice_uint(cell d, int kl, slice k, int v, int vl)", + "name": "__tact_dict_replace_slice_cell", + "signature": "(cell, (int)) __tact_dict_replace_slice_cell(cell d, int kl, slice k, cell v)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~__tact_dict_delete_get(kl, k) : d~dict_replaceget?(kl, k, begin_cell().store_uint(v, vl).end_cell().begin_parse()); + "code": "var (old, ok) = null?(v) ? d~__tact_dict_delete_get_ref(kl, k) : d~__tact_dict_replaceget_ref(kl, k, v); if (ok) { - return (d, old~load_uint(vl)); + return (d, old); } else { return (d, null()); }", @@ -10250,19 +11086,20 @@ if (ok) { "comment": null, "context": "stdlib", "depends": Set { - "__tact_dict_delete_get", + "__tact_dict_delete_get_ref", + "__tact_dict_replaceget_ref", }, "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_slice_uint", - "signature": "(cell, (int)) __tact_dict_replaceget_slice_uint(cell d, int kl, slice k, int v, int vl)", + "name": "__tact_dict_replaceget_slice_cell", + "signature": "(cell, (cell)) __tact_dict_replaceget_slice_cell(cell d, int kl, slice k, cell v)", }, { "code": { - "code": "var (r, ok) = __tact_dict_get_ref(d, kl, k); + "code": "var (r, ok) = __tact_dict_get(d, kl, k); if (ok) { - return r; + return r~load_coins(); } else { return null(); }", @@ -10271,19 +11108,19 @@ if (ok) { "comment": null, "context": "stdlib", "depends": Set { - "__tact_dict_get_ref", + "__tact_dict_get", }, "flags": Set { "inline", }, - "name": "__tact_dict_get_slice_cell", - "signature": "cell __tact_dict_get_slice_cell(cell d, int kl, slice k)", + "name": "__tact_dict_get_slice_coins", + "signature": "int __tact_dict_get_slice_coins(cell d, int kl, slice k)", }, { "code": { - "code": "var (key, value, flag) = __tact_dict_min_ref(d, kl); + "code": "var (key, value, flag) = __tact_dict_min(d, kl); if (flag) { - return (key, value, flag); + return (key, value~load_coins(), flag); } else { return (null(), null(), flag); }", @@ -10292,19 +11129,19 @@ if (flag) { "comment": null, "context": "stdlib", "depends": Set { - "__tact_dict_min_ref", + "__tact_dict_min", }, "flags": Set { "inline", }, - "name": "__tact_dict_min_slice_cell", - "signature": "(slice, cell, int) __tact_dict_min_slice_cell(cell d, int kl)", + "name": "__tact_dict_min_slice_coins", + "signature": "(slice, int, int) __tact_dict_min_slice_coins(cell d, int kl)", }, { "code": { "code": "var (key, value, flag) = __tact_dict_next(d, kl, pivot); if (flag) { - return (key, value~load_ref(), flag); + return (key, value~load_coins(), flag); } else { return (null(), null(), flag); }", @@ -10318,8 +11155,8 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_next_slice_cell", - "signature": "(slice, cell, int) __tact_dict_next_slice_cell(cell d, int kl, slice pivot)", + "name": "__tact_dict_next_slice_coins", + "signature": "(slice, int, int) __tact_dict_next_slice_coins(cell d, int kl, slice pivot)", }, { "code": { @@ -10327,7 +11164,7 @@ if (flag) { var (r, ok) = __tact_dict_delete(d, kl, k); return (r, ()); } else { - return __tact_dict_set_ref(d, kl, k, v); + return (dict_set_builder(d, kl, k, begin_cell().store_coins(v)), ()); }", "kind": "generic", }, @@ -10335,13 +11172,12 @@ if (flag) { "context": "stdlib", "depends": Set { "__tact_dict_delete", - "__tact_dict_set_ref", }, "flags": Set { "inline", }, - "name": "__tact_dict_set_slice_cell", - "signature": "(cell, ()) __tact_dict_set_slice_cell(cell d, int kl, slice k, cell v)", + "name": "__tact_dict_set_slice_coins", + "signature": "(cell, ()) __tact_dict_set_slice_coins(cell d, int kl, slice k, int v)", }, { "code": { @@ -10349,7 +11185,7 @@ if (flag) { var (r, ok) = __tact_dict_delete(d, kl, k); return (r, (ok)); } else { - return __tact_dict_replace_ref(d, kl, k, v); + return dict_replace_builder?(d, kl, k, begin_cell().store_coins(v)); }", "kind": "generic", }, @@ -10357,19 +11193,18 @@ if (flag) { "context": "stdlib", "depends": Set { "__tact_dict_delete", - "__tact_dict_replace_ref", }, "flags": Set { "inline", }, - "name": "__tact_dict_replace_slice_cell", - "signature": "(cell, (int)) __tact_dict_replace_slice_cell(cell d, int kl, slice k, cell v)", + "name": "__tact_dict_replace_slice_coins", + "signature": "(cell, (int)) __tact_dict_replace_slice_coins(cell d, int kl, slice k, int v)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~__tact_dict_delete_get_ref(kl, k) : d~__tact_dict_replaceget_ref(kl, k, v); + "code": "var (old, ok) = null?(v) ? d~__tact_dict_delete_get(kl, k) : d~dict_replaceget?(kl, k, begin_cell().store_coins(v).end_cell().begin_parse()); if (ok) { - return (d, old); + return (d, old~load_coins()); } else { return (d, null()); }", @@ -10378,14 +11213,13 @@ if (ok) { "comment": null, "context": "stdlib", "depends": Set { - "__tact_dict_delete_get_ref", - "__tact_dict_replaceget_ref", + "__tact_dict_delete_get", }, "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_slice_cell", - "signature": "(cell, (cell)) __tact_dict_replaceget_slice_cell(cell d, int kl, slice k, cell v)", + "name": "__tact_dict_replaceget_slice_coins", + "signature": "(cell, (int)) __tact_dict_replaceget_slice_coins(cell d, int kl, slice k, int v)", }, { "code": { @@ -10843,6 +11677,120 @@ if (ok) { "name": "__tact_dict_replaceget_uint_cell", "signature": "(cell, (cell)) __tact_dict_replaceget_uint_cell(cell d, int kl, int k, cell v)", }, + { + "code": { + "code": "var (r, ok) = udict_get?(d, kl, k); +if (ok) { + return r~load_coins(); +} else { + return null(); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_dict_get_uint_coins", + "signature": "int __tact_dict_get_uint_coins(cell d, int kl, int k)", + }, + { + "code": { + "code": "var (key, value, flag) = udict_get_min?(d, kl); +if (flag) { + return (key, value~load_coins(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_dict_min_uint_coins", + "signature": "(int, int, int) __tact_dict_min_uint_coins(cell d, int kl)", + }, + { + "code": { + "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); +if (flag) { + return (key, value~load_coins(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_dict_next_uint_coins", + "signature": "(int, int, int) __tact_dict_next_uint_coins(cell d, int kl, int pivot)", + }, + { + "code": { + "code": "if (null?(v)) { + var (r, ok) = udict_delete?(d, kl, k); + return (r, ()); +} else { + return (udict_set_builder(d, kl, k, begin_cell().store_coins(v)), ()); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_dict_set_uint_coins", + "signature": "(cell, ()) __tact_dict_set_uint_coins(cell d, int kl, int k, int v)", + }, + { + "code": { + "code": "if (null?(v)) { + var (r, ok) = udict_delete?(d, kl, k); + return (r, (ok)); +} else { + return udict_replace_builder?(d, kl, k, begin_cell().store_coins(v)); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_dict_replace_uint_coins", + "signature": "(cell, (int)) __tact_dict_replace_uint_coins(cell d, int kl, int k, int v)", + }, + { + "code": { + "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, begin_cell().store_coins(v).end_cell().begin_parse()); +if (ok) { + return (d, old~load_coins()); +} else { + return (d, null()); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_dict_replaceget_uint_coins", + "signature": "(cell, (int)) __tact_dict_replaceget_uint_coins(cell d, int kl, int k, int v)", + }, { "code": { "code": "var (r, ok) = idict_get?(d, kl, k); @@ -11299,6 +12247,120 @@ if (ok) { "name": "__tact_dict_replaceget_int_cell", "signature": "(cell, (cell)) __tact_dict_replaceget_int_cell(cell d, int kl, int k, cell v)", }, + { + "code": { + "code": "var (r, ok) = idict_get?(d, kl, k); +if (ok) { + return r~load_coins(); +} else { + return null(); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_dict_get_int_coins", + "signature": "int __tact_dict_get_int_coins(cell d, int kl, int k)", + }, + { + "code": { + "code": "var (key, value, flag) = idict_get_min?(d, kl); +if (flag) { + return (key, value~load_coins(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_dict_min_int_coins", + "signature": "(int, int, int) __tact_dict_min_int_coins(cell d, int kl)", + }, + { + "code": { + "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); +if (flag) { + return (key, value~load_coins(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_dict_next_int_coins", + "signature": "(int, int, int) __tact_dict_next_int_coins(cell d, int kl, int pivot)", + }, + { + "code": { + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, ()); +} else { + return (idict_set_builder(d, kl, k, begin_cell().store_coins(v)), ()); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_dict_set_int_coins", + "signature": "(cell, ()) __tact_dict_set_int_coins(cell d, int kl, int k, int v)", + }, + { + "code": { + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, (ok)); +} else { + return idict_replace_builder?(d, kl, k, begin_cell().store_coins(v)); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_dict_replace_int_coins", + "signature": "(cell, (int)) __tact_dict_replace_int_coins(cell d, int kl, int k, int v)", + }, + { + "code": { + "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, begin_cell().store_coins(v).end_cell().begin_parse()); +if (ok) { + return (d, old~load_coins()); +} else { + return (d, null()); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_dict_replaceget_int_coins", + "signature": "(cell, (int)) __tact_dict_replaceget_int_coins(cell d, int kl, int k, int v)", + }, { "code": { "code": "var (r, ok) = __tact_dict_get(d, kl, k); From b34c29eab4421d11099b0121f9453f0db6a914a9 Mon Sep 17 00:00:00 2001 From: Gusarich Date: Sat, 2 Nov 2024 10:33:47 +0400 Subject: [PATCH 7/9] chore: add `varuint` to cspell ignorelist --- cspell.json | 1 + 1 file changed, 1 insertion(+) diff --git a/cspell.json b/cspell.json index d43b9ea1f..90d2f5036 100644 --- a/cspell.json +++ b/cspell.json @@ -114,6 +114,7 @@ "uintptr", "uninit", "unixfs", + "varuint", "workchain", "xffff", "привет" From 4bbbb16f9970ed2e4efc65963025349cd8d99ea4 Mon Sep 17 00:00:00 2001 From: Gusarich Date: Sat, 2 Nov 2024 11:12:08 +0400 Subject: [PATCH 8/9] chore: refactor signature key and value types getting into helper functions --- src/generator/writers/writeStdlib.ts | 46 +++++++++++++++------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/src/generator/writers/writeStdlib.ts b/src/generator/writers/writeStdlib.ts index 69833fd1a..790a4e5f1 100644 --- a/src/generator/writers/writeStdlib.ts +++ b/src/generator/writers/writeStdlib.ts @@ -1155,14 +1155,21 @@ type KeyType = (typeof keyTypes)[number]; const valTypes = ["slice", "int", "uint", "cell", "coins"] as const; type ValType = (typeof valTypes)[number]; +function getSignatureKeyType(key: KeyType): KeyType { + return key === "uint" ? "int" : key; +} + +function getSignatureValueType(value: ValType): ValType { + return value === "uint" || value === "coins" ? "int" : value; +} + function genTactDictGet( ctx: WriterContext, key: KeyType, value: ValType, ): void { - const signatureKeyType = key === "uint" ? "int" : key; - const signatureRetType = - value === "uint" || value === "coins" ? "int" : value; + const signatureKeyType = getSignatureKeyType(key); + const signatureValueType = getSignatureValueType(value); const dictGet = () => { const cellSuffix = value === "cell" ? "_ref" : ""; switch (key) { @@ -1200,7 +1207,7 @@ function genTactDictGet( }; ctx.fun(`__tact_dict_get_${key}_${value}`, () => { ctx.signature( - `${signatureRetType} __tact_dict_get_${key}_${value}(cell d, int kl, ${signatureKeyType} k${valBitsArg()})`, + `${signatureValueType} __tact_dict_get_${key}_${value}(cell d, int kl, ${signatureKeyType} k${valBitsArg()})`, ); ctx.flag("inline"); ctx.context("stdlib"); @@ -1218,7 +1225,7 @@ function genTactDictGet( } function genTactDictExists(ctx: WriterContext, key: KeyType): void { - const signatureKeyType = key === "uint" ? "int" : key; + const signatureKeyType = getSignatureKeyType(key); const dictGet = () => { switch (key) { case "slice": @@ -1249,9 +1256,8 @@ function genTactDictSet( key: KeyType, value: ValType, ): void { - const signatureKeyType = key === "uint" ? "int" : key; - const signatureValueType = - value === "uint" || value === "coins" ? "int" : value; + const signatureKeyType = getSignatureKeyType(key); + const signatureValueType = getSignatureValueType(value); const valBitsArg = () => { switch (value) { case "slice": @@ -1335,9 +1341,8 @@ function genTactDictGetMin( key: KeyType, value: ValType, ): void { - const signatureKeyType = key === "uint" ? "int" : key; - const signatureValType = - value === "uint" || value === "coins" ? "int" : value; + const signatureKeyType = getSignatureKeyType(key); + const signatureValueType = getSignatureValueType(value); const valBitsArg = () => { switch (value) { case "slice": @@ -1393,7 +1398,7 @@ function genTactDictGetMin( }; ctx.fun(`__tact_dict_min_${key}_${value}`, () => { ctx.signature( - `(${signatureKeyType}, ${signatureValType}, int) __tact_dict_min_${key}_${value}(cell d, int kl${valBitsArg()})`, + `(${signatureKeyType}, ${signatureValueType}, int) __tact_dict_min_${key}_${value}(cell d, int kl${valBitsArg()})`, ); ctx.flag("inline"); ctx.context("stdlib"); @@ -1415,9 +1420,8 @@ function genTactDictGetNext( key: KeyType, value: ValType, ): void { - const signatureKeyType = key === "uint" ? "int" : key; - const signatureValType = - value === "uint" || value === "coins" ? "int" : value; + const signatureKeyType = getSignatureKeyType(key); + const signatureValueType = getSignatureValueType(value); const valBitsArg = () => { switch (value) { case "slice": @@ -1455,7 +1459,7 @@ function genTactDictGetNext( }; ctx.fun(`__tact_dict_next_${key}_${value}`, () => { ctx.signature( - `(${signatureKeyType}, ${signatureValType}, int) __tact_dict_next_${key}_${value}(cell d, int kl, ${signatureKeyType} pivot${valBitsArg()})`, + `(${signatureKeyType}, ${signatureValueType}, int) __tact_dict_next_${key}_${value}(cell d, int kl, ${signatureKeyType} pivot${valBitsArg()})`, ); ctx.flag("inline"); ctx.context("stdlib"); @@ -1483,9 +1487,8 @@ function genTactDictReplace( key: KeyType, value: ValType, ): void { - const signatureKeyType = key === "uint" ? "int" : key; - const signatureValueType = - value === "uint" || value === "coins" ? "int" : value; + const signatureKeyType = getSignatureKeyType(key); + const signatureValueType = getSignatureValueType(value); const valBitsArg = () => { switch (value) { case "slice": @@ -1569,9 +1572,8 @@ function genTactDictReplaceGet( key: KeyType, value: ValType, ): void { - const signatureKeyType = key === "uint" ? "int" : key; - const signatureValueType = - value === "uint" || value === "coins" ? "int" : value; + const signatureKeyType = getSignatureKeyType(key); + const signatureValueType = getSignatureValueType(value); const valBitsArg = () => { switch (value) { case "slice": From 6f6fb713f1d02aebb564ceee1569880ba7052525 Mon Sep 17 00:00:00 2001 From: Gusarich Date: Sat, 2 Nov 2024 11:12:14 +0400 Subject: [PATCH 9/9] chore: update changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 51a8bd118..86ea8216a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,7 +20,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - The `SendDefaultMode` send mode constant to the standard library: PR [#1010](https://github.com/tact-lang/tact/pull/1010) - Docs: initial semi-automated Chinese translation of the documentation: PR [#942](https://github.com/tact-lang/tact/pull/942) - The `replace` and `replaceGet` methods for the `Map` type: PR [#941](https://github.com/tact-lang/tact/pull/941) -- `as coins` map value serialization type is now handled correctly: PR [#987](https://github.com/tact-lang/tact/pull/987) ### Changed @@ -37,6 +36,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Prevent inline code snippets from changing their background color: PR [#935](https://github.com/tact-lang/tact/pull/935) - Docs: correctly handle next and previous page links at the bottom of the pages when there's a separator item in the sidebar: PR [#949](https://github.com/tact-lang/tact/pull/949) - Docs: compilation of examples in `data-structures.mdx` and across Cookbook: PR [#917](https://github.com/tact-lang/tact/pull/917) +- `as coins` map value serialization type is now handled correctly: PR [#987](https://github.com/tact-lang/tact/pull/987) ### Release contributors