From 1d98c52172ee512a99be70606d91be4624bb4593 Mon Sep 17 00:00:00 2001 From: Gusarich Date: Mon, 18 Nov 2024 11:43:03 +0300 Subject: [PATCH] feat: `addressNone` --- CHANGELOG.md | 2 +- src/imports/stdlib.ts | 8 ++++---- stdlib/std/cells.tact | 2 ++ 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7bf2af3be..9dd6d46c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,7 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - The `replace` and `replaceGet` methods for the `Map` type: PR [#941](https://github.com/tact-lang/tact/pull/941) - Utility for logging errors in code that was supposed to be unreachable: PR [#991](https://github.com/tact-lang/tact/pull/991) - Docs: `preloadRef` method for the `Slice` type: PR [#1044](https://github.com/tact-lang/tact/pull/1044) -- New functions in stdlib from `stdlib.fc` and `math.fc`: `Builder.depth`, `Slice.skipLastBits`, `Slice.firstBits`, `Slice.lastBits`, `Slice.depth`, `Cell.computeDataSize`, `Slice.computeDataSize`, `Cell.depth`, `curLt`, `blockLt`, `setGasLimit`, `getSeed`, `setSeed`, `myCode`, `sign`, `mulrshift`, `mulrshift_round`, `mulrshift_ceil`, `sqrt`: PR [#986](https://github.com/tact-lang/tact/pull/986) +- New functions in stdlib from `stdlib.fc` and `math.fc`: `Builder.depth`, `Slice.skipLastBits`, `Slice.firstBits`, `Slice.lastBits`, `Slice.depth`, `Cell.computeDataSize`, `Slice.computeDataSize`, `Cell.depth`, `curLt`, `blockLt`, `setGasLimit`, `getSeed`, `setSeed`, `myCode`, `sign`, `mulrshift`, `mulrshift_round`, `mulrshift_ceil`, `sqrt`, `addressNone`: PR [#986](https://github.com/tact-lang/tact/pull/986) ### Changed diff --git a/src/imports/stdlib.ts b/src/imports/stdlib.ts index 74dbc7196..180164681 100644 --- a/src/imports/stdlib.ts +++ b/src/imports/stdlib.ts @@ -187,10 +187,10 @@ files['std/cells.tact'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6IENlbGwsIG1heENlbGxzOiBJbnQp' + + 'OiBEYXRhU2l6ZSB7IENEQVRBU0laRSBUUklQTEUgfQoKYXNtIGV4dGVuZHMgZnVuIGNvbXB1dGVEYXRhU2l6ZShzZWxmOiBTbGljZSwgbWF4Q2VsbHM6IEludCk6IERh' + + 'dGFTaXplIHsgU0RBVEFTSVpFIFRSSVBMRSB9Cgphc20gZXh0ZW5kcyBmdW4gZGVwdGgoc2VsZjogQ2VsbCk6IEludCB7IENERVBUSCB9Cgo='; files['std/config.tact'] = 'YXNtIGZ1biBnZXRDb25maWdQYXJhbShpZDogSW50KTogQ2VsbD8geyBDT05GSUdPUFRQQVJBTSB9Cg=='; files['std/context.tact'] = diff --git a/stdlib/std/cells.tact b/stdlib/std/cells.tact index 1b1f023a3..ff3e322d3 100644 --- a/stdlib/std/cells.tact +++ b/stdlib/std/cells.tact @@ -202,6 +202,8 @@ inline fun emptySlice(): Slice { return emptyCell().asSlice(); } +asm fun addressNone(): Address { b{00} PUSHSLICE } + struct DataSize { cells: Int; bits: Int;