Skip to content

Commit

Permalink
fix(listing): add missing order hash in token (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
kwiss authored Sep 6, 2023
1 parent cefa0f9 commit 5fb8e0c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 4 additions & 2 deletions crates/ark-db/src/token/update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ pub async fn update_token_listing(
padded_token_id: String,
status: String,
price: String,
order_hash: String,
) -> Result<(), Error> {
let token_table = env::var("ARK_TOKENS_TABLE_NAME").expect("ARK_TOKENS_TABLE_NAME must be set");

Expand All @@ -93,9 +94,10 @@ pub async fn update_token_listing(
.table_name(token_table)
.key("address", AttributeValue::S(collection_address.clone()))
.key("token_id", AttributeValue::S(padded_token_id))
.update_expression("SET listing_price = :price, listing_status = :status")
.update_expression("SET listing_price = :price, listing_status = :status, order_hash = :order_hash")
.expression_attribute_values(":status", AttributeValue::S(status))
.expression_attribute_values(":price", AttributeValue::S(price));
.expression_attribute_values(":price", AttributeValue::S(price))
.expression_attribute_values(":order_hash", AttributeValue::S(order_hash));

request.send().await?;

Expand Down
3 changes: 3 additions & 0 deletions crates/arkchain-indexer/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ async fn main() -> Result<()> {
te.padded_token_id,
String::from("listed"),
te.price.unwrap_or(String::from("0")),
te.order_hash.unwrap_or(String::from("")),
)
.await?;
}
Expand All @@ -145,6 +146,7 @@ async fn main() -> Result<()> {
te.padded_token_id,
String::from("pending"),
te.price.unwrap_or(String::from("0")),
te.order_hash.unwrap_or(String::from("")),
)
.await?;
}
Expand All @@ -166,6 +168,7 @@ async fn main() -> Result<()> {
te.padded_token_id,
String::from(""),
te.price.unwrap_or(String::from("")),
te.order_hash.unwrap_or(String::from("")),
)
.await?;
}
Expand Down

0 comments on commit 5fb8e0c

Please sign in to comment.