From 42c37a97c76556760639a817a59e416f41224054 Mon Sep 17 00:00:00 2001 From: Michael Benfield Date: Mon, 9 Dec 2024 11:53:41 -0800 Subject: [PATCH] handle program literals for addresses --- interpreter/src/cursor.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/interpreter/src/cursor.rs b/interpreter/src/cursor.rs index 6777fcd7e4..793b8fe804 100644 --- a/interpreter/src/cursor.rs +++ b/interpreter/src/cursor.rs @@ -840,7 +840,14 @@ impl<'a> Cursor<'a> { GroupLiteral::Single(s, ..) => Value::Group(format!("{s}group").parse().expect_tc(literal.span())?), GroupLiteral::Tuple(_group_tuple) => todo!(), }, - Literal::Address(s, ..) => Value::Address(s.parse().expect_tc(literal.span())?), + Literal::Address(s, ..) => { + if s.ends_with(".aleo") { + let program_id = ProgramID::from_str(s)?; + Value::Address(program_id.to_address()?) + } else { + Value::Address(s.parse().expect_tc(literal.span())?) + } + } Literal::Scalar(s, ..) => Value::Scalar(format!("{s}scalar").parse().expect_tc(literal.span())?), Literal::String(..) => tc_fail!(), }),