Skip to content
This repository has been archived by the owner on Mar 23, 2023. It is now read-only.

Commit

Permalink
refactor: update types according to AIP36 changes (#2826)
Browse files Browse the repository at this point in the history
  • Loading branch information
brenopolanski authored Sep 17, 2020
1 parent 061d1f9 commit 5b32326
Show file tree
Hide file tree
Showing 4 changed files with 162 additions and 87 deletions.
12 changes: 5 additions & 7 deletions config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,19 +79,17 @@ exports.TRANSACTION_TYPES = {
}
}

exports.TRANSACTION_ENTITY = {
exports.TRANSACTION_TYPES_ENTITY = {
TYPE: {
BUSINESS: 0,
BRIDGECHAIN: 1, // not used anymore but type is kept
DEVELOPER: 2,
PLUGIN: 3,
PRODUCT: 1,
PLUGIN: 2,
MODULE: 3,
DELEGATE: 4
},

SUBTYPE: {
NONE: 0,
PLUGIN_CORE: 1,
PLUGIN_DESKTOP: 2
NONE: 0
},

ACTION: {
Expand Down
97 changes: 70 additions & 27 deletions src/renderer/components/Wallet/WalletAddress.vue
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,9 @@
{{ $t("TRANSACTION.TYPE.BUSINESS_ENTITY_UPDATE") }}
</span>
<span
v-else-if="transaction_isDeveloperEntityRegistration(type, group, asset)"
v-else-if="transaction_isProductEntityRegistration(type, group, asset)"
v-tooltip="{
content: $t('TRANSACTION.TYPE.DEVELOPER_ENTITY_REGISTRATION'),
content: $t('TRANSACTION.TYPE.PRODUCT_ENTITY_REGISTRATION'),
container: tooltipContainer,
delay: { show: 300, hide: 0 },
show: showTooltip,
Expand All @@ -206,12 +206,12 @@
@mouseover="onMouseOver"
@mouseout="onMouseOut"
>
{{ $t("TRANSACTION.TYPE.DEVELOPER_ENTITY_REGISTRATION") }}
{{ $t("TRANSACTION.TYPE.PRODUCT_ENTITY_REGISTRATION") }}
</span>
<span
v-else-if="transaction_isDeveloperEntityResignation(type, group, asset)"
v-else-if="transaction_isProductEntityResignation(type, group, asset)"
v-tooltip="{
content: $t('TRANSACTION.TYPE.DEVELOPER_ENTITY_RESIGNATION'),
content: $t('TRANSACTION.TYPE.PRODUCT_ENTITY_RESIGNATION'),
container: tooltipContainer,
delay: { show: 300, hide: 0 },
show: showTooltip,
Expand All @@ -220,12 +220,12 @@
@mouseover="onMouseOver"
@mouseout="onMouseOut"
>
{{ $t("TRANSACTION.TYPE.DEVELOPER_ENTITY_RESIGNATION") }}
{{ $t("TRANSACTION.TYPE.PRODUCT_ENTITY_RESIGNATION") }}
</span>
<span
v-else-if="transaction_isDeveloperEntityUpdate(type, group, asset)"
v-else-if="transaction_isProductEntityUpdate(type, group, asset)"
v-tooltip="{
content: $t('TRANSACTION.TYPE.DEVELOPER_ENTITY_UPDATE'),
content: $t('TRANSACTION.TYPE.PRODUCT_ENTITY_UPDATE'),
container: tooltipContainer,
delay: { show: 300, hide: 0 },
show: showTooltip,
Expand All @@ -234,12 +234,12 @@
@mouseover="onMouseOver"
@mouseout="onMouseOut"
>
{{ $t("TRANSACTION.TYPE.DEVELOPER_ENTITY_UPDATE") }}
{{ $t("TRANSACTION.TYPE.PRODUCT_ENTITY_UPDATE") }}
</span>
<span
v-else-if="transaction_isCorePluginEntityRegistration(type, group, asset)"
v-else-if="transaction_isPluginEntityRegistration(type, group, asset)"
v-tooltip="{
content: $t('TRANSACTION.TYPE.CORE_PLUGIN_ENTITY_REGISTRATION'),
content: $t('TRANSACTION.TYPE.PLUGIN_ENTITY_REGISTRATION'),
container: tooltipContainer,
delay: { show: 300, hide: 0 },
show: showTooltip,
Expand All @@ -248,12 +248,12 @@
@mouseover="onMouseOver"
@mouseout="onMouseOut"
>
{{ $t("TRANSACTION.TYPE.CORE_PLUGIN_ENTITY_REGISTRATION") }}
{{ $t("TRANSACTION.TYPE.PLUGIN_ENTITY_REGISTRATION") }}
</span>
<span
v-else-if="transaction_isCorePluginEntityResignation(type, group, asset)"
v-else-if="transaction_isPluginEntityResignation(type, group, asset)"
v-tooltip="{
content: $t('TRANSACTION.TYPE.CORE_PLUGIN_ENTITY_RESIGNATION'),
content: $t('TRANSACTION.TYPE.PLUGIN_ENTITY_RESIGNATION'),
container: tooltipContainer,
delay: { show: 300, hide: 0 },
show: showTooltip,
Expand All @@ -262,12 +262,12 @@
@mouseover="onMouseOver"
@mouseout="onMouseOut"
>
{{ $t("TRANSACTION.TYPE.CORE_PLUGIN_ENTITY_RESIGNATION") }}
{{ $t("TRANSACTION.TYPE.PLUGIN_ENTITY_RESIGNATION") }}
</span>
<span
v-else-if="transaction_isCorePluginEntityUpdate(type, group, asset)"
v-else-if="transaction_isPluginEntityUpdate(type, group, asset)"
v-tooltip="{
content: $t('TRANSACTION.TYPE.CORE_PLUGIN_ENTITY_UPDATE'),
content: $t('TRANSACTION.TYPE.PLUGIN_ENTITY_UPDATE'),
container: tooltipContainer,
delay: { show: 300, hide: 0 },
show: showTooltip,
Expand All @@ -276,12 +276,12 @@
@mouseover="onMouseOver"
@mouseout="onMouseOut"
>
{{ $t("TRANSACTION.TYPE.CORE_PLUGIN_ENTITY_UPDATE") }}
{{ $t("TRANSACTION.TYPE.PLUGIN_ENTITY_UPDATE") }}
</span>
<span
v-else-if="transaction_isDesktopPluginEntityRegistration(type, group, asset)"
v-else-if="transaction_isModuleEntityRegistration(type, group, asset)"
v-tooltip="{
content: $t('TRANSACTION.TYPE.DESKTOP_PLUGIN_ENTITY_REGISTRATION'),
content: $t('TRANSACTION.TYPE.MODULE_ENTITY_REGISTRATION'),
container: tooltipContainer,
delay: { show: 300, hide: 0 },
show: showTooltip,
Expand All @@ -290,12 +290,12 @@
@mouseover="onMouseOver"
@mouseout="onMouseOut"
>
{{ $t("TRANSACTION.TYPE.DESKTOP_PLUGIN_ENTITY_REGISTRATION") }}
{{ $t("TRANSACTION.TYPE.MODULE_ENTITY_REGISTRATION") }}
</span>
<span
v-else-if="transaction_isDesktopPluginEntityResignation(type, group, asset)"
v-else-if="transaction_isModuleEntityResignation(type, group, asset)"
v-tooltip="{
content: $t('TRANSACTION.TYPE.DESKTOP_PLUGIN_ENTITY_RESIGNATION'),
content: $t('TRANSACTION.TYPE.MODULE_ENTITY_RESIGNATION'),
container: tooltipContainer,
delay: { show: 300, hide: 0 },
show: showTooltip,
Expand All @@ -304,12 +304,12 @@
@mouseover="onMouseOver"
@mouseout="onMouseOut"
>
{{ $t("TRANSACTION.TYPE.DESKTOP_PLUGIN_ENTITY_RESIGNATION") }}
{{ $t("TRANSACTION.TYPE.MODULE_ENTITY_RESIGNATION") }}
</span>
<span
v-else-if="transaction_isDesktopPluginEntityUpdate(type, group, asset)"
v-else-if="transaction_isModuleEntityUpdate(type, group, asset)"
v-tooltip="{
content: $t('TRANSACTION.TYPE.DESKTOP_PLUGIN_ENTITY_UPDATE'),
content: $t('TRANSACTION.TYPE.MODULE_ENTITY_UPDATE'),
container: tooltipContainer,
delay: { show: 300, hide: 0 },
show: showTooltip,
Expand All @@ -318,7 +318,7 @@
@mouseover="onMouseOver"
@mouseout="onMouseOut"
>
{{ $t("TRANSACTION.TYPE.DESKTOP_PLUGIN_ENTITY_UPDATE") }}
{{ $t("TRANSACTION.TYPE.MODULE_ENTITY_UPDATE") }}
</span>
<span
v-else-if="transaction_isDelegateEntityRegistration(type, group, asset)"
Expand Down Expand Up @@ -447,6 +447,49 @@
>
{{ $t("TRANSACTION.TYPE.LEGACY_BRIDGECHAIN_UPDATE") }}
</span>
<!-- Unknown type -->
<span
v-else-if="transaction_isUndefinedRegistration(type, group, asset)"
v-tooltip="{
content: $t('TRANSACTION.TYPE.UNDEFINED_REGISTRATION'),
container: tooltipContainer,
delay: { show: 300, hide: 0 },
show: showTooltip,
trigger: 'manual'
}"
@mouseover="onMouseOver"
@mouseout="onMouseOut"
>
{{ $t("TRANSACTION.TYPE.UNDEFINED_REGISTRATION") }}
</span>
<span
v-else-if="transaction_isUndefinedResignation(type, group, asset)"
v-tooltip="{
content: $t('TRANSACTION.TYPE.UNDEFINED_RESIGNATION'),
container: tooltipContainer,
delay: { show: 300, hide: 0 },
show: showTooltip,
trigger: 'manual'
}"
@mouseover="onMouseOver"
@mouseout="onMouseOut"
>
{{ $t("TRANSACTION.TYPE.UNDEFINED_RESIGNATION") }}
</span>
<span
v-else-if="transaction_isUndefinedUpdate(type, group, asset)"
v-tooltip="{
content: $t('TRANSACTION.TYPE.UNDEFINED_UPDATE'),
container: tooltipContainer,
delay: { show: 300, hide: 0 },
show: showTooltip,
trigger: 'manual'
}"
@mouseover="onMouseOver"
@mouseout="onMouseOut"
>
{{ $t("TRANSACTION.TYPE.UNDEFINED_UPDATE") }}
</span>
<span
v-else
v-tooltip="{
Expand Down
25 changes: 15 additions & 10 deletions src/renderer/i18n/locales/en-US.js
Original file line number Diff line number Diff line change
Expand Up @@ -997,15 +997,15 @@ export default {
BUSINESS_ENTITY_REGISTRATION: 'Business Registration',
BUSINESS_ENTITY_RESIGNATION: 'Business Resignation',
BUSINESS_ENTITY_UPDATE: 'Business Update',
DEVELOPER_ENTITY_REGISTRATION: 'Developer Registration',
DEVELOPER_ENTITY_RESIGNATION: 'Developer Resignation',
DEVELOPER_ENTITY_UPDATE: 'Developer Update',
CORE_PLUGIN_ENTITY_REGISTRATION: 'Core Plugin Registration',
CORE_PLUGIN_ENTITY_RESIGNATION: 'Core Plugin Resignation',
CORE_PLUGIN_ENTITY_UPDATE: 'Core Plugin Update',
DESKTOP_PLUGIN_ENTITY_REGISTRATION: 'Desktop Plugin Registration',
DESKTOP_PLUGIN_ENTITY_RESIGNATION: 'Desktop Plugin Resignation',
DESKTOP_PLUGIN_ENTITY_UPDATE: 'Desktop Plugin Update',
PRODUCT_ENTITY_REGISTRATION: 'Product Registration',
PRODUCT_ENTITY_RESIGNATION: 'Product Resignation',
PRODUCT_ENTITY_UPDATE: 'Product Update',
PLUGIN_ENTITY_REGISTRATION: 'Plugin Registration',
PLUGIN_ENTITY_RESIGNATION: 'Plugin Resignation',
PLUGIN_ENTITY_UPDATE: 'Plugin Update',
MODULE_ENTITY_REGISTRATION: 'Module Registration',
MODULE_ENTITY_RESIGNATION: 'Module Resignation',
MODULE_ENTITY_UPDATE: 'Module Update',
DELEGATE_ENTITY_REGISTRATION: 'Delegate Registration (AIP36)',
DELEGATE_ENTITY_RESIGNATION: 'Delegate Resignation (AIP36)',
DELEGATE_ENTITY_UPDATE: 'Delegate Update',
Expand All @@ -1015,7 +1015,12 @@ export default {
LEGACY_BUSINESS_UPDATE: 'Business Update (Legacy)',
LEGACY_BRIDGECHAIN_REGISTRATION: 'Bridgechain Registration (Legacy)',
LEGACY_BRIDGECHAIN_RESIGNATION: 'Bridgechain Resignation (Legacy)',
LEGACY_BRIDGECHAIN_UPDATE: 'Bridgechain Update (Legacy)'
LEGACY_BRIDGECHAIN_UPDATE: 'Bridgechain Update (Legacy)',
// Unknown type
UNDEFINED_REGISTRATION: 'Undefined Registration',
UNDEFINED_RESIGNATION: 'Undefined Resignation',
UNDEFINED_UPDATE: 'Undefined Update',
UNDEFINED: 'Undefined'
},
ERROR: {
VALIDATION: {
Expand Down
Loading

0 comments on commit 5b32326

Please sign in to comment.