Skip to content
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

Add GetMixins to mobilecoind API #680

Merged
merged 10 commits into from Jan 20, 2021

Conversation

mfaulk
Copy link
Contributor

@mfaulk mfaulk commented Jan 13, 2021

Motivation

Adds API endpoint for getting TxOuts for use as mixins.

In this PR

  • GetMembershipProofRequest and GetMembershipProofResponse use TxOut instead of UnspentTxOut.
  • Add GetMixins endpoint
  • Update mobilecoind-json
  • TODO: Add unit tests to mobilecoind-json

Copy link
Contributor

@eranrund eranrund left a comment

Choose a reason for hiding this comment

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

Looks good so far!

/// Create a TxProposal that attempts to merge multiple UTXOs into a single larger UTXO.
///
/// # Arguments
/// * `monitor_id` - ???
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe this generates a transaction that joins a bunch of UTXOs belonging to monitor_id+subaddress_index

/// Create a TxProposal that sends the total value of all inputs minus the fee to a single receiver.
///
/// # Arguments
/// * `account_key` -
Copy link
Contributor

Choose a reason for hiding this comment

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

The account key the UTXOs belong to

/// * `fee` - Transaction fee, in picoMOB.
/// * `from_account_key` - ???
/// * `change_subaddress` - ???
/// * `destinations` - ???
Copy link
Contributor

Choose a reason for hiding this comment

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

The outputs of the transaction

/// * `from_account_key` - ???
/// * `change_subaddress` - ???
/// * `destinations` - ???
/// * `tombstone_block` - ???
Copy link
Contributor

Choose a reason for hiding this comment

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

Tombstone block of the transaction

/// * `change_subaddress` - ???
/// * `destinations` - ???
/// * `tombstone_block` - ???
/// * `fog_pubkey_resolver` - ???
Copy link
Contributor

Choose a reason for hiding this comment

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

Used to obtain fog report key when fog support is enabled.

/// * `inputs` - UTXOs to spend, with membership proofs.
/// * `rings` - A set of mixins for each input, with membership proofs.
/// * `fee` - Transaction fee, in picoMOB.
/// * `from_account_key` - ???
Copy link
Contributor

Choose a reason for hiding this comment

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

Account key the inputs belong to and change is sent to

/// * `rings` - A set of mixins for each input, with membership proofs.
/// * `fee` - Transaction fee, in picoMOB.
/// * `from_account_key` - ???
/// * `change_subaddress` - ???
Copy link
Contributor

Choose a reason for hiding this comment

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

Subaddress to send change to

.map_err(|err| rpc_internal_error("unspent_tx_out.try_from", err, &self.logger))
// UnspentTxOut::try_from(tx_out)
Copy link
Contributor

Choose a reason for hiding this comment

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

Leftovers

Ok(Json(response))
}

#[post("/tx-out/mixin", format = "json", data = "<request>")]
Copy link
Contributor

Choose a reason for hiding this comment

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

mixins intead of mixin?

@mfaulk mfaulk marked this pull request as ready for review January 15, 2021 22:58
@jadeydi
Copy link
Contributor

jadeydi commented Jan 16, 2021

@eranrund May JsonBlockDetailsResponse return full data, like JsonTxOut, key images, etc?

https://github.com/mobilecoinfoundation/mobilecoin/blob/master/mobilecoind-json/src/data_types.rs#L1148

@mfaulk mfaulk merged commit 6e60631 into mobilecoinfoundation:master Jan 20, 2021
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.

None yet

4 participants