Skip to content

Commit

Permalink
Add metadata function to compute assetId from denoms
Browse files Browse the repository at this point in the history
  • Loading branch information
neithanmo committed Dec 2, 2024
1 parent 0e0e250 commit c0f328c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/rust/include/rslib.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ parser_error_t rs_output_action_hash(spend_key_bytes_t *sk, output_plan_t *plan,
parser_error_t rs_swap_action_hash(spend_key_bytes_t *sk, swap_plan_t *plan, uint8_t *output, size_t output_len);
parser_error_t rs_generic_action_hash(bytes_t *data, uint8_t action_type, uint8_t *output, size_t output_len);

parser_error_t rs_get_asset_id_from_metadata(const bytes_t *metadata, uint8_t *asset_id, uint16_t asset_id_len);

#ifdef __cplusplus
}
#endif
#endif
6 changes: 6 additions & 0 deletions app/src/tx_metadata.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <zxmacros.h>
#include "parser_txdef.h"
#include "tx_metadata.h"
#include "rslib.h"


parser_error_t metadata_parse(const uint8_t *data, size_t dataLen, tx_metadata_t *metadata, uint8_t metadataLen) {
Expand Down Expand Up @@ -79,3 +80,8 @@ parser_error_t metadata_parse(const uint8_t *data, size_t dataLen, tx_metadata_t

return parser_ok;
}

parser_error_t metadata_toAssetId(const tx_metadata_t *metadata, uint8_t *assetId, uint16_t assetIdLen) {

return parser_ok;
}
2 changes: 2 additions & 0 deletions app/src/tx_metadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ extern "C" {

parser_error_t metadata_parse(const uint8_t *data, size_t dataLen, tx_metadata_t *metadata, uint8_t metadataLen);

parser_error_t metadata_toAssetId(const tx_metadata_t *metadata, uint8_t *assetId, uint16_t assetIdLen);


#ifdef __cplusplus
}
Expand Down

0 comments on commit c0f328c

Please sign in to comment.