Skip to content

Commit

Permalink
JS - 0.9.75, HF 30 - Optimize private groups, small fix
Browse files Browse the repository at this point in the history
  • Loading branch information
1aerostorm committed Sep 6, 2024
1 parent 787afce commit 422b730
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion golos-lib-js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "golos-lib-js",
"version": "0.9.74",
"version": "0.9.75",
"description": "Golos-js the JavaScript library with API for GOLOS blockchain",
"main": "lib/index.js",
"scripts": {
Expand Down
15 changes: 10 additions & 5 deletions golos-lib-js/src/auth/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,6 @@ Auth.withNodeLogin = async function ({ account, keys,
api = golosApi
}

if (!dgp) {
dgp = await api.getDynamicGlobalPropertiesAsync()
}

let resp

const { MultiSession } = multiSession
Expand All @@ -154,7 +150,16 @@ Auth.withNodeLogin = async function ({ account, keys,
}
}

const { head_block_number, witness } = dgp
let gprops
if (!dgp) {
gprops = await api.getDynamicGlobalPropertiesAsync()
} else if (typeof(dgp) === 'function') {
gprops = await dgp()
} else {
gprops = dgp
}

const { head_block_number, witness } = gprops

console.time('withNodeLogin - signData')
const signed = this.signData(head_block_number.toString(), keys)
Expand Down
2 changes: 1 addition & 1 deletion golos-lib-js/src/auth/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ export async function encodeMsg({ group,

const encrypted_message = msg.toString('hex')
return {
nonce: Aes.uniqueNonce().toString(),
nonce: nonce || Aes.uniqueNonce().toString(),
encrypted_message,
checksum: 0,
from_memo_key: emptyPublicKey,
Expand Down

0 comments on commit 422b730

Please sign in to comment.