Skip to content

Commit

Permalink
Merge pull request #2995 from Emurgo/release/4.17
Browse files Browse the repository at this point in the history
Release / 4.17.0
  • Loading branch information
vsubhuman authored Sep 27, 2022
2 parents 2960973 + 701eb45 commit a3ff4a8
Show file tree
Hide file tree
Showing 135 changed files with 4,620 additions and 2,588 deletions.
2 changes: 1 addition & 1 deletion packages/yoroi-extension/app/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ class App extends Component<Props, State> {
getContent: void => ?Node = () => {
const { stores, actions, history } = this.props;
if (this.state.crashed === true) {
return <CrashPage stores={stores} actions={actions} />;
return <CrashPage />;
}
if (stores.serverConnectionStore.isMaintenance) {
return <MaintenancePage stores={stores} actions={actions} />;
Expand Down
69 changes: 63 additions & 6 deletions packages/yoroi-extension/app/Routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,59 +41,88 @@ const SupportSettingsPage = React.lazy(SupportSettingsPagePromise);
// Dynamic container loading - resolver loads file relative to '/app/' directory
const LoadingPagePromise = () => import('./containers/LoadingPage');
const LoadingPage = React.lazy(LoadingPagePromise);

const NightlyPagePromise = () => import('./containers/profile/NightlyPage');
const NightlyPage = React.lazy(NightlyPagePromise);

const WalletPromise = () => import('./containers/wallet/Wallet');
const Wallet = React.lazy(WalletPromise);

const MyWalletsPagePromise = () => import('./containers/wallet/MyWalletsPage');
const MyWalletsPage = React.lazy(MyWalletsPagePromise);

const WalletSummaryPagePromise = () => import('./containers/wallet/WalletSummaryPage');
const WalletSummaryPage = React.lazy(WalletSummaryPagePromise);

const WalletSendPagePromise = () => import('./containers/wallet/WalletSendPage');
const WalletSendPage = React.lazy(WalletSendPagePromise);

const WalletAssetsPagePromise = () => import('./containers/wallet/WalletAssetsPage');
const WalletAssetsPage = React.lazy(WalletAssetsPagePromise);

const WalletReceivePagePromise = () => import('./containers/wallet/WalletReceivePage');
const WalletReceivePage = React.lazy(WalletReceivePagePromise);

const URILandingPagePromise = () => import('./containers/uri/URILandingPage');
const URILandingPage = React.lazy(URILandingPagePromise);

const TransferPromise = () => import('./containers/transfer/Transfer');
const Transfer = React.lazy(TransferPromise);

const ReceivePromise = () => import('./containers/wallet/Receive');
const Receive = React.lazy(ReceivePromise);

const StakingDashboardPagePromise = () => import('./containers/wallet/staking/StakingDashboardPage');
const StakingDashboardPage = React.lazy(StakingDashboardPagePromise);

const CardanoStakingPagePromise = () => import('./containers/wallet/staking/CardanoStakingPage');
const CardanoStakingPage = React.lazy(CardanoStakingPagePromise);

const NoticeBoardPagePromise = () => import('./containers/notice-board/NoticeBoardPage');
const NoticeBoardPage = React.lazy(NoticeBoardPagePromise);

const VotingPagePromise = () => import('./containers/wallet/voting/VotingPage');
const VotingPage = React.lazy(VotingPagePromise);

const ComplexityLevelSettingsPagePromise = () => import('./containers/settings/categories/ComplexityLevelSettingsPage');
const ComplexityLevelSettingsPage = React.lazy(ComplexityLevelSettingsPagePromise);

const ComplexityLevelPagePromise = () => import('./containers/profile/ComplexityLevelPage');
const ComplexityLevelPage = React.lazy(ComplexityLevelPagePromise);

const BlockchainSettingsPagePromise = () => import('./containers/settings/categories/BlockchainSettingsPage');
const BlockchainSettingsPage = React.lazy(BlockchainSettingsPagePromise);

const WalletSwitchPromise = () => import('./containers/WalletSwitch');
const WalletSwitch = React.lazy(WalletSwitchPromise);

const StakingPagePromise = () => import('./containers/wallet/staking/StakingPage');
const StakingPage = React.lazy(StakingPagePromise);

const AssetsWrapperPromise = () => import('./containers/wallet/AssetsWrapper');
const AssetsWrapper = React.lazy(AssetsWrapperPromise);

const NFTsWrapperPromise = () => import('./containers/wallet/NFTsWrapper');
const NFTsWrapper = React.lazy(NFTsWrapperPromise);

const TokensPageRevampPromise = () => import('./containers/wallet/TokensPageRevamp');
const TokensPageRevamp = React.lazy(TokensPageRevampPromise);

const TokensDetailPageRevampPromise = () => import('./containers/wallet/TokenDetailPageRevamp');
const TokensDetailPageRevamp = React.lazy(TokensDetailPageRevampPromise);

const NFTsPageRevampPromise = () => import('./containers/wallet/NFTsPageRevamp');
const NFTsPageRevamp = React.lazy(NFTsPageRevampPromise);

const NFTDetailPageRevampPromise = () => import('./containers/wallet/NFTDetailPageRevamp');
const NFTDetailPageRevamp = React.lazy(NFTDetailPageRevampPromise);

const ConnectedWebsitesPagePromise = () => import('./containers/dapp-connector/ConnectedWebsitesContainer');
const ConnectedWebsitesPage = React.lazy(ConnectedWebsitesPagePromise);

const YoroiPalettePagePromise = () => import('./containers/experimental/YoroiPalette');
const YoroiPalettePage = React.lazy(YoroiPalettePagePromise);

const YoroiThemesPagePromise = () => import('./containers/experimental/yoroiThemes');
const YoroiThemesPage = React.lazy(YoroiThemesPagePromise);

Expand Down Expand Up @@ -198,6 +227,17 @@ export const Routes = (
)
)}
/>

<Route
path={ROUTES.NFTS.ROOT}
component={(props) => (
wrapNFTs(
{ ...props, stores, actions },
NFTsSubPages(stores, actions)
)
)}
/>

<Route
exact
path={ROUTES.WALLETS.ADD}
Expand Down Expand Up @@ -360,27 +400,31 @@ const AssetsSubpages = (stores, actions) => (
<Switch>
<Route
exact
path={ROUTES.ASSETS.TOKENS}
path={ROUTES.ASSETS.ROOT}
component={(props) => <TokensPageRevamp {...props} stores={stores} actions={actions} />}
/>
<Route
exact
path={ROUTES.ASSETS.TOKEN_DETAILS}
path={ROUTES.ASSETS.DETAILS}
component={(props) => <TokensDetailPageRevamp {...props} stores={stores} actions={actions} />}
/>
</Switch>
);

const NFTsSubPages = (stores, actions) => (
<Switch>
<Route
exact
path={ROUTES.ASSETS.NFTS}
path={ROUTES.NFTS.ROOT}
component={(props) => <NFTsPageRevamp {...props} stores={stores} actions={actions} />}
/>
<Route
exact
path={ROUTES.ASSETS.NFT_DETAILS}
path={ROUTES.NFTS.DETAILS}
component={(props) => <NFTDetailPageRevamp {...props} stores={stores} actions={actions} />}
/>
<Redirect to={ROUTES.ASSETS.TOKENS} />
</Switch>
);
)
/* eslint-enable max-len */

