Skip to content

Commit

Permalink
Merge pull request #1581 from nemgrouplimited/integration
Browse files Browse the repository at this point in the history
Release v1.0.4
  • Loading branch information
bassemmagdy authored Jul 8, 2021
2 parents cc11176 + 2b1dd20 commit a4f307e
Show file tree
Hide file tree
Showing 106 changed files with 1,431 additions and 362 deletions.
23 changes: 13 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,28 +27,31 @@ jobs:
script: npm run lint
os: linux

- name: unit tests
- stage: test
name: unit tests
script: npm run test
os: linux

- stage: alpha
name: publish alpha docker
script: /bin/sh travis/docker.sh
script: /bin/sh travis/docker.sh alpha
if: branch = env(DEV_BRANCH) AND type = push
os: linux

- script: npm run release:all
name: build desktop artifacts
if: branch = env(DEV_BRANCH) AND type = push
os: linux
# - stage: alpha
# script: npm run release:all
# name: build desktop artifacts
# if: branch = env(DEV_BRANCH) AND type = push
# os: linux

- stage: release
name: release docker
script: /bin/sh travis/docker.sh
if: branch = env(RELEASE_BRANCH) AND type = api AND commit_message = env(RELEASE_MESSAGE)
name: publish release docker
script: /bin/sh travis/docker.sh release
if: tag IS present
os: linux

- name: release desktop artifacts, tag and update version
- stage: release
name: release desktop artifacts, tag and update version
script: /bin/sh travis/release.sh
if: branch = env(RELEASE_BRANCH) AND type = api AND commit_message = env(RELEASE_MESSAGE)
os: linux
52 changes: 52 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,58 @@ All notable changes to this project will be documented in this file.

The changelog format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [1.0.4][v1.0.4] - 7-Jul-2021

### Milestone: Stabilize and bug fix

#### Added

- Added mosaic envelop icon and tooltips for transaction list
- Added the possibility to check if aggregate transaction has to be signed without opening details
- Added skip button for mnemonic confirmation on Testnet
- Added minRemoval and minApproval values on the multisig tree

#### Changed

- Copy paste password on profile creation now is not accepted
- Custom nodes now are assigned to a profile and not removed when switching between networks
- Changed icon size and positions to make them more consistent
- Changed QR code image for failure when transactions are too big

#### Fixed

- Fix input focus error on FormProfileUnlock
- Fixed amount validation when sending big quantities
- Fix encrypted message console error
- Fixed fee multiplier for offline transaction mode
- Fix transaction signing icon doesn't show up immediately after signing
- Fixed ledger translation
- Fixed account restrictions modal UI
- Fix harvesting not showing 25% of the beneficiary
- Fix decimal separator causing problems between locales
- Fixed copy paste password input
- Fix harvesting node not showing while activated on different devices
- Fixed Scanning a QR Code for a Transfer Transaction without Mosaics breaks the Wallet
- Fix harvesting node not visible if connected to it
- Removed redundant space in mosaics amount when imported from QR code with the prepared invoice
- Fixed profile creation in Ledger caused some crashes
- Fixed error covering import QR code button in offline mode
- Fixed harvesting screen tabs not aligned and scrollable
- Ordered fee selection option
- Removed fee selector redundant caption for min fee multipliers
- Fixed partial aggregate transactions disappearing when signing
- Fixed unable to add new node when all nodes are offline
- Fixed users could try changing symbol.xym properties
- Fixed harvesting screen not showing correct status for node operators
- Fixed when importing QR code for a transaction slow fee changed to slowest
- Fixed the balance was sometimes not shown on wallet selection page
- Fixed some form items were not aligned
- Fixed duration of Namespace rental adds 1 day.
- Fixed bug when entering amounts in offline mode.
- Fixed when put max value transaction details are not presented
- Other UI fixes
- Other translations and wording fixes

## [1.0.3][v1.0.3] - 10-May-2021

