Skip to content

Commit c2c467d

Browse files
committed
--wip-- [skip ci]
1 parent f107d06 commit c2c467d

File tree

2 files changed

+28
-6
lines changed

2 files changed

+28
-6
lines changed

components/ts-to-clar/src/clarity_std.rs

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use clarity::vm::{
22
functions::NativeFunctions,
3-
types::{StacksBlockInfoProperty, TypeSignature},
3+
types::{BurnBlockInfoProperty, StacksBlockInfoProperty, TypeSignature},
44
};
55
use std::{collections::HashMap, sync::LazyLock};
66

@@ -208,6 +208,28 @@ pub static FUNCTIONS: LazyLock<HashMap<&str, StdFunction>> = LazyLock::new(|| {
208208
_return_type: None,
209209
},
210210
),
211+
(
212+
"getBurnBlockInfo",
213+
StdFunction {
214+
name: GetBurnBlockInfo.get_name_str(),
215+
parameters: vec![
216+
(
217+
"prop-name",
218+
Parameter::Identifiers(BurnBlockInfoProperty::ALL_NAMES),
219+
),
220+
("burn-block-height", Parameter::Value(UIntType)),
221+
],
222+
_return_type: None,
223+
},
224+
),
225+
(
226+
"getTenureInfo",
227+
StdFunction {
228+
name: GetTenureInfo.get_name_str(),
229+
parameters: vec![("tenure-height", Parameter::Value(UIntType))],
230+
_return_type: None,
231+
},
232+
),
211233
])
212234
});
213235

components/ts-to-clar/src/expression_converter.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
use std::{cell::Cell, marker::PhantomData};
22

33
use clarity::vm::{
4+
ClarityName, Value as ClarityValue,
45
representations::{PreSymbolicExpression, PreSymbolicExpressionType},
56
types::TypeSignature,
6-
ClarityName, Value as ClarityValue,
77
};
88
use oxc_allocator::{Allocator, CloneIn};
99
use oxc_ast::ast::{self, Argument, Expression};
1010
use oxc_semantic::SemanticBuilder;
1111
use oxc_span::SourceType;
12-
use oxc_traverse::{traverse_mut, Ancestor, Traverse};
12+
use oxc_traverse::{Ancestor, Traverse, traverse_mut};
1313

1414
use crate::{
15-
clarity_std::{Parameter, FUNCTIONS, KEYWORDS_TYPES},
16-
parser::{IRFunction, IR},
15+
clarity_std::{FUNCTIONS, KEYWORDS_TYPES, Parameter},
16+
parser::{IR, IRFunction},
1717
to_kebab_case,
1818
types::ts_to_clar_type,
1919
};
@@ -208,7 +208,7 @@ impl<'a> StatementConverter<'a> {
208208
.push(PreSymbolicExpression::list(vec![atom(clar_func.name)]));
209209

210210
match func_name {
211-
"getStacksBlockInfo" => {
211+
"getStacksBlockInfo" | "getBurnBlockInfo" => {
212212
if let Some((_, Parameter::Identifiers(allowed_names))) = clar_func
213213
.parameters
214214
.iter()

0 commit comments

Comments
 (0)