From f311e048b71d5ea21da8a88a8439b61e18fda7a1 Mon Sep 17 00:00:00 2001 From: KtorZ Date: Wed, 5 Apr 2023 11:55:05 +0200 Subject: [PATCH] Improve error message on 'ParameterizedValidator'. --- crates/aiken-project/src/blueprint/error.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/crates/aiken-project/src/blueprint/error.rs b/crates/aiken-project/src/blueprint/error.rs index d440b18c..af173f26 100644 --- a/crates/aiken-project/src/blueprint/error.rs +++ b/crates/aiken-project/src/blueprint/error.rs @@ -37,8 +37,11 @@ pub enum Error { )] #[diagnostic(code("aiken::blueprint::address::parameterized"))] #[diagnostic(help( - "I can only compute addresses of validators that are fully applied. For example, a {keyword_spend} validator must have exactly 3 arguments: a datum, a redeemer and a context. If it has more, they need to be provided beforehand and applied directly in the validator. Applying parameters change the validator's compiled code, and thus the address.\n\nThis is why I need you to apply parameters first.", - keyword_spend = "spend".if_supports_color(Stdout, |s| s.purple())))] + "I can only compute addresses of validators that are fully applied. For example, a {keyword_spend} validator must have exactly {spend_arity} arguments: a datum, a redeemer and a context. If it has more, they need to be provided beforehand and applied directly to the validator.\n\nApplying parameters change the validator's compiled code, and thus the address. This is why I need you to apply parameters first using the {blueprint_apply_command} command.", + keyword_spend = "spend".if_supports_color(Stdout, |s| s.yellow()), + spend_arity = "3".if_supports_color(Stdout, |s| s.yellow()), + blueprint_apply_command = "blueprint apply".if_supports_color(Stdout, |s| s.purple()), + ))] ParameterizedValidator { n: usize }, }