### Milestone: Post-launch Opt-in
Expand Down
21 changes: 21 additions & 0 deletions __mocks__/network.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
export const networkMock = {
fees: {
median: 10,
free: 0,
slow: 5,
slowest: 1,
fast: 20,
},
currency: {
name: 'symbol.xym',
mosaicIdHex: '091F837E059AE13C',
namespaceIdHex: 'E74B99BA41F4AFEE',
divisibility: 6,
transferable: true,
supplyMutable: false,
restrictable: false,
duration: 0,
height: 1,
supply: 7841148552567058,
},
};
14 changes: 14 additions & 0 deletions __mocks__/profiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,20 @@ const TEST_PROFILES = {
accounts: "['WalletsModel2']",
seed:
'4fcd1e1b896551f68c3d5314be1f8d2fad48d7b492e65ecf4ac1ac2dfc9749a08CyBF9Q5APg07qXEMWQzQIcN+/KBekkw0T2hBPfdAd5VxXkdzWikv46dIaYxyHCn9hdr839ITfgIWYnAiE54jRWfFKkDvyEZL4pchX6mAqCcc0Ew9VGFfHjKStHWFeBezrhp/MlNeSw/EbxiCFo5C2pmeSuGz5NABUXT+BoDi62gB8r6gyF9hjB8J7Lz6D4SBf6J4cvj9krCXzkkWX1jqg==',
termsAndConditionsApproved: true,
selectedNodeUrlToConnect: 'http://localhost:3000',
},
profile_testnet: {
generationHash: '3B5E1FA6445653C971A50687E75E6D09FB30481055E3990C84B25E9222DC1155',
profileName: 'profile_testnet',
hint: 'password is password',
networkType: NetworkType.TEST_NET,
password: '0b831096cf25adbd7324ad2dbb3d99a829b40b53c6f76dd50fb2ef56fceded2f2kixTXdr/q/ci5PPwWVCiA==',
accounts: "['WalletsModel2']",
seed:
'4fcd1e1b896551f68c3d5314be1f8d2fad48d7b492e65ecf4ac1ac2dfc9749a08CyBF9Q5APg07qXEMWQzQIcN+/KBekkw0T2hBPfdAd5VxXkdzWikv46dIaYxyHCn9hdr839ITfgIWYnAiE54jRWfFKkDvyEZL4pchX6mAqCcc0Ew9VGFfHjKStHWFeBezrhp/MlNeSw/EbxiCFo5C2pmeSuGz5NABUXT+BoDi62gB8r6gyF9hjB8J7Lz6D4SBf6J4cvj9krCXzkkWX1jqg==',
termsAndConditionsApproved: true,
selectedNodeUrlToConnect: 'http://localhost:3000',
},
};

Expand Down
30 changes: 28 additions & 2 deletions __tests__/components/AmountInput.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ import flushPromises from 'flush-promises';
import VueI18n, { Values } from 'vue-i18n';
import i18n from '@/language/index';
import { StandardValidationRules } from '@/core/validation/StandardValidationRules';
import { MaxDecimalsValidator } from '@/core/validation/validators';
import { MaxDecimalsValidator, PositiveDecimalNumberValidator, MaxRelativeAmountValidator } from '@/core/validation/validators';
import { appConfig } from '@/config';
import { PositiveDecimalNumberValidator } from '@/core/validation/validators/PositiveDecimalNumberValidator';

