-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: getting rid of json serialization and near_sdk (#13)
- Loading branch information
Showing
26 changed files
with
1,984 additions
and
1,076 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#[cfg_attr(not(target_arch = "wasm32"), derive(Debug, PartialEq, Eq))] | ||
pub enum ContractError { | ||
ParseAccountError, | ||
BorshDeserializeError, | ||
BorshSerializeError, | ||
OneYoctoAttachError, | ||
PrivateCallError, | ||
BadUtf8String, | ||
BadNumber, | ||
} | ||
|
||
impl AsRef<[u8]> for ContractError { | ||
fn as_ref(&self) -> &[u8] { | ||
match self { | ||
Self::ParseAccountError => b"ERR_PARS_ACCOUNT", | ||
Self::BorshDeserializeError => b"ERR_BORCH_DESERIALIZE", | ||
Self::BorshSerializeError => b"ERR_BORCH_SERIALIZE", | ||
Self::OneYoctoAttachError => b"ERR_ONE_YOCTO_ATACH", | ||
Self::PrivateCallError => b"ERR_PRIVATE_CALL", | ||
Self::BadUtf8String => b"ERR_BAD_UTF8_STRING", | ||
Self::BadNumber => b"ERR_BAD_NUMBER", | ||
} | ||
} | ||
} |
Oops, something went wrong.