Merge remote-tracking branch 'origin/diagon-alley' into diagon-alley

This commit is contained in:
ben 2022-11-30 12:22:36 +00:00
commit dae9db7042
2 changed files with 5 additions and 5 deletions

View file

@ -336,13 +336,13 @@
this.user = null this.user = null
}) })
}, },
async generateKeys(payment_hash) { async generateKeys() {
//check if the keys are set //check if the keys are set
if ('publickey' in this.user.keys && 'privatekey' in this.user.keys) if ('publickey' in this.user.keys && 'privatekey' in this.user.keys)
return return
return await LNbits.api return await LNbits.api
.request('GET', `/diagonalley/api/v1/keys/${payment_hash}`, null) .request('GET', `/diagonalley/api/v1/keys`, null)
.then(response => { .then(response => {
if (response.data) { if (response.data) {
let data = { let data = {
@ -457,7 +457,7 @@
} }
} else { } else {
// generate keys // generate keys
this.generateKeys(order_id) this.generateKeys()
// populate user data // populate user data
this.user.orders = { this.user.orders = {
[`${order_id}`]: this.products [`${order_id}`]: this.products

View file

@ -481,8 +481,8 @@ async def api_diagonalley_stall_create(
## KEYS ## KEYS
@diagonalley_ext.get("/api/v1/keys/{payment_hash}") @diagonalley_ext.get("/api/v1/keys")
async def api_diagonalley_generate_keys(payment_hash: str): async def api_diagonalley_generate_keys():
private_key = PrivateKey() private_key = PrivateKey()
public_key = private_key.pubkey.serialize().hex() public_key = private_key.pubkey.serialize().hex()
while not public_key.startswith("02"): while not public_key.startswith("02"):