Skip to content

Commit

Permalink
fix(AENS): Change tld from aet to chain (#115)
Browse files Browse the repository at this point in the history
* fix(AENS): Change tld from `aet` to `chain`

* refactor(CLI): adjust imports

* refactor(CLI): Fix constant imports
  • Loading branch information
nduchak committed Oct 16, 2019
1 parent 0dd70d2 commit 8279579
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .env
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
TAG=v5.0.0-rc.3
COMPILER_TAG=v4.0.0-rc5
TAG=v5.0.0-rc.5
COMPILER_TAG=v4.0.0
1 change: 1 addition & 0 deletions bin/commands/account.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
*/

import { generateKeyPair } from '@aeternity/aepp-sdk/es/utils/crypto'

import { generateSecureWallet, generateSecureWalletFromPrivKey } from '../utils/account'
import { HASH_TYPES } from '../utils/constant'
import { exit, initClientByWalletFile } from '../utils/cli'
Expand Down
6 changes: 3 additions & 3 deletions bin/commands/aens.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { exit, initChain, initClientByWalletFile } from '../utils/cli'
import { printError, print, printName, printTransaction } from '../utils/print'
import { handleApiError } from '../utils/errors'
import { isAvailable, updateNameStatus, validateName } from '../utils/helpers'
import { isAddressValid } from '@aeternity/aepp-sdk/es/utils/crypto';
import { isAddressValid } from '@aeternity/aepp-sdk/es/utils/crypto'

// ## Claim `name` function
async function preClaim (walletPath, domain, options) {
Expand Down Expand Up @@ -249,8 +249,8 @@ async function fullClaim (walletPath, domain, options) {
try {
// Validate `name`
validateName(domain)
const [_, namespace] = domain.split('.')
if (namespace !== 'test' && domain.length - 4 < 13) throw new Error('Full name claiming works only with name longer then 12 symbol(Not trigger auction)')
const [aensName, namespace] = domain.split('.')
if (namespace === 'chain' && aensName.length < 13) throw new Error('Full name claiming works only with name longer then 12 symbol(Not trigger auction)')

// Get `keyPair` by `walletPath`, decrypt using password and initialize `Ae` client with this `keyPair`
const client = await initClientByWalletFile(walletPath, options)
Expand Down
5 changes: 3 additions & 2 deletions bin/utils/constant.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// # Utils `constant` Module
// That script contains default configuration for `CLI`

import { ABI_VERSIONS, VM_TYPE, VM_VERSIONS } from '@aeternity/aepp-sdk/es/tx/builder/schema'
import { ABI_VERSIONS, VM_TYPE, VM_VERSIONS, MIN_GAS_PRICE } from '@aeternity/aepp-sdk/es/tx/builder/schema'

export {
// ## AENS
Expand All @@ -27,6 +27,7 @@ export {
AENS_NAME_DOMAINS,
// ## TRANSACTION
TX_TTL,
// # CONTRACT
ABI_VERSIONS,
VM_VERSIONS,
VM_TYPE
Expand Down Expand Up @@ -59,11 +60,11 @@ export const PLAY_INTERVAL = 1000
// ## CONTRACT
export const GAS = 1600000 - 21000 // MAX GAS
export const DEPOSIT = 0
export const GAS_PRICE = MIN_GAS_PRICE
export const VM_VERSION = VM_VERSIONS.FATE
export const ABI_VERSION = ABI_VERSIONS.FATE
export const COMPILER_BACKEND = VM_TYPE.FATE
export const ORACLE_VM_VERSION = 0
export const GAS_PRICE = 1000000000 // 1e9
export const AMOUNT = 0

// ## ORACLE
Expand Down
6 changes: 3 additions & 3 deletions test/cli/aens.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ plan(10000000000000)

const execute = (arg) => exec(arg, { withNetworkId: true })

function randomName (length, namespace = '.aet') {
function randomName (length, namespace = '.chain') {
return randomString(length).toLowerCase() + namespace
}

Expand Down Expand Up @@ -54,8 +54,8 @@ describe('CLI AENS Module', function () {
const { version } = wallet.getNodeInfo()
const [majorVersion] = version.split('.')
nameAuctionsSupported = +majorVersion === 5 && version !== '5.0.0-rc.1'
name = randomName(12, nameAuctionsSupported ? '.aet' : '.test')
name2 = randomName(13, nameAuctionsSupported ? '.aet' : '.test')
name = randomName(12, nameAuctionsSupported ? '.chain' : '.test')
name2 = randomName(13, nameAuctionsSupported ? '.chain' : '.test')
} catch (e) {
console.log(e.toString())
}
Expand Down
2 changes: 1 addition & 1 deletion test/cli/inspect.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ describe('CLI Inspect Module', function () {
})
it('Inspect Name', async () => {
const invalidName = await execute(['inspect', 'asd', '--json'])
const validName = JSON.parse(await execute(['inspect', 'nazdou2222222.aet', '--json']))
const validName = JSON.parse(await execute(['inspect', 'nazdou2222222.chain', '--json']))
invalidName.indexOf('AENS: Invalid name domain').should.not.equal(-1)
validName.status.should.be.equal('AVAILABLE')
})
Expand Down
2 changes: 1 addition & 1 deletion test/cli/tx.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const testContract = `contract Identity =
entrypoint main(x : int, y: int) = x + y
`

function randomName (length = 18, namespace = '.aet') {
function randomName (length = 18, namespace = '.chain') {
return randomString(length).toLowerCase() + namespace
}

Expand Down

0 comments on commit 8279579

Please sign in to comment.