feat: Add EncodingError
Change method signatures to expect it and raise it where it makes sense --- don't change below this line --- ENG-4076 <#DTT#>
This commit is contained in:
@@ -1,12 +1,17 @@
|
||||
use anyhow::Error;
|
||||
|
||||
use crate::encoding::models::{EncodingContext, Swap};
|
||||
use crate::encoding::{
|
||||
errors::EncodingError,
|
||||
models::{EncodingContext, Swap},
|
||||
};
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub trait SwapEncoder: Sync + Send {
|
||||
fn new(executor_address: String) -> Self
|
||||
where
|
||||
Self: Sized;
|
||||
fn encode_swap(&self, swap: Swap, encoding_context: EncodingContext) -> Result<Vec<u8>, Error>;
|
||||
fn encode_swap(
|
||||
&self,
|
||||
swap: Swap,
|
||||
encoding_context: EncodingContext,
|
||||
) -> Result<Vec<u8>, EncodingError>;
|
||||
fn executor_address(&self) -> &str;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user