Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pretty manifest compiler error reporting #1741

Merged
merged 105 commits into from
Mar 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
19e3d3f
Add span information to manifest parser errors
lrubasze Mar 7, 2024
f808660
Add preliminary parser_error_diagnostic
lrubasze Mar 8, 2024
d538fa1
Some changes
lrubasze Mar 8, 2024
3f88aad
Minor fixes
lrubasze Mar 8, 2024
a4ac6cf
Add manifest parser error diagnostic tests
lrubasze Mar 8, 2024
a4a4534
Add preliminary lexer_error_diagnostic
lrubasze Mar 11, 2024
c2421fb
Fix UnexpectedChar position
lrubasze Mar 11, 2024
86cb4d8
Rename test manifests
lrubasze Mar 11, 2024
2f58730
Use compile_error_diagnostics in tests
lrubasze Mar 11, 2024
a083eeb
Add manifest lexer error diagnostic tests
lrubasze Mar 11, 2024
bc5b454
Tweak unexpected char diagnostic
lrubasze Mar 11, 2024
0fe3d6f
Comment added
lrubasze Mar 11, 2024
4567c15
Add manifest lexer error diagnostic InvalidInteger tests
lrubasze Mar 11, 2024
b52d24c
Add manifest lexer error diagnostic InvalidUnicode tests
lrubasze Mar 11, 2024
bb1eb7a
Add span info to InvalidUnicode error
lrubasze Mar 11, 2024
8deb93b
Reformat InvalidInteger error
lrubasze Mar 11, 2024
793d09c
Add manifest lexer error diagnostic UnexpectedEof tests
lrubasze Mar 11, 2024
f64f58b
Fix line numbering
lrubasze Mar 11, 2024
214bbea
Add create_snippet() common method
lrubasze Mar 11, 2024
41f52a0
Add max fielt to MaxDepthExceeded parser error
lrubasze Mar 12, 2024
aca7ddf
Add manifest parser error diagnostic MaxDepthExceeded tests
lrubasze Mar 12, 2024
93e1578
Cleanup not used manifest compiler errors
lrubasze Mar 12, 2024
b98e782
Change annotation type to Error
lrubasze Mar 12, 2024
4b9bb5a
Reorganize imports
lrubasze Mar 12, 2024
5887e86
Use ValueWithSpan and ValueKindWithSpan
lrubasze Mar 12, 2024
6fd5013
Use InstructionWithSpan
lrubasze Mar 13, 2024
558ee6f
Use span! and position! macros where applicable
lrubasze Mar 13, 2024
0cf773f
Add span info to manifest generator errors
lrubasze Mar 13, 2024
6106210
Fix span info to manifest generator errors
lrubasze Mar 13, 2024
214d913
Add preliminary generator_error_diagnostics
lrubasze Mar 13, 2024
5569039
Add initial manifest generator error diagnostic tests
lrubasze Mar 13, 2024
4f719bc
Rephrase parser unexpected token errors
lrubasze Mar 14, 2024
8207495
Rephrase lexer invalid integer errors
lrubasze Mar 14, 2024
8e12686
Add more parser unexpected token error tests
lrubasze Mar 14, 2024
23217e2
Rephrase generator invalid errors
lrubasze Mar 14, 2024
00bdea6
Fix invalid type reporting for generator errors
lrubasze Mar 14, 2024
656ca1f
Add more generator error tests
lrubasze Mar 14, 2024
849a878
Handle duplicated items in InvalidAstValue error
lrubasze Mar 14, 2024
69aa184
Fix expected type for InvalidAstType error
lrubasze Mar 14, 2024
7e54e56
Add more generator error tests
lrubasze Mar 14, 2024
89b375e
Add more generator error tests
lrubasze Mar 14, 2024
492dec0
Improve invalid decimal generator errors
lrubasze Mar 14, 2024
4f14b57
Improve blob related generator errors
lrubasze Mar 14, 2024
8b61c1a
Add more generator error tests
lrubasze Mar 14, 2024
4c9e50b
Rephrase generator invalid bytes error
lrubasze Mar 14, 2024
dfb2795
Add more generator error tests
lrubasze Mar 14, 2024
385fd68
Add more generator error tests
lrubasze Mar 14, 2024
2336b64
Improve generator ManifestIdValidationError handling
lrubasze Mar 15, 2024
aa36c7d
Add more generator error tests
lrubasze Mar 15, 2024
5d1702a
Fixes after rebasing to develop branch
lrubasze Mar 15, 2024
f93200f
Cleanup
lrubasze Mar 15, 2024
888dca2
Add compile_error_diagnostics to resim command
lrubasze Mar 15, 2024
b231829
Fix no_std variant
lrubasze Mar 15, 2024
5b6d2f3
Fix crash Array/Map with not type specified
lrubasze Mar 15, 2024
cc7d85e
More readable output when test fails
lrubasze Mar 15, 2024
e32876d
Separate span from GenerateError enum
lrubasze Mar 18, 2024
5b12a1f
Separate span from ParserError enum
lrubasze Mar 18, 2024
88136b1
Separate span from LexerError enum
lrubasze Mar 18, 2024
9e247c2
Cargo.lock update
lrubasze Mar 18, 2024
fd4aa3b
Comment why the process exit
lrubasze Mar 19, 2024
5611a32
Add diagnostic style enum
lrubasze Mar 19, 2024
c0ae89a
Imports cleanup
lrubasze Mar 19, 2024
86ab95c
Add diagnostic plain text style error test
lrubasze Mar 19, 2024
65123bd
Cleanup compiler end of file tests
lrubasze Mar 19, 2024
e05fb2c
Add invalid integer type and invalid integer literal errors
lrubasze Mar 19, 2024
d1df364
Add missing unicode surrogate error
lrubasze Mar 19, 2024
9cbee98
Get rid of previous in lexer
lrubasze Mar 19, 2024
0bfa4dd
Implement advance() for Position
lrubasze Mar 19, 2024
c7053a1
Change title and label for some generator errors
lrubasze Mar 19, 2024
b19b2a9
Change title and label for some generator errors
lrubasze Mar 19, 2024
019ba7d
Change label for unexpected eof error
lrubasze Mar 19, 2024
9591626
Add ExpectedChar to unexpected char error
lrubasze Mar 20, 2024
8f19bcb
Move lexer error constructors to LexerError implementation
lrubasze Mar 20, 2024
751d0ce
Support ExpectedChar in diagnostics
lrubasze Mar 20, 2024
4289928
Improve TokenKind display
lrubasze Mar 20, 2024
9f7f12b
Fix unexpected eof spans
lrubasze Mar 20, 2024
3389a3d
Add some tests with complex unicodes
lrubasze Mar 20, 2024
d66303e
Fix comments around Span and Position
lrubasze Mar 20, 2024
d8dc41d
Add custom error dumping method
lrubasze Mar 20, 2024
e04d2d3
Merge branch 'develop' into feature/manifest_compiler_error_reporting
lrubasze Mar 20, 2024
b8d029b
Improve TokenType Display messages
lrubasze Mar 21, 2024
4b38af9
Improve TokenKind Display messages
lrubasze Mar 21, 2024
13692e7
Fix unknown enum discriminator diagnostic title
lrubasze Mar 21, 2024
1f6cdc9
Update compiler tests
lrubasze Mar 21, 2024
eefc8fb
Rename Token -> TokenWithSpan, TokenKind -> Token
lrubasze Mar 21, 2024
a26d5c5
Refactor tokenize_punctuation()
lrubasze Mar 21, 2024
87601e2
Fix invalid unicode error message
lrubasze Mar 21, 2024
91dd515
Check tokens length in parser constructor
lrubasze Mar 21, 2024
f9c643a
Refactor Position line_number to line_index
lrubasze Mar 21, 2024
458ccad
Rename some methods
lrubasze Mar 21, 2024
9812b9b
Rename UnexpectedTokenOrMissingSemicolon to InvalidArgument
lrubasze Mar 21, 2024
d5ea9a8
Update compiler tests
lrubasze Mar 21, 2024
7674641
Use helper method unexpected_token()
lrubasze Mar 21, 2024
03c7c61
Replace advance_match macro with advance_exact method
lrubasze Mar 21, 2024
15484c0
Fix invalid package address error handling
lrubasze Mar 21, 2024
e75d46a
Add invalid resource address error
lrubasze Mar 21, 2024
f257358
Fix invalid expression handling
lrubasze Mar 21, 2024
61393b3
Tweak unexpected value reporting
lrubasze Mar 21, 2024
1d6b4ee
Add expected length to invalid hash length
lrubasze Mar 21, 2024
a1cdabc
Extend TODO note on messages for aliases
lrubasze Mar 21, 2024
ace2300
Some renaming
lrubasze Mar 21, 2024
911d52f
Tweak bucket locked message
lrubasze Mar 21, 2024
c64a9e5
More comments
lrubasze Mar 21, 2024
8706e0b
Minor tweak
lrubasze Mar 21, 2024
72cbbaa
Merge branch 'develop' into feature/manifest_compiler_error_reporting
lrubasze Mar 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,968 changes: 0 additions & 1,968 deletions assets/blueprints/Cargo.lock