StandardValidationRules.register();
appConfig.constants.DECIMAL_SEPARATOR = '.';
Expand All @@ -27,6 +26,23 @@ extend('positiveDecimal', {
validate: (value) => PositiveDecimalNumberValidator.validate(value),
message: () => i18n.t('positive_decimal_error', { decimalSeparator: appConfig.constants.DECIMAL_SEPARATOR }).toString(),
});
extend('maxRelativeAmount', {
validate: (value, { maxMosaicAtomicUnits, maxMosaicDivisibility }: any) => {
const maxRelativeAmount =
maxMosaicDivisibility === 0 ? maxMosaicAtomicUnits : maxMosaicAtomicUnits / Math.pow(10, maxMosaicDivisibility);
return MaxRelativeAmountValidator.validate(value, maxRelativeAmount);
},
message: (_fieldName: string, values: Values) =>
`${i18n.t('max_amount_error', {
...values,
maxRelativeAmount: `${
values['maxMosaicAtomicUnits'] === 0
? values['maxMosaicAtomicUnits']
: values['maxMosaicAtomicUnits'] / Math.pow(10, values['maxMosaicDivisibility'])
}`,
})}`,
params: ['maxMosaicAtomicUnits', 'maxMosaicDivisibility'],
});
const localVue = createLocalVue();
localVue.component('ValidationProvider', ValidationProvider);
localVue.use(Vuex);
Expand Down Expand Up @@ -94,6 +110,11 @@ describe('AmountInput', () => {
expect(falseResult.valid).toBeFalsy();
const rightResult = await validate('10.123456', rule);
expect(rightResult.valid).toBeTruthy();

const falseResultMaxRelativeAmount = await validate('89999999990', rule);
expect(falseResultMaxRelativeAmount.valid).toBeFalsy();
const rightResultMaxRelativeAmount = await validate('8999999999', rule);
expect(rightResultMaxRelativeAmount.valid).toBeTruthy();
});
test("divisibility of the mosaic '534CD11F6D984B4B' is 5", async () => {
wrapper2.setProps({
Expand All @@ -105,5 +126,10 @@ describe('AmountInput', () => {
expect(falseResult.valid).toBeFalsy();
const rightResult = await validate('10.12345', rule);
expect(rightResult.valid).toBeTruthy();

const falseResultMaxRelativeAmount = await validate('899999999900', rule);
expect(falseResultMaxRelativeAmount.valid).toBeFalsy();
const rightResultMaxRelativeAmount = await validate('89999999990', rule);
expect(rightResultMaxRelativeAmount.valid).toBeTruthy();
});
});
80 changes: 30 additions & 50 deletions __tests__/database/storage/NodeModelStorage.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,67 +20,47 @@ import { SimpleObjectStorage } from '@/core/database/backends/SimpleObjectStorag
import { VersionedModel } from '@/core/database/entities/VersionedModel';
import { NodeModel } from '@/core/database/entities/NodeModel';
import { NodeModelStorage } from '@/core/database/storage/NodeModelStorage';
import { ProfileModel } from '@/core/database/entities/ProfileModel';

const fakeProfile: ProfileModel = {
profileName: 'fakeName',
generationHash: 'fakeGenHash',
hint: 'fakeHint',
networkType: NetworkType.TEST_NET,
password: 'fakePassword',
seed: 'fakeSeed',
accounts: [],
termsAndConditionsApproved: true,
selectedNodeUrlToConnect: 'fakeNode',
};

const fakeNode: NodeModel = {
url: 'fakeNodeUrl',
friendlyName: 'fakeNode',
isDefault: false,
networkType: NetworkType.TEST_NET,
};

describe('storage/ProfileModelStorage.spec ==>', () => {
describe('constructor() should', () => {
test('Should upgrade testnet only on v8', () => {
test('Should save nodes by profile name', () => {
const nodes = {
version: 8,
data: [
{
url: 'http://someMainnet.symbolblockchain.io:3000',
friendlyName: 'ngl-someMainnet-403',
isDefault: true,
networkType: NetworkType.MAIN_NET,
publicKey: 'EF1209DC3C42B6450BEF658D404252DF2E26784CECD35FAEB19D929AE030A198',
nodePublicKey: 'B87704DB1310FC59C91A1858DBDCFC67289363C18A67E10AFC2DCD26458B5D47',
},
{
url: 'http://someOldtestet.symbolblockchain.io:3000',
friendlyName: 'ngl-someOldtestet-001',
isDefault: true,
networkType: NetworkType.TEST_NET,
},
{
url: 'http://someOldtestet2.symbolblockchain.io:3000',
friendlyName: 'ngl-someOldtestet2-002',
isDefault: true,
networkType: NetworkType.TEST_NET,
},
{
url: 'http://somePrivate.symbolblockchain.io:3000',
friendlyName: 'ngl-somePrivate-002',
isDefault: true,
networkType: NetworkType.PRIVATE_TEST,
},
],
version: 10,
data: {
[fakeProfile.profileName]: [fakeNode],
},
};
const delegate = new SimpleObjectStorage<VersionedModel<NodeModel[]>>(
const delegate = new SimpleObjectStorage<VersionedModel<Record<string, NodeModel[]>>>(
'node',
new ObjectStorageBackend({
node: JSON.stringify(nodes),
}),
);
const storage = new NodeModelStorage(delegate);
const migratedData = storage.get();
const expected = [
{
url: 'http://someMainnet.symbolblockchain.io:3000',
friendlyName: 'ngl-someMainnet-403',
isDefault: true,
networkType: NetworkType.MAIN_NET,
publicKey: 'EF1209DC3C42B6450BEF658D404252DF2E26784CECD35FAEB19D929AE030A198',
nodePublicKey: 'B87704DB1310FC59C91A1858DBDCFC67289363C18A67E10AFC2DCD26458B5D47',
},
{
url: 'http://somePrivate.symbolblockchain.io:3000',
friendlyName: 'ngl-somePrivate-002',
isDefault: true,
networkType: NetworkType.PRIVATE_TEST,
},
];
expect(migratedData).toEqual(expected);
expect(delegate.get()).toEqual({ version: 9, data: migratedData });
const storedData = storage.get();
expect(storedData).toEqual({
[fakeProfile.profileName]: [fakeNode],
});
});
});
});
15 changes: 14 additions & 1 deletion __tests__/e2e/NodeServiceIntegrationTest.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { NodeService } from '@/services/NodeService';
import { toArray } from 'rxjs/operators';
import { of } from 'rxjs';
import { instance, mock, when } from 'ts-mockito';
import { ProfileModel } from '@/core/database/entities/ProfileModel';

const nodeService = new NodeService();
const realUrl = 'http://api-01.us-west-1.symboldev.network:3000';
Expand Down Expand Up @@ -45,9 +46,21 @@ when(mockRepoFactory.getEpochAdjustment()).thenReturn(of(1573430400));
when(mockRepoFactory.getNetworkType()).thenReturn(of(NetworkType.MIJIN_TEST));
const repositoryFactory = instance(mockRepoFactory);

const fakeProfile: ProfileModel = {
profileName: 'fakeName',
generationHash: 'fakeGenHash',
hint: 'fakeHint',
networkType: NetworkType.TEST_NET,
password: 'fakePassword',
seed: 'fakeSeed',
accounts: [],
termsAndConditionsApproved: true,
selectedNodeUrlToConnect: 'fakeNode',
};

describe('services/NodeService', () => {
test('getNodes', async () => {
const peers = await nodeService.getNodes(repositoryFactory, realUrl, NetworkType.TEST_NET).pipe(toArray()).toPromise();
const peers = await nodeService.getNodes(fakeProfile, repositoryFactory, realUrl).pipe(toArray()).toPromise();
console.log(JSON.stringify(peers, null, 2));
});
});
Loading

0 comments on commit a4f307e

Please sign in to comment.