Skip to content

Commit

Permalink
Move PUSH_BACK_BYTES into createpayload
Browse files Browse the repository at this point in the history
  • Loading branch information
dexX7 committed May 23, 2015
1 parent dcb5a00 commit f21b6ff
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
13 changes: 0 additions & 13 deletions src/omnicore/convert.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,6 @@ void swapByteOrder16(uint16_t&);
void swapByteOrder32(uint32_t&);
void swapByteOrder64(uint64_t&);

/**
* Pushes bytes to the end of a vector.
*/
#define PUSH_BACK_BYTES(vector, value)\
vector.insert(vector.end(), reinterpret_cast<unsigned char *>(&(value)),\
reinterpret_cast<unsigned char *>(&(value)) + sizeof((value)));

/**
* Pushes bytes to the end of a vector based on a pointer.
*/
#define PUSH_BACK_BYTES_PTR(vector, ptr, size)\
vector.insert(vector.end(), reinterpret_cast<unsigned char *>((ptr)),\
reinterpret_cast<unsigned char *>((ptr)) + (size));
}


Expand Down
18 changes: 18 additions & 0 deletions src/omnicore/createpayload.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,21 @@
#include <string>
#include <vector>

/**
* Pushes bytes to the end of a vector.
*/
#define PUSH_BACK_BYTES(vector, value)\
vector.insert(vector.end(), reinterpret_cast<unsigned char *>(&(value)),\
reinterpret_cast<unsigned char *>(&(value)) + sizeof((value)));

/**
* Pushes bytes to the end of a vector based on a pointer.
*/
#define PUSH_BACK_BYTES_PTR(vector, ptr, size)\
vector.insert(vector.end(), reinterpret_cast<unsigned char *>((ptr)),\
reinterpret_cast<unsigned char *>((ptr)) + (size));


std::vector<unsigned char> CreatePayload_SimpleSend(uint32_t propertyId, uint64_t amount)
{
std::vector<unsigned char> payload;
Expand Down Expand Up @@ -387,3 +402,6 @@ std::vector<unsigned char> CreatePayload_MetaDExCancelEcosystem(uint8_t ecosyste
return payload;
}

#undef PUSH_BACK_BYTES
#undef PUSH_BACK_BYTES_PTR

0 comments on commit f21b6ff

Please sign in to comment.