Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 49a238086e | |||
| 91b90dbc01 | |||
| 8f3385902d | |||
| ad6ba0d7f0 | |||
| 1608a9e1a9 | |||
| 14e378aa0f | |||
| dd4be285f1 | |||
| b9260e0c7b | |||
| d93aaec6a5 | |||
| bd1af278a5 |
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "cryptoforknote-util",
|
"name": "cryptoforknote-util",
|
||||||
"version": "15.6.2",
|
"version": "15.7.1",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "LucasJones",
|
"name": "LucasJones",
|
||||||
"email": "lucasjonesdev@hotmail.co.uk"
|
"email": "lucasjonesdev@hotmail.co.uk"
|
||||||
|
|||||||
@@ -33,6 +33,7 @@
|
|||||||
#include <deque>
|
#include <deque>
|
||||||
#include <boost/mpl/vector.hpp>
|
#include <boost/mpl/vector.hpp>
|
||||||
#include <boost/mpl/contains_fwd.hpp>
|
#include <boost/mpl/contains_fwd.hpp>
|
||||||
|
#include <cstdint>
|
||||||
|
|
||||||
#undef MONERO_DEFAULT_LOG_CATEGORY
|
#undef MONERO_DEFAULT_LOG_CATEGORY
|
||||||
#define MONERO_DEFAULT_LOG_CATEGORY "serialization"
|
#define MONERO_DEFAULT_LOG_CATEGORY "serialization"
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <cstdint>
|
||||||
|
|
||||||
|
namespace cryptonote_arq
|
||||||
|
{
|
||||||
|
enum class txversion : uint16_t
|
||||||
|
{
|
||||||
|
v0 = 0,
|
||||||
|
v1,
|
||||||
|
v2,
|
||||||
|
v3,
|
||||||
|
|
||||||
|
_count
|
||||||
|
};
|
||||||
|
|
||||||
|
enum class txtype : uint16_t
|
||||||
|
{
|
||||||
|
standard = 0,
|
||||||
|
state_change,
|
||||||
|
key_image_unlock,
|
||||||
|
stake,
|
||||||
|
|
||||||
|
_count
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -29,6 +29,7 @@
|
|||||||
#include "offshore/pricing_record.h"
|
#include "offshore/pricing_record.h"
|
||||||
#include "zephyr_oracle/pricing_record.h"
|
#include "zephyr_oracle/pricing_record.h"
|
||||||
#include "salvium_oracle/pricing_record.h"
|
#include "salvium_oracle/pricing_record.h"
|
||||||
|
#include "arq_txtypes.h"
|
||||||
|
|
||||||
|
|
||||||
namespace cryptonote
|
namespace cryptonote
|
||||||
@@ -61,7 +62,7 @@ namespace cryptonote
|
|||||||
RETURN = 7,
|
RETURN = 7,
|
||||||
MAX = 7
|
MAX = 7
|
||||||
};
|
};
|
||||||
|
|
||||||
/* outputs */
|
/* outputs */
|
||||||
|
|
||||||
struct txout_to_script
|
struct txout_to_script
|
||||||
@@ -285,7 +286,7 @@ namespace cryptonote
|
|||||||
uint64_t amount;
|
uint64_t amount;
|
||||||
std::vector<uint64_t> key_offsets;
|
std::vector<uint64_t> key_offsets;
|
||||||
crypto::key_image k_image;
|
crypto::key_image k_image;
|
||||||
|
|
||||||
BEGIN_SERIALIZE_OBJECT()
|
BEGIN_SERIALIZE_OBJECT()
|
||||||
VARINT_FIELD(amount)
|
VARINT_FIELD(amount)
|
||||||
FIELD(key_offsets)
|
FIELD(key_offsets)
|
||||||
@@ -337,7 +338,7 @@ namespace cryptonote
|
|||||||
FIELD(k_image)
|
FIELD(k_image)
|
||||||
END_SERIALIZE()
|
END_SERIALIZE()
|
||||||
};
|
};
|
||||||
|
|
||||||
struct txin_salvium_key
|
struct txin_salvium_key
|
||||||
{
|
{
|
||||||
uint64_t amount;
|
uint64_t amount;
|
||||||
@@ -352,7 +353,7 @@ namespace cryptonote
|
|||||||
FIELD(k_image)
|
FIELD(k_image)
|
||||||
END_SERIALIZE()
|
END_SERIALIZE()
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef boost::variant<txin_gen, txin_to_script, txin_to_scripthash, txin_to_key, txin_offshore, txin_onshore, txin_xasset, txin_haven_key> txin_v;
|
typedef boost::variant<txin_gen, txin_to_script, txin_to_scripthash, txin_to_key, txin_offshore, txin_onshore, txin_xasset, txin_haven_key> txin_v;
|
||||||
typedef boost::variant<txin_gen, txin_to_script, txin_to_scripthash, txin_zephyr_key> txin_zephyr_v;
|
typedef boost::variant<txin_gen, txin_to_script, txin_to_scripthash, txin_zephyr_key> txin_zephyr_v;
|
||||||
typedef boost::variant<txin_gen, txin_to_script, txin_to_scripthash, txin_salvium_key> txin_salvium_v;
|
typedef boost::variant<txin_gen, txin_to_script, txin_to_scripthash, txin_salvium_key> txin_salvium_v;
|
||||||
@@ -426,6 +427,8 @@ namespace cryptonote
|
|||||||
size_t version;
|
size_t version;
|
||||||
uint64_t unlock_time; //number of block (or time), used as a limitation like: spend this tx not early then block/time
|
uint64_t unlock_time; //number of block (or time), used as a limitation like: spend this tx not early then block/time
|
||||||
|
|
||||||
|
cryptonote_arq::txtype arq_tx_type;
|
||||||
|
|
||||||
std::vector<txin_v> vin;
|
std::vector<txin_v> vin;
|
||||||
std::vector<txin_zephyr_v> vin_zephyr;
|
std::vector<txin_zephyr_v> vin_zephyr;
|
||||||
std::vector<txin_salvium_v> vin_salvium;
|
std::vector<txin_salvium_v> vin_salvium;
|
||||||
@@ -446,7 +449,7 @@ namespace cryptonote
|
|||||||
|
|
||||||
// SALVIUM-SPECIFIC FIELDS
|
// SALVIUM-SPECIFIC FIELDS
|
||||||
// TX type
|
// TX type
|
||||||
cryptonote::salvium_transaction_type tx_type;
|
cryptonote::salvium_transaction_type sal_tx_type;
|
||||||
crypto::public_key return_address;
|
crypto::public_key return_address;
|
||||||
// Return address list (must be at least 1 and at most BULLETPROOF_MAX_OUTPUTS-1 - the "-1" is for the change output)
|
// Return address list (must be at least 1 and at most BULLETPROOF_MAX_OUTPUTS-1 - the "-1" is for the change output)
|
||||||
std::vector<crypto::public_key> return_address_list;
|
std::vector<crypto::public_key> return_address_list;
|
||||||
@@ -485,10 +488,10 @@ namespace cryptonote
|
|||||||
if (blob_type == BLOB_TYPE_CRYPTONOTE_XHV) {
|
if (blob_type == BLOB_TYPE_CRYPTONOTE_XHV) {
|
||||||
VARINT_FIELD(version)
|
VARINT_FIELD(version)
|
||||||
//if(version == 0 || CURRENT_TRANSACTION_VERSION < version) return false;
|
//if(version == 0 || CURRENT_TRANSACTION_VERSION < version) return false;
|
||||||
|
|
||||||
// Only transactions prior to HAVEN_TYPES_TRANSACTION_VERSION are permitted to be anything other than HAVEN_TYPES and need translation
|
// Only transactions prior to HAVEN_TYPES_TRANSACTION_VERSION are permitted to be anything other than HAVEN_TYPES and need translation
|
||||||
if (version < HAVEN_TYPES_TRANSACTION_VERSION) {
|
if (version < HAVEN_TYPES_TRANSACTION_VERSION) {
|
||||||
|
|
||||||
if (version < POU_TRANSACTION_VERSION) {
|
if (version < POU_TRANSACTION_VERSION) {
|
||||||
VARINT_FIELD(unlock_time)
|
VARINT_FIELD(unlock_time)
|
||||||
}
|
}
|
||||||
@@ -720,7 +723,7 @@ namespace cryptonote
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
FIELD(vin)
|
FIELD(vin)
|
||||||
FIELD(vout_xhv)
|
FIELD(vout_xhv)
|
||||||
FIELD(extra)
|
FIELD(extra)
|
||||||
@@ -736,10 +739,10 @@ namespace cryptonote
|
|||||||
FIELD(vin_salvium)
|
FIELD(vin_salvium)
|
||||||
FIELD(vout_salvium)
|
FIELD(vout_salvium)
|
||||||
FIELD(extra)
|
FIELD(extra)
|
||||||
VARINT_FIELD(tx_type)
|
VARINT_FIELD(sal_tx_type)
|
||||||
if (tx_type != cryptonote::salvium_transaction_type::PROTOCOL) {
|
if (sal_tx_type != cryptonote::salvium_transaction_type::PROTOCOL) {
|
||||||
VARINT_FIELD(amount_burnt)
|
VARINT_FIELD(amount_burnt)
|
||||||
if (tx_type != cryptonote::salvium_transaction_type::MINER) {
|
if (sal_tx_type != cryptonote::salvium_transaction_type::MINER) {
|
||||||
if (type == cryptonote::salvium_transaction_type::TRANSFER && version >= TRANSACTION_VERSION_N_OUTS) {
|
if (type == cryptonote::salvium_transaction_type::TRANSFER && version >= TRANSACTION_VERSION_N_OUTS) {
|
||||||
FIELD(return_address_list)
|
FIELD(return_address_list)
|
||||||
FIELD(return_address_change_mask)
|
FIELD(return_address_change_mask)
|
||||||
@@ -752,9 +755,9 @@ namespace cryptonote
|
|||||||
VARINT_FIELD(amount_slippage_limit)
|
VARINT_FIELD(amount_slippage_limit)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
VARINT_FIELD(version)
|
VARINT_FIELD(version)
|
||||||
if (version > loki_version_2 && (blob_type == BLOB_TYPE_CRYPTONOTE_LOKI || blob_type == BLOB_TYPE_CRYPTONOTE_XTNC))
|
if (version > loki_version_2 && (blob_type == BLOB_TYPE_CRYPTONOTE_LOKI || blob_type == BLOB_TYPE_CRYPTONOTE_XTNC))
|
||||||
{
|
{
|
||||||
@@ -762,22 +765,31 @@ namespace cryptonote
|
|||||||
if (version == loki_version_3_per_output_unlock_times)
|
if (version == loki_version_3_per_output_unlock_times)
|
||||||
FIELD(is_deregister)
|
FIELD(is_deregister)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (version >= static_cast<size_t>(cryptonote_arq::txversion::v3) && (blob_type == BLOB_TYPE_CRYPTONOTE_ARQMA))
|
||||||
|
{
|
||||||
|
VARINT_FIELD(arq_tx_type)
|
||||||
|
if (static_cast<uint16_t>(arq_tx_type) >= static_cast<uint16_t>(cryptonote_arq::txtype::_count))
|
||||||
|
return false;
|
||||||
|
FIELD(output_unlock_times)
|
||||||
|
}
|
||||||
|
|
||||||
VARINT_FIELD(unlock_time)
|
VARINT_FIELD(unlock_time)
|
||||||
|
|
||||||
if (blob_type == BLOB_TYPE_CRYPTONOTE_ZEPHYR)
|
if (blob_type == BLOB_TYPE_CRYPTONOTE_ZEPHYR)
|
||||||
FIELD(vin_zephyr)
|
FIELD(vin_zephyr)
|
||||||
else
|
else
|
||||||
FIELD(vin)
|
FIELD(vin)
|
||||||
|
|
||||||
if (blob_type == BLOB_TYPE_CRYPTONOTE_ZEPHYR)
|
if (blob_type == BLOB_TYPE_CRYPTONOTE_ZEPHYR)
|
||||||
FIELD(vout_zephyr)
|
FIELD(vout_zephyr)
|
||||||
else
|
else
|
||||||
FIELD(vout)
|
FIELD(vout)
|
||||||
|
|
||||||
if (blob_type == BLOB_TYPE_CRYPTONOTE_LOKI || blob_type == BLOB_TYPE_CRYPTONOTE_XTNC)
|
if (blob_type == BLOB_TYPE_CRYPTONOTE_LOKI || blob_type == BLOB_TYPE_CRYPTONOTE_XTNC || blob_type == BLOB_TYPE_CRYPTONOTE_ARQMA)
|
||||||
{
|
{
|
||||||
if (version >= loki_version_3_per_output_unlock_times && vout.size() != output_unlock_times.size()) return false;
|
if ((version >= loki_version_3_per_output_unlock_times || version >= static_cast<size_t>(cryptonote_arq::txversion::v3)) && vout.size() != output_unlock_times.size())
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
FIELD(extra)
|
FIELD(extra)
|
||||||
if ((blob_type == BLOB_TYPE_CRYPTONOTE_LOKI || blob_type == BLOB_TYPE_CRYPTONOTE_XTNC) && version >= loki_version_4_tx_types)
|
if ((blob_type == BLOB_TYPE_CRYPTONOTE_LOKI || blob_type == BLOB_TYPE_CRYPTONOTE_XTNC) && version >= loki_version_4_tx_types)
|
||||||
@@ -924,7 +936,7 @@ namespace cryptonote
|
|||||||
output_unlock_times.clear();
|
output_unlock_times.clear();
|
||||||
collateral_indices.clear();
|
collateral_indices.clear();
|
||||||
// SAL
|
// SAL
|
||||||
tx_type = cryptonote::salvium_transaction_type::UNSET;
|
sal_tx_type = cryptonote::salvium_transaction_type::UNSET;
|
||||||
return_address = cryptonote::null_pkey;
|
return_address = cryptonote::null_pkey;
|
||||||
return_address_list.clear();
|
return_address_list.clear();
|
||||||
return_address_change_mask.clear();
|
return_address_change_mask.clear();
|
||||||
@@ -932,6 +944,8 @@ namespace cryptonote
|
|||||||
source_asset_type.clear();
|
source_asset_type.clear();
|
||||||
destination_asset_type.clear();
|
destination_asset_type.clear();
|
||||||
amount_slippage_limit = 0;
|
amount_slippage_limit = 0;
|
||||||
|
// ARQ
|
||||||
|
arq_tx_type = cryptonote_arq::txtype::standard;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline
|
inline
|
||||||
|
|||||||
@@ -30,30 +30,43 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#define TX_EXTRA_PADDING_MAX_COUNT 255
|
#define TX_EXTRA_PADDING_MAX_COUNT 255
|
||||||
#define TX_EXTRA_NONCE_MAX_COUNT 255
|
#define TX_EXTRA_NONCE_MAX_COUNT 255
|
||||||
#define TX_EXTRA_OFFSHORE_MAX_COUNT 255
|
#define TX_EXTRA_OFFSHORE_MAX_COUNT 255
|
||||||
#define TX_EXTRA_MEMO_MAX_COUNT 255
|
#define TX_EXTRA_MEMO_MAX_COUNT 255
|
||||||
|
|
||||||
#define TX_EXTRA_TAG_PADDING 0x00
|
#define TX_EXTRA_TAG_PADDING 0x00
|
||||||
#define TX_EXTRA_TAG_PUBKEY 0x01
|
#define TX_EXTRA_TAG_PUBKEY 0x01
|
||||||
#define TX_EXTRA_NONCE 0x02
|
#define TX_EXTRA_NONCE 0x02
|
||||||
#define TX_EXTRA_MERGE_MINING_TAG 0x03
|
#define TX_EXTRA_MERGE_MINING_TAG 0x03
|
||||||
#define TX_EXTRA_TAG_ADDITIONAL_PUBKEYS 0x04
|
#define TX_EXTRA_TAG_ADDITIONAL_PUBKEYS 0x04
|
||||||
#define TX_EXTRA_TAG_OFFSHORE 0x17
|
#define TX_EXTRA_TAG_OFFSHORE 0x17
|
||||||
#define TX_EXTRA_TAG_MEMO 0x18
|
#define TX_EXTRA_TAG_MEMO 0x18
|
||||||
#define TX_EXTRA_TAG_SERVICE_NODE_REGISTER 0x70
|
#define TX_EXTRA_TAG_SERVICE_NODE_REGISTER 0x70
|
||||||
#define TX_EXTRA_TAG_SERVICE_NODE_DEREGISTER 0x71
|
#define TX_EXTRA_TAG_SERVICE_NODE_STATE_CHANGE 0x71
|
||||||
#define TX_EXTRA_TAG_SERVICE_NODE_WINNER 0x72
|
#define TX_EXTRA_TAG_SERVICE_NODE_WINNER 0x72
|
||||||
#define TX_EXTRA_TAG_SERVICE_NODE_CONTRIBUTOR 0x73
|
#define TX_EXTRA_TAG_SERVICE_NODE_CONTRIBUTOR 0x73
|
||||||
#define TX_EXTRA_TAG_SERVICE_NODE_PUBKEY 0x74
|
#define TX_EXTRA_TAG_SERVICE_NODE_PUBKEY 0x74
|
||||||
#define TX_EXTRA_TAG_TX_SECRET_KEY 0x75
|
#define TX_EXTRA_TAG_TX_SECRET_KEY 0x75
|
||||||
#define TX_EXTRA_TAG_TX_KEY_IMAGE_PROOFS 0x76
|
#define TX_EXTRA_TAG_TX_KEY_IMAGE_PROOFS 0x76
|
||||||
#define TX_EXTRA_TAG_TX_KEY_IMAGE_UNLOCK 0x77
|
#define TX_EXTRA_TAG_TX_KEY_IMAGE_UNLOCK 0x77
|
||||||
#define TX_EXTRA_MYSTERIOUS_MINERGATE_TAG 0xDE
|
#define TX_EXTRA_TAG_SERVICE_NODE_DEREGISTER 0x78
|
||||||
|
#define TX_EXTRA_MYSTERIOUS_MINERGATE_TAG 0xDE
|
||||||
|
|
||||||
#define TX_EXTRA_NONCE_PAYMENT_ID 0x00
|
#define TX_EXTRA_NONCE_PAYMENT_ID 0x00
|
||||||
#define TX_EXTRA_NONCE_ENCRYPTED_PAYMENT_ID 0x01
|
#define TX_EXTRA_NONCE_ENCRYPTED_PAYMENT_ID 0x01
|
||||||
|
|
||||||
|
namespace service_nodes
|
||||||
|
{
|
||||||
|
enum class new_state : uint16_t
|
||||||
|
{
|
||||||
|
deregister = 0,
|
||||||
|
decommission,
|
||||||
|
recommission,
|
||||||
|
ip_change_penalty,
|
||||||
|
_count,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
namespace cryptonote
|
namespace cryptonote
|
||||||
{
|
{
|
||||||
@@ -277,6 +290,45 @@ namespace cryptonote
|
|||||||
END_SERIALIZE()
|
END_SERIALIZE()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct tx_extra_service_node_state_change
|
||||||
|
{
|
||||||
|
struct vote
|
||||||
|
{
|
||||||
|
vote() = default;
|
||||||
|
vote(crypto::signature const &signature, uint32_t validator_index) : signature(signature), validator_index(validator_index) {}
|
||||||
|
crypto::signature signature;
|
||||||
|
uint32_t validator_index;
|
||||||
|
|
||||||
|
BEGIN_SERIALIZE()
|
||||||
|
VARINT_FIELD(validator_index)
|
||||||
|
FIELD(signature)
|
||||||
|
END_SERIALIZE()
|
||||||
|
};
|
||||||
|
|
||||||
|
service_nodes::new_state state;
|
||||||
|
uint64_t block_height;
|
||||||
|
uint32_t service_node_index;
|
||||||
|
std::vector<vote> votes;
|
||||||
|
|
||||||
|
tx_extra_service_node_state_change() = default;
|
||||||
|
|
||||||
|
template<typename... VotesArgs>
|
||||||
|
tx_extra_service_node_state_change(service_nodes::new_state state, uint64_t block_height, uint32_t service_node_index, VotesArgs &&...votes)
|
||||||
|
: state{state}, block_height{block_height}, service_node_index{service_node_index}, votes{std::forward<VotesArgs>(votes)...} {}
|
||||||
|
|
||||||
|
bool operator==(const tx_extra_service_node_state_change &sc) const
|
||||||
|
{
|
||||||
|
return state == sc.state && block_height == sc.block_height && service_node_index == sc.service_node_index;
|
||||||
|
}
|
||||||
|
|
||||||
|
BEGIN_SERIALIZE()
|
||||||
|
ENUM_FIELD(state, state < service_nodes::new_state::_count)
|
||||||
|
FIELD(block_height)
|
||||||
|
FIELD(service_node_index)
|
||||||
|
FIELD(votes)
|
||||||
|
END_SERIALIZE()
|
||||||
|
};
|
||||||
|
|
||||||
struct tx_extra_tx_secret_key
|
struct tx_extra_tx_secret_key
|
||||||
{
|
{
|
||||||
crypto::secret_key key;
|
crypto::secret_key key;
|
||||||
@@ -324,35 +376,37 @@ namespace cryptonote
|
|||||||
tx_extra_merge_mining_tag,
|
tx_extra_merge_mining_tag,
|
||||||
tx_extra_additional_pub_keys,
|
tx_extra_additional_pub_keys,
|
||||||
tx_extra_mysterious_minergate,
|
tx_extra_mysterious_minergate,
|
||||||
tx_extra_offshore,
|
tx_extra_offshore,
|
||||||
tx_extra_memo,
|
tx_extra_memo,
|
||||||
tx_extra_service_node_pubkey,
|
tx_extra_service_node_pubkey,
|
||||||
tx_extra_service_node_register,
|
tx_extra_service_node_register,
|
||||||
tx_extra_service_node_contributor,
|
tx_extra_service_node_contributor,
|
||||||
tx_extra_service_node_winner,
|
tx_extra_service_node_winner,
|
||||||
tx_extra_service_node_deregister,
|
tx_extra_service_node_state_change,
|
||||||
tx_extra_tx_secret_key,
|
tx_extra_tx_secret_key,
|
||||||
tx_extra_tx_key_image_proofs,
|
tx_extra_tx_key_image_proofs,
|
||||||
tx_extra_tx_key_image_unlock
|
tx_extra_tx_key_image_unlock,
|
||||||
|
tx_extra_service_node_deregister
|
||||||
> tx_extra_field;
|
> tx_extra_field;
|
||||||
}
|
}
|
||||||
|
|
||||||
BLOB_SERIALIZER(cryptonote::tx_extra_service_node_deregister::vote);
|
BLOB_SERIALIZER(cryptonote::tx_extra_service_node_deregister::vote);
|
||||||
BLOB_SERIALIZER(cryptonote::tx_extra_tx_key_image_proofs::proof);
|
BLOB_SERIALIZER(cryptonote::tx_extra_tx_key_image_proofs::proof);
|
||||||
|
|
||||||
VARIANT_TAG(binary_archive, cryptonote::tx_extra_padding, TX_EXTRA_TAG_PADDING);
|
VARIANT_TAG(binary_archive, cryptonote::tx_extra_padding, TX_EXTRA_TAG_PADDING);
|
||||||
VARIANT_TAG(binary_archive, cryptonote::tx_extra_pub_key, TX_EXTRA_TAG_PUBKEY);
|
VARIANT_TAG(binary_archive, cryptonote::tx_extra_pub_key, TX_EXTRA_TAG_PUBKEY);
|
||||||
VARIANT_TAG(binary_archive, cryptonote::tx_extra_nonce, TX_EXTRA_NONCE);
|
VARIANT_TAG(binary_archive, cryptonote::tx_extra_nonce, TX_EXTRA_NONCE);
|
||||||
VARIANT_TAG(binary_archive, cryptonote::tx_extra_merge_mining_tag, TX_EXTRA_MERGE_MINING_TAG);
|
VARIANT_TAG(binary_archive, cryptonote::tx_extra_merge_mining_tag, TX_EXTRA_MERGE_MINING_TAG);
|
||||||
VARIANT_TAG(binary_archive, cryptonote::tx_extra_additional_pub_keys, TX_EXTRA_TAG_ADDITIONAL_PUBKEYS);
|
VARIANT_TAG(binary_archive, cryptonote::tx_extra_additional_pub_keys, TX_EXTRA_TAG_ADDITIONAL_PUBKEYS);
|
||||||
VARIANT_TAG(binary_archive, cryptonote::tx_extra_mysterious_minergate, TX_EXTRA_MYSTERIOUS_MINERGATE_TAG);
|
VARIANT_TAG(binary_archive, cryptonote::tx_extra_mysterious_minergate, TX_EXTRA_MYSTERIOUS_MINERGATE_TAG);
|
||||||
VARIANT_TAG(binary_archive, cryptonote::tx_extra_offshore, TX_EXTRA_TAG_OFFSHORE);
|
VARIANT_TAG(binary_archive, cryptonote::tx_extra_offshore, TX_EXTRA_TAG_OFFSHORE);
|
||||||
VARIANT_TAG(binary_archive, cryptonote::tx_extra_memo, TX_EXTRA_TAG_MEMO);
|
VARIANT_TAG(binary_archive, cryptonote::tx_extra_memo, TX_EXTRA_TAG_MEMO);
|
||||||
VARIANT_TAG(binary_archive, cryptonote::tx_extra_service_node_register, TX_EXTRA_TAG_SERVICE_NODE_REGISTER);
|
VARIANT_TAG(binary_archive, cryptonote::tx_extra_service_node_register, TX_EXTRA_TAG_SERVICE_NODE_REGISTER);
|
||||||
VARIANT_TAG(binary_archive, cryptonote::tx_extra_service_node_deregister, TX_EXTRA_TAG_SERVICE_NODE_DEREGISTER);
|
VARIANT_TAG(binary_archive, cryptonote::tx_extra_service_node_state_change, TX_EXTRA_TAG_SERVICE_NODE_STATE_CHANGE);
|
||||||
VARIANT_TAG(binary_archive, cryptonote::tx_extra_service_node_contributor, TX_EXTRA_TAG_SERVICE_NODE_CONTRIBUTOR);
|
VARIANT_TAG(binary_archive, cryptonote::tx_extra_service_node_contributor, TX_EXTRA_TAG_SERVICE_NODE_CONTRIBUTOR);
|
||||||
VARIANT_TAG(binary_archive, cryptonote::tx_extra_service_node_winner, TX_EXTRA_TAG_SERVICE_NODE_WINNER);
|
VARIANT_TAG(binary_archive, cryptonote::tx_extra_service_node_winner, TX_EXTRA_TAG_SERVICE_NODE_WINNER);
|
||||||
VARIANT_TAG(binary_archive, cryptonote::tx_extra_service_node_pubkey, TX_EXTRA_TAG_SERVICE_NODE_PUBKEY);
|
VARIANT_TAG(binary_archive, cryptonote::tx_extra_service_node_pubkey, TX_EXTRA_TAG_SERVICE_NODE_PUBKEY);
|
||||||
VARIANT_TAG(binary_archive, cryptonote::tx_extra_tx_secret_key, TX_EXTRA_TAG_TX_SECRET_KEY);
|
VARIANT_TAG(binary_archive, cryptonote::tx_extra_tx_secret_key, TX_EXTRA_TAG_TX_SECRET_KEY);
|
||||||
VARIANT_TAG(binary_archive, cryptonote::tx_extra_tx_key_image_proofs, TX_EXTRA_TAG_TX_KEY_IMAGE_PROOFS);
|
VARIANT_TAG(binary_archive, cryptonote::tx_extra_tx_key_image_proofs, TX_EXTRA_TAG_TX_KEY_IMAGE_PROOFS);
|
||||||
VARIANT_TAG(binary_archive, cryptonote::tx_extra_tx_key_image_unlock, TX_EXTRA_TAG_TX_KEY_IMAGE_UNLOCK);
|
VARIANT_TAG(binary_archive, cryptonote::tx_extra_tx_key_image_unlock, TX_EXTRA_TAG_TX_KEY_IMAGE_UNLOCK);
|
||||||
|
VARIANT_TAG(binary_archive, cryptonote::tx_extra_service_node_deregister, TX_EXTRA_TAG_SERVICE_NODE_DEREGISTER);
|
||||||
|
|||||||
@@ -39,4 +39,5 @@ enum BLOB_TYPE {
|
|||||||
BLOB_TYPE_CRYPTONOTE_ZEPHYR = 13, // ZEPHYR
|
BLOB_TYPE_CRYPTONOTE_ZEPHYR = 13, // ZEPHYR
|
||||||
BLOB_TYPE_CRYPTONOTE_XLA = 14, // XLA
|
BLOB_TYPE_CRYPTONOTE_XLA = 14, // XLA
|
||||||
BLOB_TYPE_CRYPTONOTE_SALVIUM= 15, // Salvium
|
BLOB_TYPE_CRYPTONOTE_SALVIUM= 15, // Salvium
|
||||||
|
BLOB_TYPE_CRYPTONOTE_ARQMA = 16 // Arqma
|
||||||
};
|
};
|
||||||
|
|||||||
+9
-4
@@ -7,6 +7,7 @@
|
|||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include "cryptonote_basic/cryptonote_basic.h"
|
#include "cryptonote_basic/cryptonote_basic.h"
|
||||||
#include "cryptonote_basic/cryptonote_format_utils.h"
|
#include "cryptonote_basic/cryptonote_format_utils.h"
|
||||||
|
#include "cryptonote_basic/tx_extra.h"
|
||||||
#include "common/base58.h"
|
#include "common/base58.h"
|
||||||
#include "serialization/binary_utils.h"
|
#include "serialization/binary_utils.h"
|
||||||
#include <nan.h>
|
#include <nan.h>
|
||||||
@@ -32,7 +33,7 @@ blobdata uint64be_to_blob(uint64_t num) {
|
|||||||
res[7] = num & 0xff;
|
res[7] = num & 0xff;
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool fillExtra(cryptonote::block& block1, const cryptonote::block& block2) {
|
static bool fillExtra(cryptonote::block& block1, const cryptonote::block& block2) {
|
||||||
cryptonote::tx_extra_merge_mining_tag mm_tag;
|
cryptonote::tx_extra_merge_mining_tag mm_tag;
|
||||||
mm_tag.depth = 0;
|
mm_tag.depth = 0;
|
||||||
@@ -250,7 +251,7 @@ NAN_METHOD(address_decode) {
|
|||||||
Local<Object> target = info[0]->ToObject(isolate->GetCurrentContext()).ToLocalChecked();
|
Local<Object> target = info[0]->ToObject(isolate->GetCurrentContext()).ToLocalChecked();
|
||||||
|
|
||||||
if (!Buffer::HasInstance(target)) return THROW_ERROR_EXCEPTION("Argument should be a buffer object.");
|
if (!Buffer::HasInstance(target)) return THROW_ERROR_EXCEPTION("Argument should be a buffer object.");
|
||||||
|
|
||||||
blobdata input = std::string(Buffer::Data(target), Buffer::Length(target));
|
blobdata input = std::string(Buffer::Data(target), Buffer::Length(target));
|
||||||
|
|
||||||
blobdata data;
|
blobdata data;
|
||||||
@@ -330,7 +331,11 @@ NAN_METHOD(construct_mm_parent_block_blob) { // (parentBlockTemplate, blob_type,
|
|||||||
b.set_blob_type(blob_type);
|
b.set_blob_type(blob_type);
|
||||||
if (!parse_and_validate_block_from_blob(input, b)) return THROW_ERROR_EXCEPTION("construct_mm_parent_block_blob: Failed to parse prent block");
|
if (!parse_and_validate_block_from_blob(input, b)) return THROW_ERROR_EXCEPTION("construct_mm_parent_block_blob: Failed to parse prent block");
|
||||||
if (blob_type == BLOB_TYPE_CRYPTONOTE_LOKI || blob_type == BLOB_TYPE_CRYPTONOTE_XTNC) b.miner_tx.version = cryptonote::loki_version_2;
|
if (blob_type == BLOB_TYPE_CRYPTONOTE_LOKI || blob_type == BLOB_TYPE_CRYPTONOTE_XTNC) b.miner_tx.version = cryptonote::loki_version_2;
|
||||||
|
if (blob_type == BLOB_TYPE_CRYPTONOTE_ARQMA) {
|
||||||
|
b.miner_tx.version = static_cast<size_t>(cryptonote_arq::txversion::v3);
|
||||||
|
b.miner_tx.arq_tx_type = cryptonote_arq::txtype::standard;
|
||||||
|
}
|
||||||
|
|
||||||
block b2 = AUTO_VAL_INIT(b2);
|
block b2 = AUTO_VAL_INIT(b2);
|
||||||
b2.set_blob_type(BLOB_TYPE_FORKNOTE2);
|
b2.set_blob_type(BLOB_TYPE_FORKNOTE2);
|
||||||
if (!parse_and_validate_block_from_blob(child_input, b2)) return THROW_ERROR_EXCEPTION("construct_mm_parent_block_blob: Failed to parse child block");
|
if (!parse_and_validate_block_from_blob(child_input, b2)) return THROW_ERROR_EXCEPTION("construct_mm_parent_block_blob: Failed to parse child block");
|
||||||
@@ -369,7 +374,7 @@ NAN_METHOD(construct_mm_child_block_blob) { // (shareBuffer, blob_type, childBlo
|
|||||||
if (!parse_and_validate_block_from_blob(child_block_template_blob, b2)) return THROW_ERROR_EXCEPTION("construct_mm_child_block_blob: Failed to parse child block");
|
if (!parse_and_validate_block_from_blob(child_block_template_blob, b2)) return THROW_ERROR_EXCEPTION("construct_mm_child_block_blob: Failed to parse child block");
|
||||||
|
|
||||||
if (!mergeBlocks(b, b2, std::vector<crypto::hash>())) return THROW_ERROR_EXCEPTION("construct_mm_child_block_blob: Failed to postprocess mining block");
|
if (!mergeBlocks(b, b2, std::vector<crypto::hash>())) return THROW_ERROR_EXCEPTION("construct_mm_child_block_blob: Failed to postprocess mining block");
|
||||||
|
|
||||||
blobdata output = "";
|
blobdata output = "";
|
||||||
if (!block_to_blob(b2, output)) return THROW_ERROR_EXCEPTION("construct_mm_child_block_blob: Failed to convert child block to blob");
|
if (!block_to_blob(b2, output)) return THROW_ERROR_EXCEPTION("construct_mm_child_block_blob: Failed to convert child block to blob");
|
||||||
|
|
||||||
|
|||||||
@@ -97,6 +97,29 @@ inline bool do_serialize(Archive &ar, bool &v)
|
|||||||
bool r = ::do_serialize(ar, f); \
|
bool r = ::do_serialize(ar, f); \
|
||||||
if (!r || !ar.stream().good()) return false; \
|
if (!r || !ar.stream().good()) return false; \
|
||||||
} while(0);
|
} while(0);
|
||||||
|
/*! \macro ENUM_FIELD(f, test)
|
||||||
|
* \brief tags and serializes (as a varint) the scoped enum \a f with a requirement that expression\
|
||||||
|
* \a test be true(typically for range testing).
|
||||||
|
*/
|
||||||
|
#define ENUM_FIELD(f, test) ENUM_FIELD_N(#f, f, test)
|
||||||
|
/*! \macro ENUM_FIELD_N(t, f, begin, end)
|
||||||
|
*
|
||||||
|
* \brief tags (as \a t) and serializes (as a varint) the scoped enum \a f with a requirement that
|
||||||
|
* expression \a test be true (typically for range testing).
|
||||||
|
*/
|
||||||
|
#define ENUM_FIELD_N(t, f, test) \
|
||||||
|
do { \
|
||||||
|
using enum_t = decltype(f); \
|
||||||
|
using int_t = typename std::underlying_type<enum_t>::type; \
|
||||||
|
int_t int_value = W ? static_cast<int_t>(f) : 0; \
|
||||||
|
ar.tag(t); \
|
||||||
|
ar.serialize_varint(int_value); \
|
||||||
|
if(!ar.stream().good()) return false; \
|
||||||
|
if(!W) { \
|
||||||
|
f = static_cast<enum_t>(int_value); \
|
||||||
|
if(!(test)) return false; \
|
||||||
|
} \
|
||||||
|
} while(0);
|
||||||
#define VARINT_FIELD(f) \
|
#define VARINT_FIELD(f) \
|
||||||
do { \
|
do { \
|
||||||
ar.tag(#f); \
|
ar.tag(#f); \
|
||||||
|
|||||||
@@ -1,21 +1,21 @@
|
|||||||
// Copyright (c) 2019, Haven Protocol
|
// Copyright (c) 2019, Haven Protocol
|
||||||
//
|
//
|
||||||
// All rights reserved.
|
// All rights reserved.
|
||||||
//
|
//
|
||||||
// Redistribution and use in source and binary forms, with or without modification, are
|
// Redistribution and use in source and binary forms, with or without modification, are
|
||||||
// permitted provided that the following conditions are met:
|
// permitted provided that the following conditions are met:
|
||||||
//
|
//
|
||||||
// 1. Redistributions of source code must retain the above copyright notice, this list of
|
// 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||||
// conditions and the following disclaimer.
|
// conditions and the following disclaimer.
|
||||||
//
|
//
|
||||||
// 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
// 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||||
// of conditions and the following disclaimer in the documentation and/or other
|
// of conditions and the following disclaimer in the documentation and/or other
|
||||||
// materials provided with the distribution.
|
// materials provided with the distribution.
|
||||||
//
|
//
|
||||||
// 3. Neither the name of the copyright holder nor the names of its contributors may be
|
// 3. Neither the name of the copyright holder nor the names of its contributors may be
|
||||||
// used to endorse or promote products derived from this software without specific
|
// used to endorse or promote products derived from this software without specific
|
||||||
// prior written permission.
|
// prior written permission.
|
||||||
//
|
//
|
||||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||||
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||||
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
||||||
@@ -25,7 +25,7 @@
|
|||||||
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||||
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
|
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
|
||||||
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
//
|
//
|
||||||
// Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers
|
// Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
@@ -40,6 +40,7 @@
|
|||||||
template <template <bool> class Archive>
|
template <template <bool> class Archive>
|
||||||
bool do_serialize(Archive<false> &ar, zephyr_oracle::pricing_record &pr, uint8_t version)
|
bool do_serialize(Archive<false> &ar, zephyr_oracle::pricing_record &pr, uint8_t version)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (version >= 6)
|
if (version >= 6)
|
||||||
{
|
{
|
||||||
// very basic sanity check
|
// very basic sanity check
|
||||||
|
|||||||
@@ -32,23 +32,37 @@
|
|||||||
namespace zephyr_oracle {
|
namespace zephyr_oracle {
|
||||||
|
|
||||||
const std::vector<std::string> ASSET_TYPES = {"ZEPH", "ZEPHUSD", "ZEPHRSV", "ZYIELD"};
|
const std::vector<std::string> ASSET_TYPES = {"ZEPH", "ZEPHUSD", "ZEPHRSV", "ZYIELD"};
|
||||||
|
const std::vector<std::string> RESERVE_TYPES = {"ZEPH", "ZEPHUSD", "ZEPHRSV", "ZYIELD", "ZYIELDRSV"};
|
||||||
|
|
||||||
|
const std::vector<std::string> ASSET_TYPES_V2 = {"ZPH", "ZSD", "ZRS", "ZYS"};
|
||||||
|
const std::vector<std::string> RESERVE_TYPES_V2 = {"DJED", "YIELD"};
|
||||||
|
|
||||||
class asset_type_counts
|
class asset_type_counts
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// Fields
|
// Fields
|
||||||
uint64_t ZEPH;
|
uint64_t ZEPH;
|
||||||
uint64_t ZEPHUSD;
|
uint64_t ZEPHUSD;
|
||||||
uint64_t ZEPHRSV;
|
uint64_t ZEPHRSV;
|
||||||
uint64_t ZYIELD;
|
uint64_t ZYIELD;
|
||||||
|
|
||||||
|
// v2 fields
|
||||||
|
uint64_t ZPH;
|
||||||
|
uint64_t ZSD;
|
||||||
|
uint64_t ZRS;
|
||||||
|
uint64_t ZYS;
|
||||||
|
|
||||||
asset_type_counts() noexcept
|
asset_type_counts() noexcept
|
||||||
: ZEPH(0)
|
: ZEPH(0)
|
||||||
, ZEPHUSD(0)
|
, ZEPHUSD(0)
|
||||||
, ZEPHRSV(0)
|
, ZEPHRSV(0)
|
||||||
, ZYIELD(0)
|
, ZYIELD(0)
|
||||||
|
, ZPH(0)
|
||||||
|
, ZSD(0)
|
||||||
|
, ZRS(0)
|
||||||
|
, ZYS(0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -62,6 +76,14 @@ namespace zephyr_oracle {
|
|||||||
return ZEPHRSV;
|
return ZEPHRSV;
|
||||||
} else if (asset_type == "ZYIELD") {
|
} else if (asset_type == "ZYIELD") {
|
||||||
return ZYIELD;
|
return ZYIELD;
|
||||||
|
} else if (asset_type == "ZPH") {
|
||||||
|
return ZPH;
|
||||||
|
} else if (asset_type == "ZSD") {
|
||||||
|
return ZSD;
|
||||||
|
} else if (asset_type == "ZRS") {
|
||||||
|
return ZRS;
|
||||||
|
} else if (asset_type == "ZYS") {
|
||||||
|
return ZYS;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@@ -77,6 +99,14 @@ namespace zephyr_oracle {
|
|||||||
ZEPHRSV += val;
|
ZEPHRSV += val;
|
||||||
} else if (asset_type == "ZYIELD") {
|
} else if (asset_type == "ZYIELD") {
|
||||||
ZYIELD += val;
|
ZYIELD += val;
|
||||||
|
} else if (asset_type == "ZPH") {
|
||||||
|
ZPH += val;
|
||||||
|
} else if (asset_type == "ZSD") {
|
||||||
|
ZSD += val;
|
||||||
|
} else if (asset_type == "ZRS") {
|
||||||
|
ZRS += val;
|
||||||
|
} else if (asset_type == "ZYS") {
|
||||||
|
ZYS += val;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ namespace zephyr_oracle
|
|||||||
END_KV_SERIALIZE_MAP()
|
END_KV_SERIALIZE_MAP()
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
pricing_record::pricing_record() noexcept
|
pricing_record::pricing_record() noexcept
|
||||||
: spot(0)
|
: spot(0)
|
||||||
, moving_average(0)
|
, moving_average(0)
|
||||||
@@ -152,7 +152,7 @@ namespace zephyr_oracle
|
|||||||
::memcpy(signature, orig.signature, sizeof(signature));
|
::memcpy(signature, orig.signature, sizeof(signature));
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool pricing_record::equal(const pricing_record& other) const noexcept
|
bool pricing_record::equal(const pricing_record& other) const noexcept
|
||||||
{
|
{
|
||||||
return ((spot == other.spot) &&
|
return ((spot == other.spot) &&
|
||||||
@@ -256,7 +256,7 @@ namespace zephyr_oracle
|
|||||||
}
|
}
|
||||||
|
|
||||||
// overload for pr validation for block
|
// overload for pr validation for block
|
||||||
bool pricing_record::valid(uint32_t hf_version, uint64_t bl_timestamp, uint64_t last_bl_timestamp) const
|
bool pricing_record::valid(uint32_t hf_version, uint64_t bl_timestamp, uint64_t last_bl_timestamp) const
|
||||||
{
|
{
|
||||||
if (hf_version < 3) {
|
if (hf_version < 3) {
|
||||||
if (!this->empty())
|
if (!this->empty())
|
||||||
@@ -298,4 +298,3 @@ namespace zephyr_oracle
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ namespace zephyr_oracle
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// Fields
|
// Fields
|
||||||
uint64_t spot;
|
uint64_t spot;
|
||||||
uint64_t moving_average;
|
uint64_t moving_average;
|
||||||
uint64_t stable;
|
uint64_t stable;
|
||||||
@@ -127,7 +127,7 @@ namespace zephyr_oracle
|
|||||||
{
|
{
|
||||||
return a.equal(b);
|
return a.equal(b);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool operator!=(const pricing_record& a, const pricing_record& b) noexcept
|
inline bool operator!=(const pricing_record& a, const pricing_record& b) noexcept
|
||||||
{
|
{
|
||||||
return !a.equal(b);
|
return !a.equal(b);
|
||||||
@@ -252,4 +252,4 @@ namespace zephyr_oracle
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
} // oracle
|
} // zephyr_oracle
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
"use strict";
|
||||||
|
let u = require('../build/Release/cryptoforknote');
|
||||||
|
|
||||||
|
const b = Buffer.from(
|
||||||
|
'1010c59099c206028309f83a444da29afb16cc97126b0d82a0ef9dacdc5f5384e4d14f2bed221f00000000030005bbd769abd769abd769abd769abd769abd76901ff99d7690580c8afa02502c7a7d056ac171af27f081eb7113ee31eb6eac4c523960f31bc54ae4150fd087a80c8afa025022a74a3c4c36d32e95633d44ba9a7b8188297b2ac91afecab826b86fabaa7091680bcc1960b02a42e0bf2c44c7c5f43798f4be091a04d36e21b7a2f85008ff939dc028c1d14e980bcc1960b02c8b180ae1eef14bb14953eb6b0f8d66111c80067dfe9e689fdf72cf1b0d9d58580bcc1960b027d3ab388e3e7844bc42562edf05fb34d4b30b281b1307c75d7d3acfc90ed69b57601a15624111f421a5b16fd3350b5b234d288aa9e369a090fcdaeab7079361a74600211000000228f09650000000000000000000001cb6e8a28b50d5427f24dd6ede582e5eb895d739ad2cfe7eb7df31d7dcf1531c47200000000000000000000000000000000000000000000000000000000000000000000', 'hex');
|
||||||
|
const b2 = u.convert_blob(b, 16);
|
||||||
|
const h1 = b2.toString('hex');
|
||||||
|
|
||||||
|
if (h1 === '1010c59099c206028309f83a444da29afb16cc97126b0d82a0ef9dacdc5f5384e4d14f2bed221f000000006ebc660a5f50595d256087798e91ff9184878de2db66d791108ec4149dcd01fc01') {
|
||||||
|
console.log('PASSED');
|
||||||
|
} else {
|
||||||
|
console.log('FAILED: ' + h1);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
+2
-1
@@ -3,6 +3,7 @@
|
|||||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
|
||||||
cd $DIR
|
cd $DIR
|
||||||
|
node arq.js || exit 1
|
||||||
node bloc.js || exit 1
|
node bloc.js || exit 1
|
||||||
node ird.js || exit 1
|
node ird.js || exit 1
|
||||||
node msr.js || exit 1
|
node msr.js || exit 1
|
||||||
@@ -15,4 +16,4 @@ node xla.js || exit 1
|
|||||||
node xmr.js || exit 1
|
node xmr.js || exit 1
|
||||||
node xmv.js || exit 1
|
node xmv.js || exit 1
|
||||||
node xtnc.js || exit 1
|
node xtnc.js || exit 1
|
||||||
node zeph.js || exit 1
|
node zeph.js || exit 1
|
||||||
|
|||||||
Reference in New Issue
Block a user