Skip to content

Commit

Permalink
feat(AENS): Fix transfer command. Add more test for transfer AENS n…
Browse files Browse the repository at this point in the history
…ames
  • Loading branch information
nduchak committed Apr 7, 2020
1 parent 77d2d3c commit 547af5a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bin/commands/aens.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ async function transferName (walletPath, domain, address, options) {
}

// Create `transferName` transaction
const transferTX = await client.aensTransfer(name.id, address, { ttl, fee, nonce, waitMined })
const transferTX = await client.aensTransfer(domain, address, { ttl, fee, nonce, waitMined })
if (waitMined) {
printTransaction(
transferTX,
Expand Down
11 changes: 11 additions & 0 deletions test/cli/aens.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,17 @@ describe.only('CLI AENS Module', function () {
const balance = await wallet.getBalance(publicKey)
balance.should.be.equal(`${amount}`)
})
it('Transfer name', async () => {
const keypair = generateKeyPair()
await wallet.addAccount(MemoryAccount({ keypair }))

const transferTx = JSON.parse(await execute(['name', 'transfer', WALLET_NAME, name2, keypair.publicKey, '--password', 'test', '--json']))
transferTx.blockHeight.should.be.gt(0)
await wallet.spend(1, keypair.publicKey, { denomination: 'ae' })
const claim2 = await wallet.aensQuery(name2)
const transferBack = await claim2.transfer(await wallet.address(), { onAccount: keypair.publicKey })
transferBack.blockHeight.should.be.gt(0)
})
it('Revoke Name', async () => {
const revoke = JSON.parse(await execute(['name', 'revoke', WALLET_NAME, '--password', 'test', name2, '--json']))
const nameResult = JSON.parse(await execute(['inspect', name2, '--json']))
Expand Down

0 comments on commit 547af5a

Please sign in to comment.