Skip to content

Commit

Permalink
Merge pull request #3905 from Koniverse/koni/dev/issue-3861
Browse files Browse the repository at this point in the history
[Issue-3861] Extension - Check for errors when making transactions on Tangle mainnet
  • Loading branch information
saltict authored Dec 16, 2024
2 parents aecd1c0 + b0552c2 commit 958a112
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
22 changes: 11 additions & 11 deletions packages/extension-base/src/services/transaction-service/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1098,7 +1098,7 @@ export default class TransactionService {
return emitter;
}

private async signAndSendSubstrateTransaction ({ address, chain, id, transaction, url }: SWTransaction): Promise<TransactionEmitter> {
private signAndSendSubstrateTransaction ({ address, chain, id, transaction, url }: SWTransaction): TransactionEmitter {
const emitter = new EventEmitter<TransactionEventMap>();
const eventData: TransactionEventResponse = {
id,
Expand All @@ -1108,8 +1108,8 @@ export default class TransactionService {
};

const extrinsic = transaction as SubmittableExtrinsic;
const registry = extrinsic.registry;
const signedExtensions = registry.signedExtensions;
// const registry = extrinsic.registry;
// const signedExtensions = registry.signedExtensions;

const signerOption: Partial<SignerOptions> = {
signer: {
Expand All @@ -1126,14 +1126,14 @@ export default class TransactionService {
withSignedTransaction: true
};

if (_isRuntimeUpdated(signedExtensions)) {
const metadataHash = await this.state.chainService.calculateMetadataHash(chain);

if (metadataHash) {
signerOption.mode = 1;
signerOption.metadataHash = metadataHash;
}
}
// if (_isRuntimeUpdated(signedExtensions)) {
// const metadataHash = await this.state.chainService.calculateMetadataHash(chain);
//
// if (metadataHash) {
// signerOption.mode = 1;
// signerOption.metadataHash = metadataHash;
// }
// }

extrinsic.signAsync(address, signerOption).then(async (rs) => {
// Emit signed event
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function getBlockExplorerTxRoute (chainInfo: _ChainInfo) {
return 'transaction';
}

if (['invarch'].includes(chainInfo.slug)) {
if (['invarch', 'tangle'].includes(chainInfo.slug)) {
return '#/extrinsics';
}

Expand All @@ -86,6 +86,10 @@ export function getExplorerLink (chainInfo: _ChainInfo, value: string, type: 'ac

const route = getBlockExplorerTxRoute(chainInfo);

if (chainInfo.slug === 'tangle') {
return (`${explorerLink}${explorerLink.endsWith('/') ? '' : '/'}extrinsic/${value}${route}/${value}`);
}

return (`${explorerLink}${explorerLink.endsWith('/') ? '' : '/'}${route}/${value}`);
}

Expand Down

1 comment on commit 958a112

@saltict
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.