export function wrapSettings(
Expand Down Expand Up @@ -409,6 +453,19 @@ export function wrapAssets(
);
}

export function wrapNFTs(
assetsProps: InjectedOrGenerated<AssetsData>,
children: Node,
): Node {
return (
<NFTsWrapper
{...assetsProps}
>
{children}
</NFTsWrapper>
);
}

export function wrapWallet(
walletProps: InjectedOrGenerated<WalletData>,
children: Node,
Expand Down
8 changes: 5 additions & 3 deletions packages/yoroi-extension/app/api/ada/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import moment from 'moment';
import BigNumber from 'bignumber.js';
import type { lf$Database } from 'lovefield';
import { Logger, stringifyData, stringifyError } from '../../utils/logging';
import { fullErrStr, Logger, stringifyData, stringifyError } from '../../utils/logging';
import CardanoByronTransaction from '../../domain/CardanoByronTransaction';
import CardanoShelleyTransaction from '../../domain/CardanoShelleyTransaction';
import {
Expand Down Expand Up @@ -862,13 +862,14 @@ export default class AdaApi {
request.signRequest.metadata,
);

const response = request.sendTx({
const response = await request.sendTx({
network: request.publicDeriver.getParent().getNetworkInfo(),
id: Buffer.from(
RustModule.WalletV4.hash_transaction(signedTx.body()).to_bytes()
).toString('hex'),
encodedTx: signedTx.to_bytes(),
});

Logger.debug(
`${nameof(AdaApi)}::${nameof(this.signAndBroadcast)} success: ` + stringifyData(response)
);
Expand All @@ -877,7 +878,8 @@ export default class AdaApi {
if (error instanceof WrongPassphraseError) {
throw new IncorrectWalletPasswordError();
}
Logger.error(`${nameof(AdaApi)}::${nameof(this.signAndBroadcast)} error: ` + stringifyError(error));

Logger.error(`${nameof(AdaApi)}::${nameof(this.signAndBroadcast)} error: ${fullErrStr(error)}` );
if (error instanceof InvalidWitnessError) {
throw new InvalidWitnessError();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,12 @@ export class RemoteFetcher implements IFetcher {
txId: body.id
}))
.catch((error) => {
Logger.error(`${nameof(RemoteFetcher)}::${nameof(this.sendTx)} error: ` + stringifyError(error));
const err = {
msg: error.message,
res: error.response?.data || null,
}

Logger.error(`${nameof(RemoteFetcher)}::${nameof(this.sendTx)} error: ${stringifyError(err)}`);
if (error.request.response.includes('Invalid witness')) {
throw new InvalidWitnessError();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,22 @@ Array [
"NetworkId": 400,
"TokenId": 5,
},
Object {
"Digest": 6.262633522161549e-167,
"Identifier": "",
"IsDefault": true,
"IsNFT": false,
"Metadata": Object {
"assetName": "",
"longName": null,
"numberOfDecimals": 6,
"policyId": "",
"ticker": "TADA",
"type": "Cardano",
},
"NetworkId": 250,
"TokenId": 6,
},
],
},
Object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,22 @@ Array [
"NetworkId": 400,
"TokenId": 5,
},
Object {
"Digest": 6.262633522161549e-167,
"Identifier": "",
"IsDefault": true,
"IsNFT": false,
"Metadata": Object {
"assetName": "",
"longName": null,
"numberOfDecimals": 6,
"policyId": "",
"ticker": "TADA",
"type": "Cardano",
},
"NetworkId": 250,
"TokenId": 6,
},
],
},
Object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,22 @@ Array [
"NetworkId": 400,
"TokenId": 5,
},
Object {
"Digest": 6.262633522161549e-167,
"Identifier": "",
"IsDefault": true,
"IsNFT": false,
"Metadata": Object {
"assetName": "",
"longName": null,
"numberOfDecimals": 6,
"policyId": "",
"ticker": "TADA",
"type": "Cardano",
},
"NetworkId": 250,
"TokenId": 6,
},
],
},
Object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -976,6 +976,22 @@ Array [
"NetworkId": 400,
"TokenId": 5,
},
Object {
"Digest": 6.262633522161549e-167,
"Identifier": "",
"IsDefault": true,
"IsNFT": false,
"Metadata": Object {
"assetName": "",
"longName": null,
"numberOfDecimals": 6,
"policyId": "",
"ticker": "TADA",
"type": "Cardano",
},
"NetworkId": 250,
"TokenId": 6,
},
],
},
Object {
Expand Down Expand Up @@ -2144,6 +2160,22 @@ Array [
"NetworkId": 400,
"TokenId": 5,
},
Object {
"Digest": 6.262633522161549e-167,
"Identifier": "",
"IsDefault": true,
"IsNFT": false,
"Metadata": Object {
"assetName": "",
"longName": null,
"numberOfDecimals": 6,
"policyId": "",
"ticker": "TADA",
"type": "Cardano",
},
"NetworkId": 250,
"TokenId": 6,
},
],
},
Object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,22 @@ const CardanoTestnetExplorers: Array<$ReadOnly<ExplorerRow>> = [
},
];

