From ff51e91efafc8f12f303ba1c86a5032d5b963aa1 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Thu, 9 Dec 2021 19:44:34 -0500 Subject: sort contract fields --- lib/sync.js | 4 ++-- routes/assets.js | 22 ++++++---------------- 2 files changed, 8 insertions(+), 18 deletions(-) diff --git a/lib/sync.js b/lib/sync.js index ba8d0a48..40f3f56f 100644 --- a/lib/sync.js +++ b/lib/sync.js @@ -269,5 +269,5 @@ const sync = async () => { } }; -setTimeout(sync, 5000); -setInterval(sync, 720000); +// setTimeout(sync, 5000); +// setInterval(sync, 720000); diff --git a/routes/assets.js b/routes/assets.js index 14d2c705..cf9aca4e 100644 --- a/routes/assets.js +++ b/routes/assets.js @@ -102,29 +102,19 @@ app.post( : (await lq.getAddressInfo(asset_address)).pubkey; const version = 0; - let contract; - - if (filename) { - contract = { - entity: { domain }, - file: filename, - issuer_pubkey, - name, - precision, - ticker, - version - }; - } else { - contract = { + let contract = { entity: { domain }, issuer_pubkey, name, precision, - ticker, version - }; } + if (filename) contract.file = filename; + if (ticker) contract.ticker = ticker; + + contract = Object.keys(contract).sort().reduce((r, k) => (r[k] = contract[k], r), {}); + l.info( "attempting issuance", req.user.username, -- cgit v1.2.3