Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
fr1t2 committed Jan 15, 2022
1 parent 9dcdb8b commit 5358a32
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 35 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,9 @@ ARGUMENTS
ADDRESS QRL address to validate
OPTIONS
-q, --quiet Quiet mode: no address details, just return validity via exit code
-i, --index=index address index to validate if more than one in file {default = 0}
-p, --password=password QRL Wallet encryption passphrase.
-q, --quiet Quiet mode: no address details, just return validity via exit code
DESCRIPTION
...
Expand Down
9 changes: 1 addition & 8 deletions src/commands/send.js
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ class Send extends Command {
this.exit(1)
}
}
let fee = 100 // default fee 100 Shor
let fee = 0 // default fee 100 Shor
if (flags.fee) {
const passedFee = parseInt(flags.fee, 10)
if (passedFee) {
Expand Down Expand Up @@ -408,7 +408,6 @@ class Send extends Command {
}
xmssPK = Buffer.from(XMSS_OBJECT.getPK(), 'hex')
}

let tx
let Qrlnetwork
if (!flags.savetofile) {
Expand All @@ -427,7 +426,6 @@ class Send extends Command {
i++
}
spinner1.succeed(`Connected!`)

if (!flags.loadfromfile) {
let request
if (flags.message) {
Expand All @@ -447,9 +445,7 @@ class Send extends Command {
xmss_pk: xmssPK,
}
}
console.log(request)
tx = await Qrlnetwork.api('TransferCoins', request)

spinner.succeed('Node correctly returned transaction for signing')
} else {
let txFromFile
Expand All @@ -459,7 +455,6 @@ console.log(request)
this.log(`${red('⨉')} Invalid transaction file`)
this.exit(1)
}
console.log(txFromFile.tx.transfer.message_data)
if (txFromFile.tx.transfer.message_data) {
tx = {
extended_transaction_unsigned: {
Expand Down Expand Up @@ -543,8 +538,6 @@ console.log(request)
spinner.succeed('XMSS_OBJECT is created')
}

console.log(tx)

let txnHash
if (!flags.loadfromfile) {
const spinner2 = ora({ text: 'Signing transaction...' }).start()
Expand Down
7 changes: 1 addition & 6 deletions test/hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ function regenSharedKeys(input) {
})
}

/*
function fileRemove(dir) {
let exitCode
try {
Expand All @@ -180,7 +179,6 @@ function fileRemove(dir) {
}
return exitCode
}
*/

//
// global testSetup for all tests Runs before tests are performed
Expand Down Expand Up @@ -250,12 +248,10 @@ exports.mochaHooks = {
sendOfflineFileGen({ dir: testSetup.sendTXOfflineFile , walletFile: testSetup.walletFile })
},


//
// One-time final cleanup run after all testing is complete
//
afterAll: function _After() {
/*
fileRemove(testSetup.emptyText)

fileRemove(testSetup.badWallet)
Expand Down Expand Up @@ -290,7 +286,6 @@ exports.mochaHooks = {
fileRemove(testSetup.aliceCipherTextOut)
fileRemove(testSetup.aliceTempCipherTextOut)

fileRemove(testSetup.bobLatticeLocation)
fileRemove(testSetup.bobTempLatticeKey)
fileRemove(testSetup.bobENCLatticeLocation)
Expand All @@ -309,6 +304,6 @@ exports.mochaHooks = {
fileRemove(testSetup.bobCipherTextOut)
fileRemove(testSetup.bobTempCipherTextOut)
fileRemove(testSetup.sendTXOfflineFile)
*/

}
};
21 changes: 1 addition & 20 deletions test/test_setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const emptyText = path.join(__dirname, '/test-wallet/empty.txt')

const badWallet = path.join(__dirname, '/test-wallet/badWallet.json') // bad wallet json
const notAWalletFile = path.join(__dirname, '/test-wallet/nope.json') // bad wallet nope
const walletFile = path.join(__dirname, '/test-wallet/wallet.json') // plain text wallet. OTS: 0,
const walletFile = path.join(__dirname, '/test-wallet/wallet.json') // plain text wallet. OTS: 0, 1
const encWalletFile = path.join(__dirname, '/test-wallet/encWallet.json') // encrypted wallet. OTS: 0,

// Alice
Expand Down Expand Up @@ -87,16 +87,6 @@ const bobTempRegenSharedKeyFile = path.join(__dirname, '/lattice/bob/bob-temp-re
const bobCipherTextOut = path.join(__dirname, '/lattice/bob/bob-cipher-text.txt')
const bobTempCipherTextOut = path.join(__dirname, '/lattice/bob/bob-temp-cipher-text.txt')











// /////////
// Send Test
// /////////
Expand Down Expand Up @@ -162,17 +152,8 @@ module.exports = {
bobCipherTextOut,
bobTempCipherTextOut,






sendTXOfflineFile,





}


0 comments on commit 5358a32

Please sign in to comment.