Accept only empty nonce for memo validation script to work as a blocking script

This commit is contained in:
Kirill Fedoseev 2019-11-14 16:55:57 +03:00
parent e04ddb94ca
commit 74089e9f5c
2 changed files with 3 additions and 5 deletions

View File

@ -156,13 +156,11 @@ async function loop() {
for (let i = transactions.length - 1; i >= 0; i -= 1) {
const tx = transactions[i]
if (tx.memo !== 'funding') {
if (tx.memo === '') {
const publicKeyEncoded = (await getTx(tx.txHash)).signatures[0].pub_key.value
await proxyHttpClient.post('/transfer', {
to: computeAddress(Buffer.from(publicKeyEncoded, 'base64')),
value: new BN(tx.value)
.multipliedBy(10 ** 18)
.integerValue(),
value: new BN(tx.value).multipliedBy(10 ** 18).integerValue(),
hash: `0x${tx.txHash}`
})
}

View File

@ -40,7 +40,7 @@ async function main() {
receipt = await client.multiSend(from, outputs, 'funding')
} else {
console.log(`From ${from} to ${to}, ${tokens} ${FOREIGN_ASSET}'`)
receipt = await client.transfer(from, to, tokens, FOREIGN_ASSET, 'exchange')
receipt = await client.transfer(from, to, tokens, FOREIGN_ASSET, '')
}
if (receipt.status === 200) {