This file was deleted.

17 changes: 17 additions & 0 deletions radix-clis/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions radix-clis/src/bin/replay.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
#[cfg(windows)]
use colored::*;
use radix_clis::error::exit_with_error;
use radix_clis::replay;

pub fn main() -> Result<(), replay::Error> {
pub fn main() {
#[cfg(windows)]
control::set_virtual_terminal(true).unwrap();
replay::run()
match replay::run() {
Err(msg) => exit_with_error(msg, 1),
_ => {}
}
}
8 changes: 6 additions & 2 deletions radix-clis/src/bin/resim.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
#[cfg(windows)]
use colored::*;
use radix_clis::error::exit_with_error;
use radix_clis::resim;

pub fn main() -> Result<(), resim::Error> {
pub fn main() {
#[cfg(windows)]
control::set_virtual_terminal(true).unwrap();
resim::run()
match resim::run() {
Err(msg) => exit_with_error(msg, 1),
_ => {}
}
}
8 changes: 6 additions & 2 deletions radix-clis/src/bin/rtmc.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
#[cfg(windows)]
use colored::*;
use radix_clis::error::exit_with_error;
use radix_clis::rtmc;

pub fn main() -> Result<(), rtmc::Error> {
pub fn main() {
#[cfg(windows)]
control::set_virtual_terminal(true).unwrap();
rtmc::run()
match rtmc::run() {
Err(msg) => exit_with_error(msg, 1),
_ => {}
}
}
8 changes: 6 additions & 2 deletions radix-clis/src/bin/rtmd.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
#[cfg(windows)]
use colored::*;
use radix_clis::error::exit_with_error;
use radix_clis::rtmd;

pub fn main() -> Result<(), rtmd::Error> {
pub fn main() {
#[cfg(windows)]
control::set_virtual_terminal(true).unwrap();
rtmd::run()
match rtmd::run() {
Err(msg) => exit_with_error(msg, 1),
_ => {}
}
}
8 changes: 6 additions & 2 deletions radix-clis/src/bin/scrypto.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
#[cfg(windows)]
use colored::*;
use radix_clis::error::exit_with_error;
use radix_clis::scrypto;

pub fn main() -> Result<(), scrypto::Error> {
pub fn main() {
#[cfg(windows)]
control::set_virtual_terminal(true).unwrap();
scrypto::run()
match scrypto::run() {
Err(msg) => exit_with_error(msg, 1),
_ => {}
}
}
4 changes: 4 additions & 0 deletions radix-clis/src/error.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
pub fn exit_with_error(msg: String, exit_code: i32) {
eprintln!("{}", msg);
std::process::exit(exit_code)
}
2 changes: 2 additions & 0 deletions radix-clis/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ pub mod scrypto;
pub mod scrypto_bindgen;
/// Utility functions.
pub mod utils;

pub mod error;
4 changes: 2 additions & 2 deletions radix-clis/src/replay/cmd_alloc_dump.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pub struct TxnAllocDump {
}

impl TxnAllocDump {
pub fn run(&self) -> Result<(), Error> {
pub fn run(&self) -> Result<(), String> {
let network = match &self.network {
Some(n) => NetworkDefinition::from_str(n).map_err(Error::ParseNetworkError)?,
None => NetworkDefinition::mainnet(),
Expand Down Expand Up @@ -93,7 +93,7 @@ impl TxnAllocDump {
} else if self.source.is_dir() {
TxnReader::StateManagerDatabaseDir(self.source.clone())
} else {
return Err(Error::InvalidTransactionSource);
return Err(Error::InvalidTransactionSource.into());
};
let txn_read_thread_handle =
thread::spawn(move || txn_reader.read(cur_version, to_version, tx));
Expand Down
4 changes: 2 additions & 2 deletions radix-clis/src/replay/cmd_execute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pub struct TxnExecute {
}

impl TxnExecute {
pub fn run(&self) -> Result<(), Error> {
pub fn run(&self) -> Result<(), String> {
let network = match &self.network {
Some(n) => NetworkDefinition::from_str(n).map_err(Error::ParseNetworkError)?,
None => NetworkDefinition::mainnet(),
Expand Down Expand Up @@ -66,7 +66,7 @@ impl TxnExecute {
} else if self.source.is_dir() {
TxnReader::StateManagerDatabaseDir(self.source.clone())
} else {
return Err(Error::InvalidTransactionSource);
return Err(Error::InvalidTransactionSource.into());
};
let txn_read_thread_handle =
thread::spawn(move || txn_reader.read(cur_version, to_version, tx));
Expand Down
6 changes: 3 additions & 3 deletions radix-clis/src/replay/cmd_execute_in_memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ pub struct TxnExecuteInMemory {
}

impl TxnExecuteInMemory {
pub fn run(&self) -> Result<(), Error> {
pub fn run(&self) -> Result<(), String> {
let network = match &self.network {
Some(n) => NetworkDefinition::from_str(n).map_err(Error::ParseNetworkError)?,
None => NetworkDefinition::mainnet(),
Expand All @@ -58,7 +58,7 @@ impl TxnExecuteInMemory {
}
}
}
return Err(Error::InvalidBreakpoints(bps.clone()));
return Err(Error::InvalidBreakpoints(bps.clone()).into());
}
}

Expand All @@ -77,7 +77,7 @@ impl TxnExecuteInMemory {
} else if self.source.is_dir() {
TxnReader::StateManagerDatabaseDir(self.source.clone())
} else {
return Err(Error::InvalidTransactionSource);
return Err(Error::InvalidTransactionSource.into());
};
let txn_read_thread_handle =
thread::spawn(move || txn_reader.read(cur_version, to_version, tx));
Expand Down
4 changes: 2 additions & 2 deletions radix-clis/src/replay/cmd_measure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ pub struct TxnMeasure {
}

impl TxnMeasure {
pub fn run(&self) -> Result<(), Error> {
pub fn run(&self) -> Result<(), String> {
let network = match &self.network {
Some(n) => NetworkDefinition::from_str(n).map_err(Error::ParseNetworkError)?,
None => NetworkDefinition::mainnet(),
Expand Down Expand Up @@ -73,7 +73,7 @@ impl TxnMeasure {
} else if self.source.is_dir() {
TxnReader::StateManagerDatabaseDir(self.source.clone())
} else {
return Err(Error::InvalidTransactionSource);
return Err(Error::InvalidTransactionSource.into());
};
let txn_read_thread_handle =
thread::spawn(move || txn_reader.read(cur_version, to_version, tx));
Expand Down
2 changes: 1 addition & 1 deletion radix-clis/src/replay/cmd_prepare.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pub struct TxnPrepare {
const TRANSACTION_COLUMN: &str = "raw_ledger_transactions";

impl TxnPrepare {
pub fn run(&self) -> Result<(), Error> {
pub fn run(&self) -> Result<(), String> {
let temp_dir = tempfile::tempdir().map_err(Error::IOError)?;
let db = DB::open_cf_as_secondary(
&Options::default(),
Expand Down
2 changes: 1 addition & 1 deletion radix-clis/src/replay/cmd_sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pub struct TxnSync {
}

impl TxnSync {
pub fn sync(&self) -> Result<(), Error> {
pub fn sync(&self) -> Result<(), String> {
let network = match &self.network {
Some(n) => NetworkDefinition::from_str(n).map_err(Error::ParseNetworkError)?,
None => NetworkDefinition::mainnet(),
Expand Down
14 changes: 14 additions & 0 deletions radix-clis/src/replay/error.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use radix_common::prelude::ParseNetworkError;
use std::fmt;

#[derive(Debug)]
pub enum Error {
Expand All @@ -9,3 +10,16 @@ pub enum Error {
InvalidTransactionSource,
InvalidBreakpoints(String),
}

impl fmt::Display for Error {
// TODO Implement pretty error printing
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{:?}", self)
}
}

impl From<Error> for String {
fn from(err: Error) -> String {
err.to_string()
}
}
2 changes: 1 addition & 1 deletion radix-clis/src/replay/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pub enum Command {
AllocDump(TxnAllocDump),
}

pub fn run() -> Result<(), Error> {
pub fn run() -> Result<(), String> {
let cli = ReplayCli::parse();

match cli.command {
Expand Down
2 changes: 1 addition & 1 deletion radix-clis/src/resim/cmd_call_function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ pub struct CallFunction {
}

impl CallFunction {
pub fn run<O: std::io::Write>(&self, out: &mut O) -> Result<(), Error> {
pub fn run<O: std::io::Write>(&self, out: &mut O) -> Result<(), String> {
let address_bech32_decoder = AddressBech32Decoder::for_simulator();

let default_account = get_default_account()?;
Expand Down
2 changes: 1 addition & 1 deletion radix-clis/src/resim/cmd_call_method.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pub struct CallMethod {
}

impl CallMethod {
pub fn run<O: std::io::Write>(&self, out: &mut O) -> Result<(), Error> {
pub fn run<O: std::io::Write>(&self, out: &mut O) -> Result<(), String> {
let address_bech32_decoder = AddressBech32Decoder::for_simulator();

let default_account = get_default_account()?;
Expand Down
4 changes: 2 additions & 2 deletions radix-clis/src/resim/cmd_export_package_definition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub struct ExportPackageDefinition {
}

impl ExportPackageDefinition {
pub fn run<O: std::io::Write>(&self, out: &mut O) -> Result<(), Error> {
pub fn run<O: std::io::Write>(&self, out: &mut O) -> Result<(), String> {
match export_package_schema(self.package_address.0) {
Ok(schema) => {
fs::write(
Expand All @@ -34,7 +34,7 @@ impl ExportPackageDefinition {
.map_err(Error::IOError)?;
Ok(())
}
Err(e) => Err(e),
Err(e) => Err(e.into()),
}
}
}
2 changes: 1 addition & 1 deletion radix-clis/src/resim/cmd_generate_key_pair.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use rand::Rng;
pub struct GenerateKeyPair {}

impl GenerateKeyPair {
pub fn run<O: std::io::Write>(&self, out: &mut O) -> Result<(), Error> {
pub fn run<O: std::io::Write>(&self, out: &mut O) -> Result<(), String> {
let secret = rand::thread_rng().gen::<[u8; 32]>();
let private_key = Secp256k1PrivateKey::from_bytes(&secret).unwrap();
let public_key = private_key.public_key();
Expand Down
2 changes: 1 addition & 1 deletion radix-clis/src/resim/cmd_mint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pub struct Mint {
}

impl Mint {
pub fn run<O: std::io::Write>(&self, out: &mut O) -> Result<(), Error> {
pub fn run<O: std::io::Write>(&self, out: &mut O) -> Result<(), String> {
let address_bech32_decoder = AddressBech32Decoder::for_simulator();

let default_account = get_default_account()?;
Expand Down
2 changes: 1 addition & 1 deletion radix-clis/src/resim/cmd_new_account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub struct NewAccount {
struct EmptyStruct;

impl NewAccount {
pub fn run<O: std::io::Write>(&self, out: &mut O) -> Result<(), Error> {
pub fn run<O: std::io::Write>(&self, out: &mut O) -> Result<(), String> {
let secret = rand::thread_rng().gen::<[u8; 32]>();
let private_key = Secp256k1PrivateKey::from_bytes(&secret).unwrap();
let public_key = private_key.public_key();
Expand Down
2 changes: 1 addition & 1 deletion radix-clis/src/resim/cmd_new_badge_fixed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ pub struct NewBadgeFixed {
}

impl NewBadgeFixed {
pub fn run<O: std::io::Write>(&self, out: &mut O) -> Result<(), Error> {
pub fn run<O: std::io::Write>(&self, out: &mut O) -> Result<(), String> {
let default_account = get_default_account()?;
let mut metadata = BTreeMap::new();
if let Some(symbol) = self.symbol.clone() {
Expand Down
2 changes: 1 addition & 1 deletion radix-clis/src/resim/cmd_new_badge_mutable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ pub struct NewBadgeMutable {
}

impl NewBadgeMutable {
pub fn run<O: std::io::Write>(&self, out: &mut O) -> Result<(), Error> {
pub fn run<O: std::io::Write>(&self, out: &mut O) -> Result<(), String> {
let mut metadata = BTreeMap::new();
if let Some(symbol) = self.symbol.clone() {
metadata.insert("symbol".to_string(), MetadataValue::String(symbol));
Expand Down
2 changes: 1 addition & 1 deletion radix-clis/src/resim/cmd_new_simple_badge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ impl NewSimpleBadge {
pub fn run<O: std::io::Write>(
&self,
out: &mut O,
) -> Result<Option<NonFungibleGlobalId>, Error> {
) -> Result<Option<NonFungibleGlobalId>, String> {
let network_definition = NetworkDefinition::simulator();
let default_account = get_default_account()?;
let mut metadata = MetadataInit::new();
Expand Down
2 changes: 1 addition & 1 deletion radix-clis/src/resim/cmd_new_token_fixed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ pub struct NewTokenFixed {
}

impl NewTokenFixed {
pub fn run<O: std::io::Write>(&self, out: &mut O) -> Result<(), Error> {
pub fn run<O: std::io::Write>(&self, out: &mut O) -> Result<(), String> {
let default_account = get_default_account()?;
let mut metadata = BTreeMap::new();
if let Some(symbol) = self.symbol.clone() {
Expand Down
2 changes: 1 addition & 1 deletion radix-clis/src/resim/cmd_new_token_mutable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ pub struct NewTokenMutable {
}

impl NewTokenMutable {
pub fn run<O: std::io::Write>(&self, out: &mut O) -> Result<(), Error> {
pub fn run<O: std::io::Write>(&self, out: &mut O) -> Result<(), String> {
let mut metadata = BTreeMap::new();
if let Some(symbol) = self.symbol.clone() {
metadata.insert("symbol".to_string(), MetadataValue::String(symbol));
Expand Down
4 changes: 2 additions & 2 deletions radix-clis/src/resim/cmd_publish.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ pub struct Publish {
}

impl Publish {
pub fn run<O: std::io::Write>(&self, out: &mut O) -> Result<(), Error> {
pub fn run<O: std::io::Write>(&self, out: &mut O) -> Result<(), String> {
// Load wasm code
let (code_path, definition_path) = if self.path.extension() != Some(OsStr::new("wasm")) {
let build_artifacts = build_package(
Expand All @@ -71,7 +71,7 @@ impl Publish {
)
.map_err(Error::BuildError)?;
if build_artifacts.len() > 1 {
return Err(Error::BuildError(BuildError::WorkspaceNotSupported));
return Err(Error::BuildError(BuildError::WorkspaceNotSupported).into());
} else {
build_artifacts
.first()
Expand Down
2 changes: 1 addition & 1 deletion radix-clis/src/resim/cmd_reset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use crate::resim::*;
pub struct Reset {}

impl Reset {
pub fn run<O: std::io::Write>(&self, out: &mut O) -> Result<(), Error> {
pub fn run<O: std::io::Write>(&self, out: &mut O) -> Result<(), String> {
SimulatorEnvironment::new().and_then(|env| env.reset())?;
writeln!(out, "Data directory cleared.").map_err(Error::IOError)?;
Ok(())
Expand Down
Loading
Loading