Skip to content

add test to verify that MintQuoteMiningShare is issued#1

Open
wilfredallyn wants to merge 1 commit intovnprc:hashpool2from
wilfredallyn:quote-test
Open

add test to verify that MintQuoteMiningShare is issued#1
wilfredallyn wants to merge 1 commit intovnprc:hashpool2from
wilfredallyn:quote-test

Conversation

@wilfredallyn
Copy link

Description

verify that MintQuoteMiningShare has state issued after created by mint

run test with cargo test -p cdk test_mint_mining_share_quote_is_issued

Copy link
Owner

@vnprc vnprc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! After a quick discussion we determined that these quotes need to use CurrencyUnit("HASH").

Custom currency units are not well supported. Watch out for potential problems with this code I added: 0d11a5b

It's probably a good idea, but only exists on this fork. We can remove it if it creates a big enough problem.

Once you make that change I think this is good to merge.

Great work Larry!


// Update the local quote state to Issued since was updated in process_mining_mint_request
let mut quote: MintQuoteMiningShareResponse<Uuid> = quote.into();
quote.state = MintQuoteState::Issued;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of assuming that process_mining_mint_request updated the state to Issued we should update that function to return the state of the quote and use it here to update our quote.

@vnprc
Copy link
Owner

vnprc commented Apr 22, 2025

Looking at this again, I think we should delete the pubsub calls in process_mining_mint_request and pay_mint_quote.

These are redundant since we're not waiting to process the next step. So in the happy path we would fire three pubsub events at the same time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments