Start integration of bulletproofs

pull/111/head
moneroexamples 6 years ago
parent 2728a28757
commit ed020da6c1

@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.2)
set(PROJECT_NAME
set(PROJECT_NAME/home/mwo/mymonero-app-js/local_modules/mymonero_core_js/monero_utils/monero_sendingFunds_utils.js
openmonero)
project(${PROJECT_NAME})

@ -22,13 +22,10 @@ to MyMonero. They include:
- added support of testnet and stagenet networks, and mainnet without relying transactions
- improved handling of mempool, coinbase, locked and unlocked transactions.
- view only mode added.
- private tx key given to a user which can be used to prove sending xmr to a recipient.
- Cross-Origin Resource Sharing (CORS) disabled.
- transaction confirmation window added to double check tx details before its commited.
- ability to select transaction priority.
- legacy address + payment_id system replaced with integrated addresses for better privacy.
- free, time based imports of recent transactions added.
- new transaction details window.
- sending xmr to a subaddress (not receiving nor generating subaddresses for now).
## Live stagenet version
@ -99,7 +96,7 @@ git clone --recursive https://github.com/monero-project/monero
cd monero/
make
USE_SINGLE_BUILDDIR=1 make
```
#### Compilation of the OpenMonero (don't run it yet)

@ -230,6 +230,11 @@ var cnUtil = (function(initConfig) {
return mn_random(128);
};
// Generate a 64-bit crypto random
this.rand_8 = function() {
return mn_random(64);
};
this.encode_varint = function(i) {
i = new JSBigInt(i);
var out = '';

@ -60,16 +60,16 @@ class HostedMoneroAPIClient
parameters.use_dust = true // Client now filters unmixable by dustthreshold amount (unless sweeping) + non-rct
parameters.dust_threshold = mymonero_core_js.monero_config.dustThreshold.toString()
const endpointPath = 'get_unspent_outs'
self.$http.post(config.apiUrl + endpointPath, parameters).success(
self.$http.post(config.apiUrl + endpointPath, parameters).then(
function(data)
{
console.log(data);
__proceedTo_parseAndCallBack(data)
__proceedTo_parseAndCallBack(data.data)
}
).error(
).catch(
function(data)
{
console.log("error", data);
console.log("error", data.data);
fn(data && data.Error ? data.Error : "Something went wrong with getting your available balance for spending");
}
);
@ -90,6 +90,7 @@ class HostedMoneroAPIClient
fn(err)
return
}
console.log("returnValuesByKey", returnValuesByKey);
console.log("returnValuesByKey.per_kb_fee" , returnValuesByKey.per_kb_fee)
const per_kb_fee__String = returnValuesByKey.per_kb_fee
if (per_kb_fee__String == null || per_kb_fee__String == "" || typeof per_kb_fee__String === 'undefined') {
@ -144,12 +145,12 @@ class HostedMoneroAPIClient
count: mixinNumber + 1 // Add one to mixin so we can skip real output key if necessary
}
const endpointPath = 'get_random_outs'
self.$http.post(config.apiUrl + endpointPath, parameters).success(
self.$http.post(config.apiUrl + endpointPath, parameters).then(
function(data)
{
__proceedTo_parseAndCallBack(data)
__proceedTo_parseAndCallBack(data.data)
}
).error(
).catch(
function(data)
{
fn(data && data.Error ? data.Error : "Something went wrong while getting decoy outputs");
@ -191,12 +192,12 @@ class HostedMoneroAPIClient
};
parameters.tx = serializedSignedTx
const endpointPath = 'submit_raw_tx'
self.$http.post(config.apiUrl + endpointPath, parameters).success(
self.$http.post(config.apiUrl + endpointPath, parameters).then(
function(data)
{
__proceedTo_parseAndCallBack(data)
__proceedTo_parseAndCallBack(data.data)
}
).error(
).catch(
function(data)
{
fn(data && data.Error ? data.Error : "Something went wrong with getting your available balance for spending");
@ -331,7 +332,7 @@ thinwalletCtrls.controller('SendCoinsCtrl', function($scope, $http, $q, AccountS
var domain = target.address.replace(/@/g, ".");
$http.post(config.apiUrl + "get_txt_records", {
domain: domain
}).success(function(data) {
}).then(function(data) {
var records = data.records;
var oaRecords = [];
console.log(domain + ": ", data.records);
@ -386,7 +387,7 @@ thinwalletCtrls.controller('SendCoinsCtrl', function($scope, $http, $q, AccountS
fn("Failed to decode OpenAlias address: " + oaRecords[0].address + ": " + e);
return;
}
}).error(function(data) {
}).catch(function(data) {
fn("Failed to resolve DNS records for '" + domain + "': " + ((data || {}).Error || data || "Unknown error"));
return
});

@ -52,6 +52,7 @@
data-name="Receiver Address 2" ng-model="payment_id">
</div>
</div>
<!--
<label class="send-label" for="field4">Privacy Level</label>
<select class="w-input" id="field4" name="Select-a-number" data-name="Select a number"
required="required" ng-model="mixins">
@ -60,6 +61,8 @@
<option value="20">Even higher (ring size 21)</option>
<option value="40">Paranoid (ring size 41)</option>
</select>
-->
<!--
<label class="send-label" for="field5">Priority Level (adjusts miner fee)</label>
<select class="w-input" id="field5" name="Select-a-number" data-name="Select a number"
required="required" ng-model="priority">
@ -68,6 +71,7 @@
<option value="3">High (if you are in hurry and if there is some backlog of txs)</option>
<option value="4">Paranoid (absolute priority, but the most expensive obviously)</option>
</select>
-->
<input class="w-button send-btn" id="form-submit" type="submit" value="Send Payment"
data-wait="Please wait..." ng-disabled="submitting">
</form>
@ -100,6 +104,7 @@
<div class="move-text-div">
<div class="middle-text receive">{{sent_tx.tx_id}}</div>
</div>
<!--
<label class="send-label" >Transaction Private Key</label>
<div class="move-text-div">
<div class="middle-text receive">{{sent_tx.tx_prvkey}}</div>
@ -108,6 +113,7 @@
<div class="move-text-div">
<a class="login-link" href="{{ sent_tx.explorerLink }} " target="_blank">{{ sent_tx.explorerLink }}</a>
</div>
-->
<input class="w-button send-btn" type="submit" value="Send Another Payment" data-wait="Please wait...">
</form>
</div>

@ -196,7 +196,7 @@ CurrentBlockchainStatus::get_tx_with_output(
// and second is local index of the output i in that tx
tx_out_idx = mcore->get_output_tx_and_index(amount, output_idx);
}
catch (const OUTPUT_DNE &e)
catch (const OUTPUT_DNE& e)
{
string out_msg = fmt::format(
@ -204,7 +204,7 @@ CurrentBlockchainStatus::get_tx_with_output(
amount, output_idx
);
OMERROR << out_msg;
OMERROR << out_msg << ' ' << e.what();
return false;
}
@ -340,17 +340,16 @@ CurrentBlockchainStatus::get_output(
uint64_t
CurrentBlockchainStatus::get_dynamic_per_kb_fee_estimate() const
{
return mcore->get_dynamic_per_kb_fee_estimate(
FEE_ESTIMATE_GRACE_BLOCKS)*1024;
}
const double byte_to_kbyte_factor = 1024;
//uint64_t
//CurrentBlockchainStatus::get_dynamic_base_fee_estimate() const
//{
// return mcore->get_dynamic_base_fee_estimate(
// FEE_ESTIMATE_GRACE_BLOCKS);
//}
uint64_t fee_per_byte = mcore->get_dynamic_base_fee_estimate(
FEE_ESTIMATE_GRACE_BLOCKS);
uint64_t fee_per_kB = static_cast<uint64_t>(
fee_per_byte * byte_to_kbyte_factor);
return fee_per_kB;
}
bool

@ -167,12 +167,6 @@ public:
return core_storage.get_outs(req, res);
}
virtual uint64_t
get_dynamic_per_kb_fee_estimate(uint64_t const& grace_blocks) const
{
return core_storage.get_dynamic_base_fee_estimate(grace_blocks);
}
virtual uint64_t
get_dynamic_base_fee_estimate(uint64_t const& grace_blocks) const
{

@ -728,15 +728,15 @@ YourMoneroRequests::get_unspent_outs(
} // if (xmr_accounts->select_txs(acc.id, txs))
j_response["amount"] = total_outputs_amount;
j_response["amount"] = std::to_string(total_outputs_amount);
// need proper per_kb_fee estimate as
// it is already using dynanamic fees. frontend
// uses old fixed fees.
j_response["per_kb_fee"] = current_bc_status
->get_dynamic_per_kb_fee_estimate();
j_response["per_kb_fee"] = std::to_string(current_bc_status
->get_dynamic_per_kb_fee_estimate());
} // if (current_bc_status->search_thread_exist(xmr_address))

Loading…
Cancel
Save