Skip to content

Commit 12b1518

Browse files
authored
fix req to accept (#455)
1 parent 9645ed1 commit 12b1518

File tree

6 files changed

+16
-15
lines changed

6 files changed

+16
-15
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
# 0.3.1
1+
# 0.3.2
2+
3+
* Fixed `request_to_accept` calling the correct action
24

5+
# 0.3.1
36

47
* Persist active Identity to DB for WASM
58
* Change indexed-db name to "data"

crates/bcr-ebill-api/src/service/notification_service/default_service.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ impl DefaultNotificationService {
5656
}
5757

5858
fn get_local_identity(&self, node_id: &str) -> Option<IdentityPublicData> {
59-
if self.notification_transport.get(node_id).is_some() {
59+
if self.notification_transport.contains_key(node_id) {
6060
Some(IdentityPublicData {
6161
t: ContactType::Person,
6262
node_id: node_id.to_string(),

crates/bcr-ebill-wasm/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ <h2>Bill Testing</h2>
5353
Bill Id: <input type="text" id="endorse_bill_id"/>
5454
Endorsee Id: <input type="text" id="endorsee_id"/>
5555
<button type="button" id="endorse_bill">Endorse bill to Endorsee</button>
56+
<button type="button" id="req_to_accept_bill">Request to Accept</button>
5657
</div>
5758
<h2>Bill Performance</h2>
5859
<div>

crates/bcr-ebill-wasm/main.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ document.getElementById("bill_fetch_bills").addEventListener("click", fetchBillB
1515
document.getElementById("bill_balances").addEventListener("click", fetchBillBalances);
1616
document.getElementById("bill_search").addEventListener("click", fetchBillSearch);
1717
document.getElementById("endorse_bill").addEventListener("click", endorseBill);
18+
document.getElementById("req_to_accept_bill").addEventListener("click", requestToAcceptBill);
1819
document.getElementById("bill_test").addEventListener("click", triggerBill);
1920

2021
async function start() {
@@ -284,6 +285,14 @@ async function endorseBill() {
284285
await measured();
285286
}
286287

288+
async function requestToAcceptBill() {
289+
let bill_id = document.getElementById("endorse_bill_id").value;
290+
let measured = measure(async () => {
291+
return await billApi.request_to_accept({ bill_id });
292+
});
293+
await measured();
294+
}
295+
287296
async function fetchBillDetail() {
288297
let measured = measure(async () => {
289298
return await billApi.detail(document.getElementById("bill_id").value);

crates/bcr-ebill-wasm/src/api/bill.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ impl Bill {
402402
.bill_service
403403
.execute_bill_action(
404404
&request_to_accept_bill_payload.bill_id,
405-
BillAction::RejectAcceptance,
405+
BillAction::RequestAcceptance,
406406
&signer_public_data,
407407
&signer_keys,
408408
timestamp,

crates/bcr-ebill-wasm/src/api/quotes.rs

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)