mirror of
https://github.com/embarklabs/embark.git
synced 2025-02-18 00:27:17 +00:00
fix(@embark/cockpit): Fix decode transaction error
Reproduce: 1. Go to cockpit > transactions 2. Click a transaction 3. There will be a flicker of an error, then the decoded tx displays OK. Inspecting the network requests, there is a 500 error with a response of ``` AssertionError [ERR_ASSERTION]: invalid remainder ``` This error is also printed in the console. The issue is that the transaction is not a raw transaction, so instead of trying to decode the non-raw transaction, the transaction can be decoded by web3.
This commit is contained in:
parent
9bd33a9de5
commit
f957ba55dd
@ -1,6 +1,3 @@
|
|||||||
import {EMBARK_PROCESS_NAME} from '../constants';
|
|
||||||
import {ansiToHtml} from '../utils/utils';
|
|
||||||
|
|
||||||
export const REQUEST = 'REQUEST';
|
export const REQUEST = 'REQUEST';
|
||||||
export const SUCCESS = 'SUCCESS';
|
export const SUCCESS = 'SUCCESS';
|
||||||
export const FAILURE = 'FAILURE';
|
export const FAILURE = 'FAILURE';
|
||||||
|
@ -54,8 +54,8 @@ const LayoutContract = ({contract, children, cardTitle}) => (
|
|||||||
|
|
||||||
LayoutContract.propTypes = {
|
LayoutContract.propTypes = {
|
||||||
contract: PropTypes.object,
|
contract: PropTypes.object,
|
||||||
children: PropTypes.array,
|
children: PropTypes.any,
|
||||||
cardTitle: PropTypes.object
|
cardTitle: PropTypes.any
|
||||||
};
|
};
|
||||||
|
|
||||||
const DeploymentResult = ({deployment}) => {
|
const DeploymentResult = ({deployment}) => {
|
||||||
|
@ -21,13 +21,12 @@ export function estimateGas({web3, contract, args}) {
|
|||||||
|
|
||||||
export function deploy({web3, contract, args}) {
|
export function deploy({web3, contract, args}) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const cleanup = () => { promiEvent.removeAllListeners(); };
|
new web3.eth.Contract(contract.abiDefinition)
|
||||||
const promiEvent = new web3.eth.Contract(contract.abiDefinition)
|
|
||||||
.deploy({data: `0x${contract.code}`, arguments: args})
|
.deploy({data: `0x${contract.code}`, arguments: args})
|
||||||
.send({from: web3.eth.defaultAccount})
|
.send({from: web3.eth.defaultAccount})
|
||||||
.on('error', reject)
|
.on('error', reject)
|
||||||
.on('receipt', resolve)
|
.once('receipt', resolve)
|
||||||
.then(cleanup)
|
.catch(reject)
|
||||||
.catch(cleanup);
|
.then(() => {});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -419,7 +419,7 @@ class BlockchainConnector {
|
|||||||
'get',
|
'get',
|
||||||
'/embark-api/blockchain/transactions/:hash',
|
'/embark-api/blockchain/transactions/:hash',
|
||||||
(req, res) => {
|
(req, res) => {
|
||||||
self.getTransactionByRawTransactionHash(req.params.hash, (err, transaction) => {
|
self.getTransactionByHash(req.params.hash, (err, transaction) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
self.logger.error(err);
|
self.logger.error(err);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user