chore: format code

This commit is contained in:
Vlad Stan
2022-08-19 08:51:57 +03:00
parent fb7030c30f
commit 713909292e
5 changed files with 27 additions and 25 deletions

View File

@@ -571,8 +571,6 @@ async function serialSigner(path) {
// noting to do here yet
break
}
},
hwwPair: async function () {
try {
@@ -637,30 +635,36 @@ async function serialSigner(path) {
.getSharedSecret(this.decryptionKey, hwwPublicKey)
.slice(1, 33)
const sharedSecretHex = nobleSecp256k1.utils.bytesToHex(this.sharedSecret)
const sharedSecredHash = await nobleSecp256k1.utils.sha256(asciiToUint8Array(sharedSecretHex))
const fingerprint = nobleSecp256k1.utils.bytesToHex(sharedSecredHash).substring(0, 5).toUpperCase()
const sharedSecretHex = nobleSecp256k1.utils.bytesToHex(
this.sharedSecret
)
const sharedSecredHash = await nobleSecp256k1.utils.sha256(
asciiToUint8Array(sharedSecretHex)
)
const fingerprint = nobleSecp256k1.utils
.bytesToHex(sharedSecredHash)
.substring(0, 5)
.toUpperCase()
console.log('### fingerprint', fingerprint)
//
//
LNbits.utils
.confirmDialog('Confirm code from display: '+fingerprint)
.onOk(() => {
this.addPairedDevice(
this.deviceId,
nobleSecp256k1.utils.bytesToHex(this.sharedSecret)
)
this.$q.notify({
type: 'positive',
message: 'Paired with device!',
timeout: 5000
})
}).onCancel(() => {
this.closeSerialPort()
})
.confirmDialog('Confirm code from display: ' + fingerprint)
.onOk(() => {
this.addPairedDevice(
this.deviceId,
nobleSecp256k1.utils.bytesToHex(this.sharedSecret)
)
this.$q.notify({
type: 'positive',
message: 'Paired with device!',
timeout: 5000
})
})
.onCancel(() => {
this.closeSerialPort()
})
},
hwwHelp: async function () {
try {

View File

@@ -1,7 +1,6 @@
<div>
<q-card>
<div class="row items-center no-wrap q-mb-md">
<div class="col-md-2 col-xs-4 q-ml-lg">
<q-btn unelevated @click="show = true" color="primary" icon="settings">
</q-btn>

View File

@@ -19,7 +19,6 @@ const COMMAND_CHECK_PAIRING = '/check-pairing'
const DEFAULT_RECEIVE_GAP_LIMIT = 20
const PAIRING_CONTROL_TEXT = 'lnbits'
const blockTimeToDate = blockTime =>
blockTime ? moment(blockTime * 1000).format('LLL') : ''

View File

@@ -189,7 +189,6 @@
icon="launch"
type="a"
:href="'https://' + mempoolHostname + '/address/' + currentAddress.address"
target="_blank"
></q-btn>
</p>

View File

@@ -151,6 +151,7 @@ def build_insert_query(schema, tableName, columns):
VALUES ({values});
"""
def to_column_type(columnType):
if columnType == "TIMESTAMP":
return "to_timestamp(%s)"