Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| aa39526fe8 | |||
| 44ee67d21f | |||
| 0f9c969b83 | |||
| ac5dcc2133 | |||
| 069c83ef32 | |||
| 655f79b0e0 |
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "cryptoforknote-util",
|
"name": "cryptoforknote-util",
|
||||||
"version": "15.6.0",
|
"version": "15.6.1",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "LucasJones",
|
"name": "LucasJones",
|
||||||
"email": "lucasjonesdev@hotmail.co.uk"
|
"email": "lucasjonesdev@hotmail.co.uk"
|
||||||
|
|||||||
@@ -447,8 +447,11 @@ namespace cryptonote
|
|||||||
// SALVIUM-SPECIFIC FIELDS
|
// SALVIUM-SPECIFIC FIELDS
|
||||||
// TX type
|
// TX type
|
||||||
cryptonote::salvium_transaction_type tx_type;
|
cryptonote::salvium_transaction_type tx_type;
|
||||||
// Return address
|
|
||||||
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)
|
||||||
|
std::vector<crypto::public_key> return_address_list;
|
||||||
|
//return_address_change_mask
|
||||||
|
std::vector<uint8_t> return_address_change_mask;
|
||||||
// Return TX public key
|
// Return TX public key
|
||||||
crypto::public_key return_pubkey;
|
crypto::public_key return_pubkey;
|
||||||
// Source asset type
|
// Source asset type
|
||||||
@@ -737,8 +740,13 @@ namespace cryptonote
|
|||||||
if (tx_type != cryptonote::salvium_transaction_type::PROTOCOL) {
|
if (tx_type != cryptonote::salvium_transaction_type::PROTOCOL) {
|
||||||
VARINT_FIELD(amount_burnt)
|
VARINT_FIELD(amount_burnt)
|
||||||
if (tx_type != cryptonote::salvium_transaction_type::MINER) {
|
if (tx_type != cryptonote::salvium_transaction_type::MINER) {
|
||||||
FIELD(return_address)
|
if (type == cryptonote::salvium_transaction_type::TRANSFER && version >= TRANSACTION_VERSION_N_OUTS) {
|
||||||
FIELD(return_pubkey)
|
FIELD(return_address_list)
|
||||||
|
FIELD(return_address_change_mask)
|
||||||
|
} else {
|
||||||
|
FIELD(return_address)
|
||||||
|
FIELD(return_pubkey)
|
||||||
|
}
|
||||||
FIELD(source_asset_type)
|
FIELD(source_asset_type)
|
||||||
FIELD(destination_asset_type)
|
FIELD(destination_asset_type)
|
||||||
VARINT_FIELD(amount_slippage_limit)
|
VARINT_FIELD(amount_slippage_limit)
|
||||||
@@ -915,6 +923,15 @@ namespace cryptonote
|
|||||||
amount_minted = 0;
|
amount_minted = 0;
|
||||||
output_unlock_times.clear();
|
output_unlock_times.clear();
|
||||||
collateral_indices.clear();
|
collateral_indices.clear();
|
||||||
|
// SAL
|
||||||
|
tx_type = cryptonote::salvium_transaction_type::UNSET;
|
||||||
|
return_address = cryptonote::null_pkey;
|
||||||
|
return_address_list.clear();
|
||||||
|
return_address_change_mask.clear();
|
||||||
|
return_pubkey = cryptonote::null_pkey;
|
||||||
|
source_asset_type.clear();
|
||||||
|
destination_asset_type.clear();
|
||||||
|
amount_slippage_limit = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline
|
inline
|
||||||
@@ -1080,7 +1097,7 @@ namespace cryptonote
|
|||||||
if (blob_type == BLOB_TYPE_CRYPTONOTE_XHV) {
|
if (blob_type == BLOB_TYPE_CRYPTONOTE_XHV) {
|
||||||
FIELD(pricing_record)
|
FIELD(pricing_record)
|
||||||
} else if (blob_type == BLOB_TYPE_CRYPTONOTE_SALVIUM) {
|
} else if (blob_type == BLOB_TYPE_CRYPTONOTE_SALVIUM) {
|
||||||
if (major_version >= 2) FIELD(salvium_pricing_record)
|
if (major_version >= 255) FIELD(salvium_pricing_record)
|
||||||
} else if (blob_type == BLOB_TYPE_CRYPTONOTE_ZEPHYR) {
|
} else if (blob_type == BLOB_TYPE_CRYPTONOTE_ZEPHYR) {
|
||||||
if (major_version >= 6)
|
if (major_version >= 6)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -287,7 +287,11 @@ namespace cryptonote
|
|||||||
}
|
}
|
||||||
crypto::hash tree_root_hash = get_tx_tree_hash(b);
|
crypto::hash tree_root_hash = get_tx_tree_hash(b);
|
||||||
blob.append(reinterpret_cast<const char*>(&tree_root_hash), sizeof(tree_root_hash));
|
blob.append(reinterpret_cast<const char*>(&tree_root_hash), sizeof(tree_root_hash));
|
||||||
blob.append(tools::get_varint_data(b.tx_hashes.size()+1));
|
if (b.blob_type == BLOB_TYPE_CRYPTONOTE_SALVIUM) {
|
||||||
|
blob.append(tools::get_varint_data(b.tx_hashes.size() + (b.major_version >= HF_VERSION_ENABLE_N_OUTS ? 2 : 1)));
|
||||||
|
} else {
|
||||||
|
blob.append(tools::get_varint_data(b.tx_hashes.size()+1));
|
||||||
|
}
|
||||||
if (b.blob_type == BLOB_TYPE_CRYPTONOTE3) {
|
if (b.blob_type == BLOB_TYPE_CRYPTONOTE3) {
|
||||||
blob.append(reinterpret_cast<const char*>(&b.uncle), sizeof(b.uncle));
|
blob.append(reinterpret_cast<const char*>(&b.uncle), sizeof(b.uncle));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,8 @@
|
|||||||
#define HF_VERSION_XASSET_FEES_V2 17
|
#define HF_VERSION_XASSET_FEES_V2 17
|
||||||
#define HF_VERSION_HAVEN2 18
|
#define HF_VERSION_HAVEN2 18
|
||||||
#define HF_VERSION_USE_COLLATERAL 20
|
#define HF_VERSION_USE_COLLATERAL 20
|
||||||
|
#define HF_VERSION_ENABLE_N_OUTS 2
|
||||||
|
#define TRANSACTION_VERSION_N_OUTS 3
|
||||||
|
|
||||||
// UNLOCK TIMES
|
// UNLOCK TIMES
|
||||||
#define TX_V6_OFFSHORE_UNLOCK_BLOCKS 21*720 // 21 day unlock time
|
#define TX_V6_OFFSHORE_UNLOCK_BLOCKS 21*720 // 21 day unlock time
|
||||||
|
|||||||
+3
-3
@@ -2,14 +2,14 @@
|
|||||||
let u = require('../build/Release/cryptoforknote');
|
let u = require('../build/Release/cryptoforknote');
|
||||||
|
|
||||||
const b = Buffer.from(
|
const b = Buffer.from(
|
||||||
'010194a5ebb406f613c4e7514facf3e5b9923c885357b53f2b02f8e17f9721371296b99113035f00000000020001ffcb6d018f9ffec12d03125e128c041c8a2d41fab9ebe2a7a4b10afbef4e134ec7ba3151c8c730a644310353414c3c7334015f99bdbbe70161dafb2da2fd9a4285da893a7519cff350981a959f525c43e5c60211000000000000000000000000000000000001e3c7bfb00b00020001ffcb6d0023016b6961b458286074406192961c1f0e5236455f45fcd6c175c7142d6353a481d60400020000'
|
'0202fdaca8b906b1670506d0dc45b11cbc87f9ceedfd0cbfa56c14da72ccc27c45105391d2340300000000020001ffbabe0501a1ca9fab2a035c20fce0617f61abf3872058e15b90650b2ac812bf344766f56ee54b680f571e0353414c3c863401618163d383093580900f735ea9ad5d3d0029dd94c2f2a35db88ec37dc32e863302110000bcdd9d15420000000000000000000001c8f2e7ca0a00020001ffbabe05002301bb1086494863ac8de0987e09f7193ac85a356f8abf8725202cbf4dea8b2611f20400020000'
|
||||||
, 'hex');
|
, 'hex');
|
||||||
const b2 = u.convert_blob(b, 15);
|
const b2 = u.convert_blob(b, 15);
|
||||||
const h1 = b2.toString('hex');
|
const h1 = b2.toString('hex');
|
||||||
|
|
||||||
if (h1 === '010194a5ebb406f613c4e7514facf3e5b9923c885357b53f2b02f8e17f9721371296b99113035f00000000ac81ca3e7bc9369e63563923187d2cfdb42eac839c7fe24e6d5d0080c96d758f01') {
|
if (h1 === '0202fdaca8b906b1670506d0dc45b11cbc87f9ceedfd0cbfa56c14da72ccc27c45105391d2340300000000604ec6923c81b6477bb224a9c53158cea5c5aee36100aad59c498d3dab92750402') {
|
||||||
console.log('PASSED');
|
console.log('PASSED');
|
||||||
} else {
|
} else {
|
||||||
console.log('FAILED: ' + h1);
|
console.log('FAILED: ' + h1);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user