const CardanoPreprodTestnetExplorers: Array<$ReadOnly<ExplorerRow>> = [
{
ExplorerId: 4_50,
NetworkId: networks.CardanoPreprodTestnet.NetworkId,
IsBackup: true,
Endpoints: {
address: 'https://testnet.cardanoscan.io/address/',
transaction: 'https://testnet.cardanoscan.io/transaction/',
pool: 'https://testnet.cardanoscan.io/pool/',
stakeAddress: 'https://testnet.cardanoscan.io/stakeKey/',
token: 'https://testnet.cardanoscan.io/token/',
},
Name: 'CardanoScan',
},
];

const AlonzoTestnetExplorers: Array<$ReadOnly<ExplorerRow>> = [
{
ExplorerId: 5_00,
Expand All @@ -150,6 +166,7 @@ const AlonzoTestnetExplorers: Array<$ReadOnly<ExplorerRow>> = [
export const prepackagedExplorers: Map<number, $ReadOnlyArray<$ReadOnly<ExplorerRow>>> = new Map([
[networks.CardanoMainnet.NetworkId, CardanoMainnetExplorers],
[networks.CardanoTestnet.NetworkId, CardanoTestnetExplorers],
[networks.CardanoPreprodTestnet.NetworkId, CardanoPreprodTestnetExplorers],
[networks.JormungandrMainnet.NetworkId, JormungandrExplorers],
[networks.ErgoMainnet.NetworkId, ErgoExplorers],
[networks.AlonzoTestnet.NetworkId, AlonzoTestnetExplorers],
Expand All @@ -166,6 +183,9 @@ export const prepackagedDefaultExplorers:
[networks.CardanoTestnet.NetworkId, getOrThrow(
CardanoTestnetExplorers.find(explorer => explorer.IsBackup)
)],
[networks.CardanoPreprodTestnet.NetworkId, getOrThrow(
CardanoTestnetExplorers.find(explorer => explorer.IsBackup)
)],
[networks.JormungandrMainnet.NetworkId, getOrThrow(
JormungandrExplorers.find(explorer => explorer.IsBackup)
)],
Expand Down
Loading

0 comments on commit a3ff4a8

Please sign in to comment.