Skip to content

Commit 543fa69

Browse files
author
hard-nett
committed
add replies, pass vec of jackalmsgs
1 parent 1b18e04 commit 543fa69

File tree

7 files changed

+208
-159
lines changed

7 files changed

+208
-159
lines changed

README.md

+20-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,20 @@ Unlike The Usb-Plugin, the Usb-Adapter is shared between accounts.
1313

1414
The **Usb-Adapter** serves as standard interface to extend the compatability with an Account and its storage options. The key function of an **Usb-Adapter** is to generalize functionality. **This currently is unimplemented**, however a goal for the adapter can be to generalize encryption schemes for various file storage methods.
1515

16-
16+
### Jackal Data Format Details
17+
18+
* **account -** `Hex[hash(Bech32 address)]`
19+
* **rootHashPath -** `MerklePath("s")`
20+
* **contents -** `FID`
21+
* **editors -**
22+
* c = `concatenate("e", trackingNumber, Bech32 address)`
23+
* map_key = `hex[hash("c")]`
24+
* map_value = `ECIES.encypt(aesIV + aesKey)`
25+
* **viewers -**
26+
* c = `concatenate( "v", trackingNumber, Bech32 address )`
27+
* map_key = `hex[ hash("c") ]`
28+
* map_value = `ECIES.encrypt( aesIV + aesKey )`
29+
* **trackingNumber -** `UUID used in viewers & editors map`
1730
## Using the Justfile
1831

1932
This repository comes with a [`justfile`](https://github.com/casey/just), which is a handy task runner that helps with building, testing, and publishing your Abstract app module.
@@ -95,3 +108,9 @@ just publish-schemas my-namespace my-module 0.0.1
95108
```
96109

97110
In the example above, `my-namespace` is the namespace, `my-module` is the module's name, and `0.1` is the minor version. If you create a patch for your module (e.g., `0.1.1`), you don't need to run `publish-schemas` again unless the schemas have changed.
111+
112+
113+
## Future Goals
114+
* Automate Storage Purchasing
115+
* Manage Storage Provider
116+
* SubLease Storage

contracts/usb/src/contract.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
use crate::{
22
error::UsbError,
33
handlers,
4-
msg::{
5-
UsbExecuteMsg, UsbInstantiateMsg, UsbMigrateMsg, UsbQueryMsg
6-
},
7-
replies::{self, INSTANTIATE_REPLY_ID},
4+
msg::{UsbExecuteMsg, UsbInstantiateMsg, UsbMigrateMsg, UsbQueryMsg},
5+
replies::{self, INSTANTIATE_REPLY_ID, JACKAL_MSG_REPLY_ID},
86
APP_VERSION, USB_ID,
97
};
108

@@ -15,16 +13,18 @@ use cosmwasm_std::Response;
1513
pub type UsbResult<T = Response> = Result<T, UsbError>;
1614

1715
/// The type of the app that is used to build your app and access the Abstract SDK features.
18-
pub type Usb =
19-
AppContract<UsbError, UsbInstantiateMsg, UsbExecuteMsg, UsbQueryMsg, UsbMigrateMsg>;
16+
pub type Usb = AppContract<UsbError, UsbInstantiateMsg, UsbExecuteMsg, UsbQueryMsg, UsbMigrateMsg>;
2017

2118
const APP: Usb = Usb::new(USB_ID, APP_VERSION, None)
2219
.with_instantiate(handlers::instantiate_handler)
2320
.with_execute(handlers::execute_handler)
2421
.with_query(handlers::query_handler)
2522
.with_migrate(handlers::migrate_handler)
2623
.with_dependencies(&[])
27-
.with_replies(&[(INSTANTIATE_REPLY_ID, replies::instantiate_reply)]);
24+
.with_replies(&[
25+
(INSTANTIATE_REPLY_ID, replies::instantiate_reply),
26+
(JACKAL_MSG_REPLY_ID, replies::jackal_reply),
27+
]);
2828

2929
// Export handlers
3030
#[cfg(feature = "export")]

contracts/usb/src/error.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use abstract_app::objects::version_control::VersionControlError;
12
use abstract_app::sdk::AbstractSdkError;
23
use abstract_app::std::AbstractError;
34
use abstract_app::AppError;
@@ -16,6 +17,8 @@ pub enum UsbError {
1617

1718
#[error("{0}")]
1819
AbstractSdk(#[from] AbstractSdkError),
20+
#[error("{0}")]
21+
VersionControlError(#[from] VersionControlError),
1922

2023
#[error("not-implemented")]
2124
NotImplemented(),

0 commit comments

Comments
 (0)