diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6ad739b538..7e7101ecff 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -9,7 +9,7 @@ jobs: sudo apt install --allow-downgrades ./esl-erlang_25.0.4-1~ubuntu~jammy_amd64.deb - uses: actions/checkout@v2 with: - fetch-depth: 0 + fetch-depth: 100 - uses: actions/setup-node@v2 with: node-version: 18.x @@ -21,16 +21,11 @@ jobs: key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} - run: npm ci - name: Run Commitlint + if: github.event_name == 'pull_request' env: - EVENT_TYPE: ${{ github.event_name }} HEAD: ${{ github.event.pull_request.head.sha }} BASE: ${{ github.event.pull_request.base.sha }} - run: | - if [ "$EVENT_TYPE" = "push" ]; then - npx commitlint --from HEAD~${{ github.event.push.commits }} --to HEAD --verbose - else - npx commitlint --from $BASE --to $HEAD --verbose - fi + run: npx commitlint --from $BASE --to $HEAD --verbose - run: npm run lint - run: docker-compose up -d - name: Ensure that node is running diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index ebe8c009ad..4fbc019989 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -2,6 +2,14 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +### [13.0.1](https://github.com/aeternity/aepp-sdk-js/compare/v13.0.0...v13.0.1) (2023-04-24) + + +### Bug Fixes + +* **contract:** return type of call/deploy on chain ([c493707](https://github.com/aeternity/aepp-sdk-js/commit/c49370756fa3ed3a6f37bad2cefcbbd858ff94ee)) +* export of `prefixedAmount` helper ([9b3f68f](https://github.com/aeternity/aepp-sdk-js/commit/9b3f68f99b3943c42c4639c3a247ee9881229d18)) + ## [13.0.0](https://github.com/aeternity/aepp-sdk-js/compare/v13.0.0-beta.0...v13.0.0) (2023-04-06) diff --git a/docs/README.md b/docs/README.md index b602f20822..2c6bb44994 100644 --- a/docs/README.md +++ b/docs/README.md @@ -82,6 +82,8 @@ This may be done in `tsconfig.json`: ``` SDK uses modern features available since typescript@4.7. Though SDK is still compatible with typescript@4.1 and above using types generated separately, but these types are less accurate. +Ensure that you have `strictFunctionTypes` option not enabled (as it is in VS code and `ts-node` by default), otherwise some of SDK types won't work correctly (see [#1793](https://github.com/aeternity/aepp-sdk-js/issues/1793)). + ### Vue CLI@4 SDK checks are not working correctly because CLI picks both ESM and CJS versions of `autorest` dependencies. To fix this, you need to specify aliases in `vue.config.js`. diff --git a/package-lock.json b/package-lock.json index 360045abc8..4b2c7b6e4e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@aeternity/aepp-sdk", - "version": "13.0.0", + "version": "13.0.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@aeternity/aepp-sdk", - "version": "13.0.0", + "version": "13.0.1", "license": "ISC", "dependencies": { "@aeternity/aepp-calldata": "^1.4.0", diff --git a/package.json b/package.json index 6f82a789a2..1e6c917a82 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@aeternity/aepp-sdk", - "version": "13.0.0", + "version": "13.0.1", "description": "SDK for the æternity blockchain", "main": "dist/aepp-sdk.js", "types": "es/index.d.ts", diff --git a/src/contract/Contract.ts b/src/contract/Contract.ts index b423928e28..ebaf067282 100644 --- a/src/contract/Contract.ts +++ b/src/contract/Contract.ts @@ -72,7 +72,7 @@ type TxData = Awaited>; interface SendAndProcessReturnType { result?: ContractCallObject; hash: TxData['hash']; - tx: TxUnpacked & { tag: Tag.ContractCallTx | Tag.ContractCreateTx }; + tx: TxUnpacked & { tag: Tag.SignedTx | Tag.ContractCallTx | Tag.ContractCreateTx }; txData: TxData; rawTx: Encoded.Transaction; } diff --git a/src/tx/execution-cost.ts b/src/tx/execution-cost.ts index b861b45a55..2da349a4bc 100644 --- a/src/tx/execution-cost.ts +++ b/src/tx/execution-cost.ts @@ -11,6 +11,23 @@ import getTransactionSignerAddress from './transaction-signer'; * Calculates the cost of transaction execution * Provides an upper cost of contract-call-related transactions because of `gasLimit`. * Also assumes that oracle query fee is 0 unless it is provided in options. + * + * The idea is that if you need to show transaction details with some accuracy you can define + * expense fields that you want to show separately. And to show `getExecutionCost` result as a fee, + * subtracting all fields shown separately. + * + * @example + * ```vue + * + * ``` + * + * Doing this way you won't worry to show wrong fee for a transaction you may not support. Because + * the SDK calculates the overall price of any transaction on its side. + * * @param transaction - Transaction to calculate the cost of * @param innerTx - Should be provided if transaction wrapped with Tag.PayingForTx * @param gasUsed - Amount of gas actually used to make calculation more accurate diff --git a/src/typings/@aeternity__aepp-calldata/index.d.ts b/src/typings/@aeternity__aepp-calldata/index.d.ts deleted file mode 100644 index 922d1dd880..0000000000 --- a/src/typings/@aeternity__aepp-calldata/index.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -declare module '@aeternity/aepp-calldata' { - // eslint-disable-next-line import/prefer-default-export - export class Encoder { - constructor(aci: object); - - encode(contract: string, funName: string, args: any[]): `cb_${string}`; - - decode(contract: string, funName: string, data: `cb_${string}`): any; - - decodeString(data: `cb_${string}`): Uint8Array; - - decodeFateString(data: `cb_${string}`): string; - - decodeEvent( - contract: string, - encodedData: `cb_${string}`, - topics: BigInt[], - ): { [key: string]: any[] }; - } -} diff --git a/src/utils/amount-formatter.ts b/src/utils/amount-formatter.ts index 0b9fbdae08..7238a2e882 100644 --- a/src/utils/amount-formatter.ts +++ b/src/utils/amount-formatter.ts @@ -85,7 +85,7 @@ const getNearestPrefix = (exponent: number): Prefix => prefixes.reduce((p, n) => const getLowerBoundPrefix = (exponent: number): Prefix => prefixes .find((p) => p.magnitude <= exponent) ?? prefixes[prefixes.length - 1]; -export default (rawValue: string | number | BigNumber): string => { +export const prefixedAmount = (rawValue: string | number | BigNumber): string => { const value: BigNumber = new BigNumber(rawValue); const exp = value.e ?? 0; diff --git a/test/environment/node.ts b/test/environment/node.ts index 9b2220fe0e..42a356ce80 100755 --- a/test/environment/node.ts +++ b/test/environment/node.ts @@ -20,7 +20,9 @@ const aeSdk = new AeSdk({ console.log('Height:', await aeSdk.getHeight()); console.log('Instanceof works correctly for nodes pool', aeSdk.pool instanceof Map); - const contract = await aeSdk.initializeContract({ sourceCode: contractSourceCode }); + const contract = await aeSdk.initializeContract<{ + getArg: (x: Map) => Map; + }>({ sourceCode: contractSourceCode }); const deployInfo = await contract.$deploy([]); console.log('Contract deployed at', deployInfo.address); const map = new Map([['foo', 42], ['bar', 43]]); diff --git a/test/integration/account-generalized.ts b/test/integration/account-generalized.ts index d85dca8bbb..b3d0948df6 100644 --- a/test/integration/account-generalized.ts +++ b/test/integration/account-generalized.ts @@ -10,11 +10,10 @@ import { Tag, unpackTx, buildTx, - Contract, + Contract, ContractMethodsBase, MIN_GAS_PRICE, + Encoded, } from '../../src'; -import { Encoded } from '../../src/utils/encoder'; -import { ContractMethodsBase } from '../../src/contract/Contract'; import { ensureEqual } from '../utils'; const sourceCode = `contract BlindAuth = diff --git a/test/integration/accounts.ts b/test/integration/accounts.ts index fa10a48d7f..899d365b9f 100644 --- a/test/integration/accounts.ts +++ b/test/integration/accounts.ts @@ -6,8 +6,8 @@ import { AeSdk, MemoryAccount, generateKeyPair, AE_AMOUNT_FORMATS, UnavailableAccountError, TypeError, ArgumentError, UnexpectedTsError, + encode, Encoding, Encoded, } from '../../src'; -import { Encoded } from '../../src/utils/encoder'; describe('Accounts', () => { let aeSdk: AeSdk; @@ -121,6 +121,12 @@ describe('Accounts', () => { ret.tx.should.include({ amount: bigAmount, recipientId: publicKey }); }); + it('spends with a payload', async () => { + const payload = encode(Buffer.from([1, 2, 3, 4]), Encoding.Bytearray); + const { tx } = await aeSdk.spend(1, receiver.address, { payload }); + expect(tx?.payload).to.be.equal('ba_AQIDBI3kcuI='); + }); + it('Get Account by block height/hash', async () => { await aeSdk.awaitHeight(await aeSdk.getHeight() + 3); const spend = await aeSdk.spend(123, 'ak_DMNCzsVoZnpV5fe8FTQnNsTfQ48YM5C3WbHPsJyHjAuTXebFi'); diff --git a/test/integration/aens.ts b/test/integration/aens.ts index af1e713cd2..1f4e4a0ae2 100644 --- a/test/integration/aens.ts +++ b/test/integration/aens.ts @@ -4,10 +4,9 @@ import { getSdk } from '.'; import { assertNotNull, randomName } from '../utils'; import { AeSdk, generateKeyPair, buildContractId, computeAuctionEndBlock, computeBidFee, - AensPointerContextError, UnexpectedTsError, encode, decode, Encoding, + AensPointerContextError, UnexpectedTsError, encode, decode, Encoding, ContractMethodsBase, } from '../../src'; import { pause } from '../../src/utils/other'; -import { ContractMethodsBase } from '../../src/contract/Contract'; describe('Aens', () => { let aeSdk: AeSdk; diff --git a/test/integration/chain.ts b/test/integration/chain.ts index 1be55b1035..45074e2d20 100644 --- a/test/integration/chain.ts +++ b/test/integration/chain.ts @@ -3,9 +3,8 @@ import { expect } from 'chai'; import { PipelineRequest, PipelineResponse, SendRequest } from '@azure/core-rest-pipeline'; import { getSdk } from '.'; import { - generateKeyPair, AeSdk, Tag, UnexpectedTsError, MemoryAccount, + generateKeyPair, AeSdk, Tag, UnexpectedTsError, MemoryAccount, Encoded, } from '../../src'; -import { Encoded } from '../../src/utils/encoder'; import { assertNotNull } from '../utils'; describe('Node Chain', () => { diff --git a/test/integration/channel.ts b/test/integration/channel.ts index c7ee82c74d..b5c82d3a41 100644 --- a/test/integration/channel.ts +++ b/test/integration/channel.ts @@ -8,8 +8,7 @@ import { getSdk } from '.'; import { unpackTx, buildTxHash, - encode, - decode, + encode, decode, Encoded, Encoding, Tag, AbiVersion, VmVersion, @@ -22,13 +21,12 @@ import { Contract, Channel, buildTx, + MemoryAccount, } from '../../src'; import { pause } from '../../src/utils/other'; import { ChannelOptions, notify, SignTx, SignTxWithTag, } from '../../src/channel/internal'; -import MemoryAccount from '../../src/account/Memory'; -import { Encoded, Encoding } from '../../src/utils/encoder'; import { appendSignature } from '../../src/channel/handlers'; import { assertNotNull, ensureEqual } from '../utils'; @@ -736,14 +734,14 @@ describe('Channel', () => { responderCh.disconnect(); initiatorCh = await Channel.initialize({ ...sharedParams, - lockPeriod: 5, + lockPeriod: 2, role: 'initiator', sign: initiatorSignTag, port: 3004, }); responderCh = await Channel.initialize({ ...sharedParams, - lockPeriod: 5, + lockPeriod: 2, role: 'responder', sign: responderSignTag, port: 3004, diff --git a/test/integration/compiler.ts b/test/integration/compiler.ts index 2eaeab59f3..218670e9bd 100644 --- a/test/integration/compiler.ts +++ b/test/integration/compiler.ts @@ -3,9 +3,8 @@ import { describe, it } from 'mocha'; import { readFile } from 'fs/promises'; import { compilerUrl, ignoreVersion } from '.'; import { - CompilerBase, CompilerHttpNode, CompilerCli, CompilerError, getFileSystem, + CompilerBase, CompilerHttpNode, CompilerCli, CompilerError, getFileSystem, Encoded, } from '../../src'; -import { Encoded } from '../../src/utils/encoder'; function testCompiler(compiler: CompilerBase): void { const inclSourceCodePath = './test/integration/contracts/Includes.aes'; diff --git a/test/integration/contract-aci.ts b/test/integration/contract-aci.ts index b16b47b186..2f1e7191b6 100644 --- a/test/integration/contract-aci.ts +++ b/test/integration/contract-aci.ts @@ -3,7 +3,7 @@ import { before, describe, it } from 'mocha'; import BigNumber from 'bignumber.js'; import { AeSdk, - decode, + decode, Encoded, BytecodeMismatchError, InvalidAensNameError, MissingContractAddressError, @@ -12,15 +12,17 @@ import { MissingEventDefinitionError, AmbiguousEventDefinitionError, IllegalArgumentError, - Contract, + Contract, ContractMethodsBase, hash, AE_AMOUNT_FORMATS, + Tag, } from '../../src'; import { getSdk } from '.'; -import { Encoded } from '../../src/utils/encoder'; -import { assertNotNull, ChainTtl, InputNumber } from '../utils'; +import { + assertNotNull, ChainTtl, ensureEqual, InputNumber, +} from '../utils'; import { Aci } from '../../src/contract/compiler/Base'; -import { ContractMethodsBase, ContractCallObject } from '../../src/contract/Contract'; +import { ContractCallObject } from '../../src/contract/Contract'; const identityContractSourceCode = ` contract Identity = @@ -261,7 +263,18 @@ describe('Contract instance', () => { }); it('calls', async () => { - expect((await testContract.intFn(2)).decodedResult).to.be.equal(2n); + const res = await testContract.intFn(2); + expect(res.decodedResult).to.be.equal(2n); + ensureEqual(res.tx.tag, Tag.ContractCallTx); + expect(res.tx.fee).to.be.equal('182000000000000'); + }); + + it('calls on chain', async () => { + const res = await testContract.intFn(2, { callStatic: false }); + expect(res.decodedResult).to.be.equal(2n); + ensureEqual(res.tx.tag, Tag.SignedTx); + ensureEqual(res.tx.encodedTx.tag, Tag.ContractCallTx); + expect(res.tx.encodedTx.fee).to.be.equal('182000000000000'); }); it('calls without waitMined and get result later', async () => { @@ -505,7 +518,9 @@ describe('Contract instance', () => { }); it('sets maximum possible gas limit for dry-run contract calls', async () => { - const { tx: { gasLimit } } = await contract.intFn(4); + const { tx } = await contract.intFn(4); + ensureEqual(tx.tag, Tag.ContractCallTx); + const { gasLimit } = tx; expect(gasLimit).to.be.equal(5817980); await expect(contract.intFn(4, { gasLimit: gasLimit + 1 })) .to.be.rejectedWith(IllegalArgumentError, 'Gas limit 5817981 must be less or equal to 5817980'); diff --git a/test/integration/contract.ts b/test/integration/contract.ts index d9c1252b42..669b75a308 100644 --- a/test/integration/contract.ts +++ b/test/integration/contract.ts @@ -8,17 +8,14 @@ import { IllegalArgumentError, NodeInvocationError, commitmentHash, - decode, - encode, + decode, encode, Encoded, Encoding, DRY_RUN_ACCOUNT, messageToHash, genSalt, UnexpectedTsError, AeSdk, - Contract, + Contract, ContractMethodsBase, } from '../../src'; -import { Encoded, Encoding } from '../../src/utils/encoder'; -import { ContractMethodsBase } from '../../src/contract/Contract'; const identitySourceCode = ` contract Identity = diff --git a/test/integration/index.ts b/test/integration/index.ts index 04540d3d08..f25512d2ee 100644 --- a/test/integration/index.ts +++ b/test/integration/index.ts @@ -1,8 +1,7 @@ import { - AeSdk, CompilerHttpNode, MemoryAccount, Node, + AeSdk, CompilerHttpNode, MemoryAccount, Node, Encoded, } from '../../src'; import '..'; -import { Encoded } from '../../src/utils/encoder'; export const url = process.env.TEST_URL ?? 'http://localhost:3013'; export const compilerUrl = process.env.COMPILER_URL ?? 'http://localhost:3080'; diff --git a/test/integration/oracle.ts b/test/integration/oracle.ts index 4bb4870c7f..b96b873c3f 100644 --- a/test/integration/oracle.ts +++ b/test/integration/oracle.ts @@ -4,10 +4,10 @@ import { RestError } from '@azure/core-rest-pipeline'; import { getSdk } from '.'; import { AeSdk, UnexpectedTsError, - decode, encode, registerOracle, - ORACLE_TTL_TYPES, Encoding, RequestTimedOutError, + decode, encode, Encoding, Encoded, + registerOracle, + ORACLE_TTL_TYPES, RequestTimedOutError, } from '../../src'; -import { Encoded } from '../../src/utils/encoder'; describe('Oracle', () => { let aeSdk: AeSdk; diff --git a/test/integration/paying-for.ts b/test/integration/paying-for.ts index 3dfe22166a..e6bde084b7 100644 --- a/test/integration/paying-for.ts +++ b/test/integration/paying-for.ts @@ -3,9 +3,8 @@ import { expect } from 'chai'; import BigNumber from 'bignumber.js'; import { getSdk } from '.'; import { - AeSdk, Contract, MemoryAccount, Tag, UnexpectedTsError, + AeSdk, Contract, MemoryAccount, Tag, UnexpectedTsError, Encoded, } from '../../src'; -import { Encoded } from '../../src/utils/encoder'; import { InputNumber } from '../utils'; describe('Paying for transaction of another account', () => { diff --git a/test/integration/rpc.ts b/test/integration/rpc.ts index acde9297ad..0f2a483266 100644 --- a/test/integration/rpc.ts +++ b/test/integration/rpc.ts @@ -16,7 +16,7 @@ import { Tag, WALLET_TYPE, unpackTx, - decode, + decode, encode, Encoded, Encoding, MESSAGE_DIRECTION, METHODS, RPC_STATUS, @@ -38,7 +38,6 @@ import { getSdk, ignoreVersion, networkId, url, compilerUrl, } from '.'; import { Accounts, Network } from '../../src/aepp-wallet-communication/rpc/types'; -import { encode, Encoded, Encoding } from '../../src/utils/encoder'; const WindowPostMessageFake = ( name: string, diff --git a/test/integration/transaction.ts b/test/integration/transaction.ts index 32b450404a..09cce68c7a 100644 --- a/test/integration/transaction.ts +++ b/test/integration/transaction.ts @@ -3,10 +3,9 @@ import { expect } from 'chai'; import { getSdk } from './index'; import { AeSdk, - commitmentHash, oracleQueryId, decode, encode, + commitmentHash, oracleQueryId, decode, encode, Encoded, Encoding, ORACLE_TTL_TYPES, Tag, AE_AMOUNT_FORMATS, buildTx, unpackTx, } from '../../src'; -import { Encoded, Encoding } from '../../src/utils/encoder'; const nonce = 1; const nameTtl = 1; diff --git a/test/integration/txVerification.ts b/test/integration/txVerification.ts index c8e7f2b7ce..0b2e4f610c 100644 --- a/test/integration/txVerification.ts +++ b/test/integration/txVerification.ts @@ -2,10 +2,8 @@ import { before, describe, it } from 'mocha'; import { expect } from 'chai'; import { getSdk } from '.'; import { - AeSdk, Node, InvalidTxError, ArgumentError, Tag, + AeSdk, Node, InvalidTxError, ArgumentError, Tag, MemoryAccount, verifyTransaction, } from '../../src'; -import MemoryAccount from '../../src/account/Memory'; -import verifyTransaction from '../../src/tx/validator'; describe('Verify Transaction', () => { let aeSdk: AeSdk; diff --git a/test/integration/~execution-cost.ts b/test/integration/~execution-cost.ts index f97a54322d..5ad84663d1 100644 --- a/test/integration/~execution-cost.ts +++ b/test/integration/~execution-cost.ts @@ -4,12 +4,9 @@ import { addTransactionHandler, getSdk, ignoreVersion, networkId, url, } from '.'; import { - AeSdk, Node, buildTxHash, poll, Tag, unpackTx, getTransactionSignerAddress, buildTx, -} from '../../src'; -import { + AeSdk, Node, buildTxHash, poll, Tag, unpackTx, getTransactionSignerAddress, buildTx, Encoded, getExecutionCost, getExecutionCostBySignedTx, getExecutionCostUsingNode, -} from '../../src/tx/execution-cost'; -import { Encoded } from '../../src/utils/encoder'; +} from '../../src'; import { pause } from '../../src/utils/other'; const node = new Node(url, { ignoreVersion }); diff --git a/test/unit/crypto.ts b/test/unit/crypto.ts index f9e6e2c493..7eb9d30d8f 100644 --- a/test/unit/crypto.ts +++ b/test/unit/crypto.ts @@ -2,11 +2,10 @@ import '..'; import { describe, it } from 'mocha'; import { assert, expect } from 'chai'; import { - buildTxHash, decode, + buildTxHash, decode, Encoded, generateKeyPair, getAddressFromPriv, verifyMessage, isValidKeypair, isAddressValid, hash, genSalt, sign, verify, messageToHash, signMessage, } from '../../src'; -import { Encoded } from '../../src/utils/encoder'; // These keys are fixations for the encryption lifecycle tests and will // not be used for signing diff --git a/test/unit/hd-wallet.ts b/test/unit/hd-wallet.ts index 5a11bc845e..277dbdef83 100644 --- a/test/unit/hd-wallet.ts +++ b/test/unit/hd-wallet.ts @@ -6,10 +6,8 @@ import { getMasterKeyFromSeed, getSaveHDWalletAccounts, DerivationError, -} from '../../src'; -import { encode, decode, Encoded, Encoding, -} from '../../src/utils/encoder'; +} from '../../src'; import { concatBuffers } from '../../src/utils/other'; describe('hd wallet', () => { diff --git a/test/unit/ledger.ts b/test/unit/ledger.ts index 0fdf5f6a5c..33270100e7 100644 --- a/test/unit/ledger.ts +++ b/test/unit/ledger.ts @@ -17,10 +17,9 @@ import { unpackTx, verify, verifyMessage, - decode, + decode, Encoded, hash, } from '../../src'; -import { Encoded } from '../../src/utils/encoder'; const compareWithRealDevice = false; // switch to true for manual testing // ledger should be initialized with mnemonic: diff --git a/test/unit/memory-account.ts b/test/unit/memory-account.ts index 7e20f147a4..bb872b9f8c 100644 --- a/test/unit/memory-account.ts +++ b/test/unit/memory-account.ts @@ -1,8 +1,9 @@ import '..'; import { describe, it } from 'mocha'; import { expect } from 'chai'; -import MemoryAccount from '../../src/account/Memory'; -import { generateKeyPair, verifyMessage, ArgumentError } from '../../src'; +import { + MemoryAccount, generateKeyPair, verifyMessage, ArgumentError, +} from '../../src'; const testAcc = generateKeyPair(); diff --git a/test/unit/mptree.ts b/test/unit/mptree.ts index 000472032e..b8c02c438d 100644 --- a/test/unit/mptree.ts +++ b/test/unit/mptree.ts @@ -5,14 +5,13 @@ import { decode as rlpDecode } from 'rlp'; import type { Input } from 'rlp'; import genMPTreeField from '../../src/tx/builder/field-types/mptree'; import { - Encoding, + Encoding, Encoded, Tag, unpackTx, MerkleTreeHashMismatchError, MissingNodeInTreeError, UnknownNodeLengthError, } from '../../src'; -import { Encoded } from '../../src/utils/encoder'; const field = genMPTreeField(Encoding.AccountAddress, Tag.Account); type MPTreeBinary = Parameters[0]; diff --git a/test/unit/pretty-numbers.ts b/test/unit/pretty-numbers.ts index 882045725c..1c57177edd 100644 --- a/test/unit/pretty-numbers.ts +++ b/test/unit/pretty-numbers.ts @@ -1,7 +1,7 @@ import BigNumber from 'bignumber.js'; import { describe, it } from 'mocha'; import { expect } from 'chai'; -import prefixedAmount from '../../src/utils/amount-formatter'; +import { prefixedAmount } from '../../src'; const MAGNITUDE = 18; describe('prefixedAmount', () => { diff --git a/test/unit/tx.ts b/test/unit/tx.ts index 75cad74098..0ba9b343a0 100644 --- a/test/unit/tx.ts +++ b/test/unit/tx.ts @@ -6,14 +6,13 @@ import BigNumber from 'bignumber.js'; import { checkOnlyTypes, randomName } from '../utils'; import { genSalt, - decode, encode, + decode, encode, Encoding, Encoded, getDefaultPointerKey, commitmentHash, getMinimumNameFee, isNameValid, produceNameId, toBytes, buildTx, unpackTx, NAME_BID_RANGES, Tag, AbiVersion, VmVersion, SchemaNotFoundError, ArgumentError, AeSdk, } from '../../src'; -import { Encoding, Encoded } from '../../src/utils/encoder'; describe('Tx', () => { it('reproducible commitment hashes can be generated', async () => {