Skip to content

Commit

Permalink
Removed CoinTradeMetadata
Browse files Browse the repository at this point in the history
  • Loading branch information
CapCap authored and aptos-bot committed Mar 13, 2022
1 parent 2d50bb5 commit caafe08
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 42 deletions.
13 changes: 0 additions & 13 deletions documentation/specifications/transactions/onchain/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ enum Metadata {
TravelRuleMetadata(TravelRuleMetadata),
UnstructuredByteMetadata(Option<Vec<u8>>),
RefundMetadata(RefundMetadata),
CoinTradeMetadata(CoinTradeMetadata),
}
```

Expand Down Expand Up @@ -63,18 +62,6 @@ type OffChainReferenceId = Option<String>;

The TravelRuleMetadata completes a transaction that began with a pre-flight, or off-chain exchange. During this exchange, the two parties should have agreed on an `OffChainReferenceId`, likley a `reference_id` or a [UUID-128](https://tools.ietf.org/html/rfc4122).

## Coin Trades with Designated Dealers Using CoinTradeMetadata

```
enum CoinTradeMetadata {
CoinTradeMetadataVersion0(TradeIds),
}
type TradeIds = Vec<String>;
```

As defined in [DIP-12](https://dip.aptoslabs.com/dip-12/), a coin trade transaction involves a VASP selling or purchasing coins to or from a DD. Each coin trade is represented by a trade id, which is an identifier agreed to by the VASP and DD off-chain. One or more of these off-chain interactions can be settled on-chain via a CoinTradeMetadata transaction.

## Refunds Using RefundMetadata

```
Expand Down
1 change: 0 additions & 1 deletion testsuite/generate-format/src/aptos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ pub fn get_registry() -> Result<Registry> {
tracer.trace_type::<transaction::metadata::TravelRuleMetadata>(&samples)?;
tracer.trace_type::<transaction::metadata::RefundMetadata>(&samples)?;
tracer.trace_type::<transaction::metadata::RefundReason>(&samples)?;
tracer.trace_type::<transaction::metadata::CoinTradeMetadata>(&samples)?;
tracer.trace_type::<transaction::Transaction>(&samples)?;
tracer.trace_type::<transaction::TransactionArgument>(&samples)?;
tracer.trace_type::<transaction::VecBytes>(&samples)?;
Expand Down
14 changes: 0 additions & 14 deletions testsuite/generate-format/tests/staged/aptos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,6 @@ ChangeSet:
- events:
SEQ:
TYPENAME: ContractEvent
CoinTradeMetadata:
ENUM:
0:
CoinTradeMetadataV0:
NEWTYPE:
TYPENAME: CoinTradeMetadataV0
CoinTradeMetadataV0:
STRUCT:
- trade_ids:
SEQ: STR
ContractEvent:
ENUM:
0:
Expand Down Expand Up @@ -113,10 +103,6 @@ Metadata:
RefundMetadata:
NEWTYPE:
TYPENAME: RefundMetadata
5:
CoinTradeMetadata:
NEWTYPE:
TYPENAME: CoinTradeMetadata
6:
PaymentMetadata:
NEWTYPE:
Expand Down
14 changes: 0 additions & 14 deletions types/src/transaction/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ pub enum Metadata {
TravelRuleMetadata(TravelRuleMetadata),
UnstructuredBytesMetadata(UnstructuredBytesMetadata),
RefundMetadata(RefundMetadata),
CoinTradeMetadata(CoinTradeMetadata),
PaymentMetadata(PaymentMetadata),
}

Expand Down Expand Up @@ -118,19 +117,6 @@ pub enum RefundReason {
InvalidReferenceId,
}

/// List of supported transaction metadata format versions for coin trade transaction
#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)]
pub enum CoinTradeMetadata {
CoinTradeMetadataV0(CoinTradeMetadataV0),
}

/// Transaction metadata format for coin trades (purchases/sells)
#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)]
pub struct CoinTradeMetadataV0 {
/// A list of trade_ids this transaction wants to settle
pub trade_ids: Vec<String>,
}

/// List of supported transaction metadata format versions for transactions for payments
#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)]
pub enum PaymentMetadata {
Expand Down

0 comments on commit caafe08

Please sign in to comment.