Fix generated projects' README + rename 'certify' -> 'publish'

This hints to how this particular purpose is about publishing
  certificate (either delegation or key de-registration).
This commit is contained in:
KtorZ 2023-01-18 16:48:40 +01:00
parent 20ac9c20a2
commit c440026e36
No known key found for this signature in database
GPG Key ID: 33173CB6F77F4277
3 changed files with 6 additions and 6 deletions

View File

@ -31,10 +31,10 @@ impl IdGenerator {
}
pub const SPEND: &str = "spend";
pub const CERT: &str = "cert";
pub const PUBLISH: &str = "publish";
pub const MINT: &str = "mint";
pub const WITHDRAW: &str = "withdraw";
pub const VALIDATOR_NAMES: [&str; 4] = [SPEND, CERT, MINT, WITHDRAW];
pub const VALIDATOR_NAMES: [&str; 4] = [SPEND, PUBLISH, MINT, WITHDRAW];
#[cfg(test)]
mod tests;

View File

@ -17,7 +17,7 @@ use aiken_lang::{
builtins::{self, generic_var},
tipo::TypeInfo,
uplc::CodeGenerator,
IdGenerator, CERT, MINT, SPEND, VALIDATOR_NAMES, WITHDRAW,
IdGenerator, MINT, PUBLISH, SPEND, VALIDATOR_NAMES, WITHDRAW,
};
use deps::UseManifest;
use miette::NamedSource;
@ -430,7 +430,7 @@ where
// depending on name, validate the minimum number of arguments
// if too low, push a new error on to errors
if [MINT, CERT, WITHDRAW].contains(&func_def.name.as_str())
if [MINT, WITHDRAW, PUBLISH].contains(&func_def.name.as_str())
&& func_def.arguments.len() < 2
{
errors.push(Error::WrongValidatorArity {

View File

@ -105,10 +105,10 @@ fn readme(root: &Path, project_name: &str) -> miette::Result<()> {
Validators are named after their purpose, so one of:
- `script`
- `spent`
- `mint`
- `withdraw`
- `certify`
- `publish`
## Building