feat: fix errors and add tests for BigInt changes

This commit is contained in:
rvcas
2023-02-09 15:01:30 -05:00
parent bd4aeb779c
commit c1d67e95e1
9 changed files with 291 additions and 109 deletions

View File

@@ -1,5 +1,7 @@
use std::string::FromUtf8Error;
use num_bigint::BigInt;
use crate::ast::{NamedDeBruijn, Term, Type};
use super::{ExBudget, Value};
@@ -37,9 +39,9 @@ pub enum Error {
#[error("Decoding utf8")]
Utf8(#[from] FromUtf8Error),
#[error("Out of Bounds\n\nindex: {}\nbytestring: {}\npossible: 0 - {}", .0, hex::encode(.1), .1.len() - 1)]
ByteStringOutOfBounds(i128, Vec<u8>),
ByteStringOutOfBounds(BigInt, Vec<u8>),
#[error("Divide By Zero\n\n{0} / {1}")]
DivideByZero(i128, i128),
DivideByZero(BigInt, BigInt),
#[error("Ed25519S PublicKey should be 32 bytes but it was {0}")]
UnexpectedEd25519PublicKeyLength(usize),
#[error("Ed25519S Signature should be 64 bytes but it was {0}")]