Skip to content

Conversation

@zathras-crypto
Copy link

  1. gettransaction_MP now works for any metadex order not just open ones
  2. populateRPCTransactionObject now parses off the wire for metadex just like all other types
  3. new levelDB MP_tradelist
  4. every completed trade added to tradelistDB with txids, addresses, properties, and amounts
  5. new gettrade_MP call added
  6. gettrade_MP will iter metadex map to determine if offer still active
  7. new getMatchedTrades function added using tradelistDB to return all trades matched with a supplied txid
  8. gettrade_MP will call getMatchedTrades and supply to user over RPC
  9. mscrpc 7 function to dump tradelistDB

example
http://pastie.org/pastes/9698921/text?key=a5n5cqglbd80c7tfytwgxw

@dexX7
Copy link

dexX7 commented Nov 6, 2014

That's pretty awesome. Will start some tests in a few minutes.

Sidenote: git rebase -i HEAD~26 can be used to combine (stash) some commits for easier code review (e.g. grouped into persistence, rpc, ...). Overwriting already pushed stuff is possible with -f in git push remotename -f branchname. That's of course no demand to do so, but might be useful from time to time. :)

Copy link

Choose a reason for hiding this comment

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

#182 could remove a lot of those. But there is also:

std::string FormatMP(unsigned int propertyid, int64_t n, bool fSign)

Copy link

Choose a reason for hiding this comment

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

Looks like a duplication of mastercore_rpc.cpp#L1921-L1947.

Maybe replace by something like:

void evaluatePopulationStatus(int nResult)
{
    switch (nResult) {
        case MP_TX_NOT_FOUND:
                throw ...
        ...
    }
}

@ghost
Copy link

ghost commented Nov 6, 2014

this looks good to me ... @m21 to expedite ? so we can have usable functionality for the rest of the RPCs

Copy link

Choose a reason for hiding this comment

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

Unused, can be removed.

m21 added a commit that referenced this pull request Nov 6, 2014
Add trade history levelDB, trade_MP call, clean up MetaDex populateRPCTransactionObject
@m21 m21 merged commit 3de92bc into mastercoin-MSC:mscore-0.0.9 Nov 6, 2014
@dexX7
Copy link

dexX7 commented Nov 6, 2014

Tested a few transactions, works great! I posted some comments inline.

The only thing I'm really not sure about is mastercore_rpc.cpp#L2125-L2133:

for (md_PricesMap::iterator it = prices.begin(); it != prices.end(); ++it)
{
    md_Set & indexes = (it->second);
    for (md_Set::iterator it = indexes.begin(); it != indexes.end(); ++it)
    {
         CMPMetaDEx obj = *it;
         if( obj.getHash().GetHex() == hash.GetHex() ) orderOpen = true;
    }
}

Declaring variables multiple times seems to be legal, but how do you get away with it?

The iterator it is declared two times here and both loops modify it.

@m21
Copy link

m21 commented Nov 6, 2014

@dexX7
Copy link

dexX7 commented Nov 6, 2014

@m21: the link doesn't really nail it, but it makes sense and works. Interesting realization for me.. :)

See this example: http://ideone.com/pc8h37

@zathras-crypto zathras-crypto deleted the 0.0.9-Z-MetaDExTradeHistory branch March 25, 2015 00:56
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.

3 participants