-
Notifications
You must be signed in to change notification settings - Fork 3
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
feat(asset-manager): create asset manager library #19
base: main
Are you sure you want to change the base?
Conversation
* feat(ntc-vault-cli): initial layout * style(ntc-vault-cli): add rustfmt.toml * feat(ntc-vault-cli): add clap-based CLI skeleton * feat(ntc-vault-cli): flesh out structure, implement identity subcommand * refactor(ntc-vault-cli): separate code into two crates: core, cli * refactor(ntc-vault-cli): move rand-using code from core to cli * test(ntc-vault-cli): generate_secure_seed smoke test * feat(ntc-vault-cli): data package and JSON Schema work-in-progress * refactor: move crates into rust-workspace * docs: add comment about using "cargo +nightly fmt" * docs: add ARCHITECTURE.md * refactor: rename package "ntc-vault-core" → "ntc-data-packages" * feat(ntc-data-packages): replace anyhow with thiserror * build(ntc-data-packages): drop jsonschema's default features We don't need jsonschema's CLI, or the file / HTTP resolving features. This greatly reduces our dependency tree. * build: declare rust-version * docs: add package descriptions * feat(ntc-data-packages): better validation error messages * ci(rust-workspace): add check and test workflows for GitHub Actions * docs: fix rustdoc link issues * build(rust-workspace): add rust-toolchain.toml, with channel = "stable" * docs(README): add link to ARCHITECTURE.md * deps(ntc-vault-cli): update confy revision for store_path fix Upstream PR: rust-cli/confy#60 (fix: `store_path` should create missing directories, like `load_path`) * refactor(ntc-data-packages): move tests to API-based integration tests Motivation: https://matklad.github.io/2021/02/27/delete-cargo-integration-tests.html * refactor(ntc-vault-cli): move try_exists to compat module * refactor(ntc-vault-cli): VaultIdentityConfig: make pub * deps(ntc-vault-cli): add dev dependencies for CLI tests * test(ntc-vault-cli): add snapshot-based CLI tests * deps(ntc-data-packages): add serde * feat(ntc-data-packages): add Metadata::from_json_bytes * feat(ntc-vault-cli): add fs_io, with read_metadata * feat(ntc-vault-cli): implement more of the "data" subcommand * chore: add todos to keep track of changes that needs to be made to allign with design * chore(deps): update dependencies and bump jsonschema to 0.16 Co-authored-by: Herman <[email protected]>
* build(rust-sgx-workspace): add workspace for SGX code * build(ntc-tee-server): add SGX project for the TEE server * build(ntc-tee-server): bump Rust edition: "2018" → "2021" * build(ntc-tee-server): better error message for missing Enclave_u library * ci(rust-sgx-workspace): add check and test workflows for GitHub Actions * ci: use nested checkout for the multiple repositories to prevent _temp being deleted * style: fix clippy warnings * ci: remove --all-targets build arg to fix enclave builds and checks Co-authored-by: Herman <[email protected]>
63300a8
to
739c161
Compare
739c161
to
9066361
Compare
c5466f3
to
d11b25b
Compare
dfc0c66
to
6fbc42e
Compare
609da07
to
c6b8655
Compare
13232fc
to
b8b6c7a
Compare
611ac28
to
848a96f
Compare
6a26989
to
d412f4e
Compare
d412f4e
to
7c26b0f
Compare
Create the initial version of the asset manager library. Functionality for the creation of DRTs on the Algorand blockchain is implemented.
68b22d4
to
cec2eaf
Compare
Use the `ALGORAND_MNEMONIC` environment variable in integration tests. It holds the secret mnemonic for interacting with the Algorand blockchain.
17fd0b1
to
9a74113
Compare
The `dotenv!` macro panics if no file named `.env` is present in the workspace root. Use `dotenv::var` function instead.
9a74113
to
c0e4351
Compare
[dependencies] | ||
algonaut = { git = "https://github.com/manuelmauro/algonaut", rev = "30a251e438df9bb7af8b3aafc53bb9945a74c963" } | ||
algonaut_client = { git = "https://github.com/manuelmauro/algonaut", rev = "30a251e438df9bb7af8b3aafc53bb9945a74c963" } | ||
once_cell = "1.12" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you use this dependency (once_cell) in the library?
#[derive(Debug)] | ||
pub struct DrtConfig { | ||
creator: Address, | ||
encoder: AsaNote, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we use a different field name for encoder
?
To me, the AsaNote is references to the code and data which is essentially the rights of the DRT.
Tested with my "Bert" algorand account and successfully created DRT through the integration test by supplying mnemonic in .env: |
}); | ||
|
||
let response = drt_config.submit(&mock_algod, &mock_account).await.unwrap(); | ||
assert!(matches!(response, TransactionResponse { .. })); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool things learnt about unit tests:
Can run the following to output println!
statements in test output and specificy --lib
to just run the unit tests - https://doc.rust-lang.org/cargo/commands/cargo-test.html
cargo test --lib -- --nocapture
Can also make the assert more specific with but the above is sufficient:
assert_eq!(response.tx_id, "id");
c0e4351
to
120708e
Compare
Overview
A library for managing assets on the Algorand blockchain. This PR is intended to partially address issue #13
Task breakdown
Todo
Implementation
DRT encoding
DRTs are encoded as JSON objects in the
note
field of the initial asset configuration transaction that instantiated them as a new ASA on the Algorand blockchain. The structure of this object is outlined in the following table:byte arraybase64byte arraybase64Public API
A
DrtConfig
struct facilitates the creation of new DRTs on the Algorand blockchain. This struct is obtained via aDrtConfigBuilder
struct by calling thebuild
method. New DRTs are deployed as Algorand Standard Assets upon calling the asynchronousdeploy
method on theDrtConfig
struct.