Skip to content

Commit

Permalink
Update release-hotfix branch (#787)
Browse files Browse the repository at this point in the history
* Fixed claim tooltip text (#747)

* Create s3-staging.yml

* Create s3-production.yml

* Create s3-hotfix.yml

* Update s3-hotfix.yml

* Update s3-hotfix.yml

* Update s3-hotfix.yml

* Release hotfix merge to master (#746)

* add workflow for release-hotfix

* add on push specific branch

* remove automatic push process

* set inputs on workflow

* add specific branch on dispatch

* Discord link update (#745)

* Create s3-hotfix.yml

* Update s3-hotfix.yml

* Update s3-hotfix.yml

---------

Co-authored-by: Will <korea651@hanmail.net>
Co-authored-by: Ehsan <ehsan.hajian@gmail.com>

* add nft menu on sidebar (#749)

* add nft menu on sidebar

* add customized balloon

* clean up

* Fix total dApps count (#751)

* feat: updated theme color (#741)

* feat: updated theme color on Assets page

* feat: updated theme color on Dashboard page

* feat: updated theme color on dApp staking page

* feat: updated sidebar

* fix: tests

* update css

* update css

* update detail css

* feat: updated header background

* fix: updated hero position on dApp staking page

* update css on feedback

* update detail css

* updates on addItemcard

* update color on tags

* update colors

* feat: updated dark theme

* update uilib & colors

* styles: changed astar-blue-dark to astar-blue

* styles: updated Ecosystem icon

* fix: conflicts

* fix: updated styles

* fix: updated header

* fix: updated modals

* fix: updated play icon

* fix: updated styles on transfer assets page

* fix: updated ui liv

---------

Co-authored-by: Will <korea651@hanmail.net>

* Fix: Use XcmV2WeightLimit in InterlayXcmRepository.ts (#756)

* feat: updated connect wallet drawer (#750)

* feat: updated theme color on Assets page

* feat: updated theme color on Dashboard page

* feat: updated theme color on dApp staking page

* feat: updated sidebar

* fix: tests

* update css

* update css

* update detail css

* feat: updated astar-ui

* feat: updated astar-ui (2)

* feat: updated network modal

* feat: updated 'ip-input' class

* update css on feedback

* update detail css

* updates on addItemcard

* update color on tags

* feat: updated AccountModal logic

* feat: updated account drawer

* feat: updated disconnect button

* feat: updated tests

* fix: test

* fix: conflicts (2)

* fix: store selected address data

* feat: updated drawer

* feat: updated wallet logic

* refactor: clean up

* fix: changed 'disconnect' button position

* feat: store selected theme to local storage

* feat: updated modal drawer

* feat: updated modal drawer

---------

Co-authored-by: Will <korea651@hanmail.net>

* Added github action for broken links (#761)

* Added github action for broken links

* build and check

* e2e tests with  Zombienet (#752)

* Transfer tokens test

* CI integration

* Use env variable po pass BASE_URL to test script

* yaml fix

* Actions script fix

* Another action script fix

* yet another try

* hardcoded versions

* collator version fix

* Links fix

* Github action fix

* It may run now on CI

* Fixed test runner script

* Add asset to a node

* Moved Zombienet tests and configuration to separate folder.

* Stake test

* Increase Playwright test timeout

* Tests and node setup fixes

* Minor fixes

* All tests run stable

* Updated staking test with input validation test

* release hotfix to main (#760)

* add workflow for release-hotfix

* add on push specific branch

* remove automatic push process

* set inputs on workflow

* add specific branch on dispatch

* Discord link update (#745)

* Create s3-hotfix.yml

* Update s3-hotfix.yml

* Update s3-hotfix.yml

* hotfix: added Injective assets (ATOM and INJ) on EVM assets page (#759)

* feat: added ATOM and INJ on EVM assets page

* fix: fetch token data from cbridge API

---------

Co-authored-by: Will <korea651@hanmail.net>
Co-authored-by: Bobo <bobo.kovacevic@gmail.com>
Co-authored-by: Ehsan <ehsan.hajian@gmail.com>

* fix: send non-native tokens with max amount (#768)

* feat: updated XCM logic to V3 for Shiden, Statemine and Kusama (#758)

* wip: KSM xcm V3

* feat: update sdk-core

* feat: updated XCM logic for Kusama to V3

* feat: updated XCM V3 logic for Shiden

* fix: removed console.log

* fix: updated logic for statemine

* fix: updated subscan link for ctust

* feat: updated Bitfrost version to V3

* feat: updated XCM logic for Phala

* refactor: clean up

* fix: enabled XCM deposit/withdrawal on Shiden (#774)

* fix: enabled XCM deposit/withdrawal on Shiden

* test

* test: lint

* fix: clean up

* Update broken-links.yml (#777)

* removed quasar from broken link report (#767)

* dAapp staking e2e tests (#769)

* Unbond test

* Re-stake on/off test

* Claim rewards test, playwright config updates

* On chain check if claim executed

* Added Metamask extension

* Metamask wallet creation

* Trying to fix heap out of memory

* One more try

* One more try to fix CI out of memory

* On more try to fix out of memory error

* Heap size fix

* command fix

* What to say?

* Metamask removed

* Update pull-request-preview.yml

* Pushing commit to rerun ci

* setting up yarn

* Added Metamask back

* Test run on ubuntu-latest

* tsconfig exclude pattern fix

* Linter fixes

---------

Co-authored-by: Ehsan <ehsan.hajian@gmail.com>
Co-authored-by: Nikhil Ranjan <niklabh811@gmail.com>

* feat: added 'help' button on header (#772)

* fix: display EVM withdraw when users have balance in withdrawal

* fix: added help button on header

* fix: removed release note on the template.md

* fix: test

* fix: test (2)

* fix: display ModalConectionTrouble when app is loading

* fix: reset the staking tab after changing accounts (#779)

* Change warning on EVM local transfer (#783)

* update warning message

* update css & only visible on EVM input

* show prev warning

* only visible isH160

* update warning message

* fix: modified header styling for mobile devices (#782)

* fix: updated connect button

* fix: added separator at the top of assets page for mobile devices

* fix: updated header background for mobile devices

* fix: updated margin size inheader

---------

Co-authored-by: Bobo <bobo.kovacevic@gmail.com>
Co-authored-by: Ehsan <ehsan.hajian@gmail.com>
Co-authored-by: Will <korea651@hanmail.net>
Co-authored-by: Brendon Votteler <bvotteler@users.noreply.github.com>
Co-authored-by: Nikhil Ranjan <niklabh811@gmail.com>
  • Loading branch information
6 people committed Jun 9, 2023
1 parent 1fd7fd0 commit eb5f35d
Show file tree
Hide file tree
Showing 12 changed files with 541 additions and 0 deletions.
62 changes: 62 additions & 0 deletions playwright-report/index.html

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions src/components/assets/styles/assets.scss
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,18 @@
padding: 0;
}
}

.separator {
border-bottom: 1px solid;
border-image: linear-gradient(
90deg,
#e6007a -4%,
#e6007a -3.88%,
#703ac2 17.01%,
#0070eb 42.25%,
#0297fb 73.9%,
#0ae2ff 97.42%
);
border-image-slice: 1;
margin-bottom: 20px;
}
103 changes: 103 additions & 0 deletions src/components/header/modals/ModalInstallWallet.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
<template>
<div class="tw-fixed tw-z-10 tw-inset-0 tw-overflow-y-auto" @click="setCloseModal">
<div class="tw-flex tw-items-center tw-justify-center tw-min-h-screen">
<!-- Background overlay -->
<div class="tw-fixed tw-inset-0 tw-transition-opacity" aria-hidden="true">
<div class="tw-absolute tw-inset-0 tw-bg-gray-900 dark:tw-bg-black tw-opacity-75"></div>
</div>

<div
class="
tw-inline-block tw-bg-white
dark:tw-bg-darkGray-900
tw-rounded-lg tw-px-4
sm:tw-px-8
tw-py-10
tw-shadow-xl
tw-transform
tw-transition-all
tw-mx-2
tw-my-2
tw-align-middle
tw-max-w-lg
tw-w-full
"
@click.stop
>
<div>
<div class="tw-mb-8">
<div class="tw-flex tw-items-center tw-justify-center tw-mb-4">
<div class="tw-h-8 tw-w-8 tw-mr-3 tw-mb-2">
<img width="40" :src="selWallet.img" />
</div>
<div
class="
tw-text-lg tw-font-extrabold tw-text-blue-900
dark:tw-text-white
tw-text-center tw-mb-2
"
>
{{ $t('installWallet.getWallet', { value: $t(selWallet.name) }) }}
</div>
</div>
<div class="tw-text-md tw-text-blue-900 dark:tw-text-white tw-text-center">
{{ $t('installWallet.installWallet', { value: $t(selWallet.name) }) }}
</div>
</div>
</div>
<div class="tw-mt-6 tw-flex tw-justify-center">
<a :href="selWallet.guideUrl" target="_blank" rel="noopener noreferrer">
<button type="button" class="learnButton">
{{ $t('installWallet.howToConnect') }}
</button>
</a>
<a :href="selWallet.walletUrl" target="_blank" rel="noopener noreferrer">
<button type="button" class="installButton">
{{ $t('installWallet.installExtension', { value: $t(selWallet.name) }) }}
</button>
</a>
</div>
</div>
</div>
</div>
</template>

<script lang="ts">
import { supportAllWalletsObj, SupportWallet } from 'src/config/wallets';
import { defineComponent, computed, PropType } from 'vue';
export default defineComponent({
props: {
setCloseModal: {
type: Function,
required: true,
},
selectedWallet: {
type: String as PropType<SupportWallet>,
required: true,
},
},
setup(props) {
const selWallet = computed(() => supportAllWalletsObj[props.selectedWallet]);
return {
selWallet,
};
},
});
</script>

<style scoped>
.installButton {
@apply tw-inline-flex tw-items-center tw-px-4 tw-py-3 tw-border tw-border-transparent tw-text-sm tw-font-medium tw-rounded-full tw-shadow-sm tw-text-white tw-bg-blue-500 tw-mx-1;
}
.installButton:hover {
@apply tw-bg-blue-700 dark:tw-bg-blue-400;
}
.learnButton {
@apply tw-inline-flex tw-items-center tw-px-4 tw-py-3 tw-border tw-border-gray-400 dark:tw-border-darkGray-500 tw-text-sm tw-font-medium tw-rounded-full tw-text-gray-500 dark:tw-text-darkGray-400 tw-bg-white dark:tw-bg-darkGray-900 tw-mx-3;
}
.learnButton:hover {
@apply tw-bg-gray-100 dark:tw-bg-darkGray-700;
}
</style>
98 changes: 98 additions & 0 deletions src/components/header/modals/ModalUpdateWallet.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
<template>
<div class="tw-fixed tw-z-10 tw-inset-0 tw-overflow-y-auto" @click="setCloseModal">
<div class="tw-flex tw-items-center tw-justify-center tw-min-h-screen">
<!-- Background overlay -->
<div class="tw-fixed tw-inset-0 tw-transition-opacity" aria-hidden="true">
<div class="tw-absolute tw-inset-0 tw-bg-gray-900 dark:tw-bg-black tw-opacity-75"></div>
</div>

<div
class="
tw-inline-block tw-bg-white
dark:tw-bg-darkGray-900
tw-rounded-lg tw-px-4
sm:tw-px-8
tw-py-10
tw-shadow-xl
tw-transform
tw-transition-all
tw-mx-2
tw-my-2
tw-align-middle
tw-max-w-lg
tw-w-full
"
@click.stop
>
<div>
<div class="tw-mb-8">
<div class="tw-flex tw-items-center tw-justify-center tw-mb-4">
<div class="tw-h-8 tw-w-8 tw-mr-3 tw-mb-2">
<img width="40" :src="selWallet.img" />
</div>
<div
class="
tw-text-lg tw-font-extrabold tw-text-blue-900
dark:tw-text-white
tw-text-center tw-mb-2
"
>
{{ $t('updateWallet.getUpdatedWallet', { value: $t(selWallet.name) }) }}
</div>
</div>
<div class="tw-text-md tw-text-blue-900 dark:tw-text-white tw-text-center">
{{ $t('updateWallet.updateWallet', { value: $t(selWallet.name) }) }}
</div>
</div>
</div>
<div class="tw-mt-6 tw-flex tw-justify-center">
<a :href="selWallet.guideUrl" target="_blank" rel="noopener noreferrer">
<button type="button" class="learnButton">
{{ $t('updateWallet.updateExtension') }}
</button>
</a>
</div>
</div>
</div>
</div>
</template>

<script lang="ts">
import { supportAllWalletsObj, SupportWallet } from 'src/config/wallets';
import { defineComponent, computed, PropType } from 'vue';
export default defineComponent({
props: {
setCloseModal: {
type: Function,
required: true,
},
selectedWallet: {
type: String as PropType<SupportWallet>,
required: true,
},
},
setup(props) {
const selWallet = computed(() => supportAllWalletsObj[props.selectedWallet]);
return {
selWallet,
};
},
});
</script>

<style scoped>
.installButton {
@apply tw-inline-flex tw-items-center tw-px-4 tw-py-3 tw-border tw-border-transparent tw-text-sm tw-font-medium tw-rounded-full tw-shadow-sm tw-text-white tw-bg-blue-500 tw-mx-1;
}
.installButton:hover {
@apply tw-bg-blue-700 dark:tw-bg-blue-400;
}
.learnButton {
@apply tw-inline-flex tw-items-center tw-px-4 tw-py-3 tw-border tw-border-gray-400 dark:tw-border-darkGray-500 tw-text-sm tw-font-medium tw-rounded-full tw-text-gray-500 dark:tw-text-darkGray-400 tw-bg-white dark:tw-bg-darkGray-900 tw-mx-3;
}
.learnButton:hover {
@apply tw-bg-gray-100 dark:tw-bg-darkGray-700;
}
</style>
15 changes: 15 additions & 0 deletions tests/zombienet/e2e.zndsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Description: End to end tests
Network: ./zombienet-config.toml
Creds: config

{% set nodes = ["relay01", "relay02", "relay03", "relay04"] %}
{% for node in nodes %}
{{node}}: is up
{{node}}: reports node_roles is 4
{% endfor %}

astar: js-script ./setup-preconditions.js with "Alice" return is equal to 1 within 200 seconds
astar: js-script ./start-playwright.js with "{{BASE_URL}}" return is equal to 1 within 4000 seconds

# Uncomment the line below if you want to keep Zombienet running (i.e. some tests are failing and you want to check UI or similar)
# astar: js-script ./wait.js with "600000" return is equal to 1 within 360 seconds
46 changes: 46 additions & 0 deletions tests/zombienet/register-xcasset.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
async function run(nodeName, networkInfo, args) {
// networkInfo.nodesByName["astar"].hrmpTo = 2007
// networkInfo.nodesByName["shiden"].hrmpTo = 2006

const { sendTransaction } = await import('./tx-utils.mjs');
const { wsUri, userDefinedTypes } = networkInfo.nodesByName[nodeName];
const api = await zombie.connect(wsUri, userDefinedTypes);
const hrmpTo =
nodeName === 'astar'
? networkInfo.nodesByName['shiden'].parachainId
: networkInfo.nodesByName['astar'].parachainId;
const assetId = hrmpTo; // assetId can be any arbitrary number

await zombie.util.cryptoWaitReady();

// account to submit tx
const keyring = new zombie.Keyring({ type: 'sr25519' });
const sender = keyring.addFromUri('//' + args[0]);

const tx0 = await api.tx.assets.forceCreate(assetId, { id: sender.address }, true, 1);

const assetLocation = `{"v1":{"parents":1,"interior":{"x1":{"parachain":${hrmpTo}}}}}`;
const tx1 = await api.tx.xcAssetConfig.registerAssetLocation(JSON.parse(assetLocation), assetId);

const unitsPerSecond = 7000000000;
const tx2 = await api.tx.xcAssetConfig.setAssetUnitsPerSecond(
JSON.parse(assetLocation),
unitsPerSecond
);

const batch = await api.tx.utility.batch([tx0, tx1, tx2]);
await sendTransaction(api.tx.sudo.sudo(batch), sender);

const assetIdToLocation = await api.query.xcAssetConfig.assetIdToLocation(assetId);
const location = JSON.stringify(assetIdToLocation);

const assetLocationUnitsPerSecond = await api.query.xcAssetConfig.assetLocationUnitsPerSecond(
JSON.parse(assetLocation)
);
const units = JSON.stringify(assetLocationUnitsPerSecond);

const result = assetLocation === location && unitsPerSecond === units ? 1 : 0;
return result;
}

module.exports = { run };
31 changes: 31 additions & 0 deletions tests/zombienet/setup-preconditions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
const TEST_DAPP_ADDRESS = '0x0000000000000000000000000000000000000001';

async function run(nodeName, networkInfo, args) {
const BN = require('bn.js');
const ONE = new BN(10).pow(new BN(18));

const { sendTransaction } = await import('./tx-utils.mjs');
const { wsUri, userDefinedTypes } = networkInfo.nodesByName[nodeName];
const api = await zombie.connect(wsUri, userDefinedTypes);

await zombie.util.cryptoWaitReady();

// account to submit tx
const keyring = new zombie.Keyring({ type: 'sr25519' });
const sender = keyring.addFromUri('//' + args[0]);

// create asset
console.log('Creating asset with sender: ', sender.address);
await sendTransaction(api.tx.assets.create(999, { Id: sender.address }, ONE), sender);
console.log('Setting metadata with sender: ', sender.address);
await sendTransaction(api.tx.assets.setMetadata(999, 'Test', 'TST', 18), sender);

// register dApp
const tx4 = api.tx.dappsStaking.register(sender.address, { Evm: TEST_DAPP_ADDRESS });
await sendTransaction(api.tx.sudo.sudo(tx4), sender);

const result = 1;
return result;
}

module.exports = { run };
43 changes: 43 additions & 0 deletions tests/zombienet/start-playwright.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
const util = require('util');

const spawn = (cmd) =>
new Promise((resolve, reject) => {
const cp = require('child_process').exec(cmd);
const error = [];
const stdout = [];
cp.stdout.on('data', (data) => {
console.log(data.toString());
stdout.push(data.toString());

if (data.toString().includes('Ctrl+C')) {
cp.kill(9);
if (error.length) reject(error.join(''));
else resolve(stdout.join(''));
}
});

cp.on('error', (e) => {
error.push(e.toString());
console.log(e.toString());
});

cp.on('close', () => {
if (error.length) reject(error.join(''));
else resolve(stdout.join(''));
});
});

async function run(nodeName, networkInfo, args) {
console.log('Running Playwright tests on node: ', nodeName, args);
const endpoint = networkInfo.nodesByName[nodeName].wsUri;

let result = await spawn('npx playwright install --with-deps');

result = await spawn(
`BASE_URL=\'${args[0]}\' ENDPOINT=\'${endpoint}\' HEADLESS='true' CI='true' npx playwright test --project=chromium`
);

return result?.includes('failed') ? 0 : 1;
}

module.exports = { run };
32 changes: 32 additions & 0 deletions tests/zombienet/tx-utils.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
export async function sendTransaction(transaction, sender) {
return new Promise((resolve, reject) => {
let unsubscribe;
let timeout;
const SPAWNING_TIME = 500000;

transaction
.signAndSend(sender, async (result) => {
console.log(`Current status is ${result?.status}`);

if (result.isFinalized) {
if (unsubscribe) {
unsubscribe();
}

clearTimeout(timeout);
resolve(true);
}
})
.then((unsub) => {
unsubscribe = unsub;
})
.catch((error) => {
console.error(error);
reject(error);
});

timeout = setTimeout(() => {
reject(new Error('Transaction timeout'));
}, SPAWNING_TIME);
});
}
Loading

0 comments on commit eb5f35d

Please sign in to comment.