Merge branch 'master' into ui-2
This commit is contained in:
commit
539164945a
@ -42,7 +42,7 @@ linux-stable:
|
|||||||
- md5sum "parity_"$VER"_amd64.deb" > "parity_"$VER"_amd64.deb.md5"
|
- md5sum "parity_"$VER"_amd64.deb" > "parity_"$VER"_amd64.deb.md5"
|
||||||
- aws configure set aws_access_key_id $s3_key
|
- aws configure set aws_access_key_id $s3_key
|
||||||
- aws configure set aws_secret_access_key $s3_secret
|
- aws configure set aws_secret_access_key $s3_secret
|
||||||
- if [[ $CI_BUILD_REF_NAME =~ ^(master|beta|stable)$ ]]; then export S3_BUCKET=builds-parity-published; else export S3_BUCKET=builds-parity; fi
|
- if [[ $CI_BUILD_REF_NAME =~ ^(master|beta|stable|nightly)$ ]]; then export S3_BUCKET=builds-parity-published; else export S3_BUCKET=builds-parity; fi
|
||||||
- aws s3 rm --recursive s3://$S3_BUCKET/$CI_BUILD_REF_NAME/x86_64-unknown-linux-gnu
|
- aws s3 rm --recursive s3://$S3_BUCKET/$CI_BUILD_REF_NAME/x86_64-unknown-linux-gnu
|
||||||
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/x86_64-unknown-linux-gnu/parity --body target/release/parity
|
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/x86_64-unknown-linux-gnu/parity --body target/release/parity
|
||||||
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/x86_64-unknown-linux-gnu/parity.md5 --body parity.md5
|
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/x86_64-unknown-linux-gnu/parity.md5 --body parity.md5
|
||||||
@ -60,6 +60,24 @@ linux-stable:
|
|||||||
- target/release/ethstore
|
- target/release/ethstore
|
||||||
- target/release/ethkey
|
- target/release/ethkey
|
||||||
name: "stable-x86_64-unknown-linux-gnu_parity"
|
name: "stable-x86_64-unknown-linux-gnu_parity"
|
||||||
|
linux-snap:
|
||||||
|
stage: build
|
||||||
|
image: parity/snapcraft:gitlab-ci
|
||||||
|
only:
|
||||||
|
- snap
|
||||||
|
- beta
|
||||||
|
script:
|
||||||
|
- rm -rf *snap
|
||||||
|
- cd scripts
|
||||||
|
- snapcraft
|
||||||
|
tags:
|
||||||
|
- rust
|
||||||
|
- rust-stable
|
||||||
|
artifacts:
|
||||||
|
paths:
|
||||||
|
- scripts/parity_master_amd64.snap
|
||||||
|
name: "stable-x86_64-unknown-linux-gnu_parity-snap"
|
||||||
|
allow_failure: true
|
||||||
linux-stable-debian:
|
linux-stable-debian:
|
||||||
stage: build
|
stage: build
|
||||||
image: parity/rust-debian:gitlab-ci
|
image: parity/rust-debian:gitlab-ci
|
||||||
@ -89,7 +107,7 @@ linux-stable-debian:
|
|||||||
- md5sum "parity_"$VER"_amd64.deb" > "parity_"$VER"_amd64.deb.md5"
|
- md5sum "parity_"$VER"_amd64.deb" > "parity_"$VER"_amd64.deb.md5"
|
||||||
- aws configure set aws_access_key_id $s3_key
|
- aws configure set aws_access_key_id $s3_key
|
||||||
- aws configure set aws_secret_access_key $s3_secret
|
- aws configure set aws_secret_access_key $s3_secret
|
||||||
- if [[ $CI_BUILD_REF_NAME =~ ^(master|beta|stable)$ ]]; then export S3_BUCKET=builds-parity-published; else export S3_BUCKET=builds-parity; fi
|
- if [[ $CI_BUILD_REF_NAME =~ ^(master|beta|stable|nightly)$ ]]; then export S3_BUCKET=builds-parity-published; else export S3_BUCKET=builds-parity; fi
|
||||||
- aws s3 rm --recursive s3://$S3_BUCKET/$CI_BUILD_REF_NAME/x86_64-unknown-debian-gnu
|
- aws s3 rm --recursive s3://$S3_BUCKET/$CI_BUILD_REF_NAME/x86_64-unknown-debian-gnu
|
||||||
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/x86_64-unknown-debian-gnu/parity --body target/release/parity
|
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/x86_64-unknown-debian-gnu/parity --body target/release/parity
|
||||||
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/x86_64-unknown-debian-gnu/parity.md5 --body parity.md5
|
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/x86_64-unknown-debian-gnu/parity.md5 --body parity.md5
|
||||||
@ -162,7 +180,7 @@ linux-centos:
|
|||||||
- export SHA3=$(target/release/parity tools hash target/release/parity)
|
- export SHA3=$(target/release/parity tools hash target/release/parity)
|
||||||
- aws configure set aws_access_key_id $s3_key
|
- aws configure set aws_access_key_id $s3_key
|
||||||
- aws configure set aws_secret_access_key $s3_secret
|
- aws configure set aws_secret_access_key $s3_secret
|
||||||
- if [[ $CI_BUILD_REF_NAME =~ ^(master|beta|stable)$ ]]; then export S3_BUCKET=builds-parity-published; else export S3_BUCKET=builds-parity; fi
|
- if [[ $CI_BUILD_REF_NAME =~ ^(master|beta|stable|nightly)$ ]]; then export S3_BUCKET=builds-parity-published; else export S3_BUCKET=builds-parity; fi
|
||||||
- aws s3 rm --recursive s3://$S3_BUCKET/$CI_BUILD_REF_NAME/x86_64-unknown-centos-gnu
|
- aws s3 rm --recursive s3://$S3_BUCKET/$CI_BUILD_REF_NAME/x86_64-unknown-centos-gnu
|
||||||
- aws s3api put-object --bucket builds-parity --key $CI_BUILD_REF_NAME/x86_64-unknown-centos-gnu/parity --body target/release/parity
|
- aws s3api put-object --bucket builds-parity --key $CI_BUILD_REF_NAME/x86_64-unknown-centos-gnu/parity --body target/release/parity
|
||||||
- aws s3api put-object --bucket builds-parity --key $CI_BUILD_REF_NAME/x86_64-unknown-centos-gnu/parity.md5 --body parity.md5
|
- aws s3api put-object --bucket builds-parity --key $CI_BUILD_REF_NAME/x86_64-unknown-centos-gnu/parity.md5 --body parity.md5
|
||||||
@ -199,7 +217,7 @@ linux-i686:
|
|||||||
- md5sum "parity_"$VER"_i386.deb" > "parity_"$VER"_i386.deb.md5"
|
- md5sum "parity_"$VER"_i386.deb" > "parity_"$VER"_i386.deb.md5"
|
||||||
- aws configure set aws_access_key_id $s3_key
|
- aws configure set aws_access_key_id $s3_key
|
||||||
- aws configure set aws_secret_access_key $s3_secret
|
- aws configure set aws_secret_access_key $s3_secret
|
||||||
- if [[ $CI_BUILD_REF_NAME =~ ^(master|beta|stable)$ ]]; then export S3_BUCKET=builds-parity-published; else export S3_BUCKET=builds-parity; fi
|
- if [[ $CI_BUILD_REF_NAME =~ ^(master|beta|stable|nightly)$ ]]; then export S3_BUCKET=builds-parity-published; else export S3_BUCKET=builds-parity; fi
|
||||||
- aws s3 rm --recursive s3://$S3_BUCKET/$CI_BUILD_REF_NAME/$PLATFORM
|
- aws s3 rm --recursive s3://$S3_BUCKET/$CI_BUILD_REF_NAME/$PLATFORM
|
||||||
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$PLATFORM/parity --body target/$PLATFORM/release/parity
|
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$PLATFORM/parity --body target/$PLATFORM/release/parity
|
||||||
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$PLATFORM/parity.md5 --body parity.md5
|
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$PLATFORM/parity.md5 --body parity.md5
|
||||||
@ -245,7 +263,7 @@ linux-armv7:
|
|||||||
- md5sum "parity_"$VER"_armhf.deb" > "parity_"$VER"_armhf.deb.md5"
|
- md5sum "parity_"$VER"_armhf.deb" > "parity_"$VER"_armhf.deb.md5"
|
||||||
- aws configure set aws_access_key_id $s3_key
|
- aws configure set aws_access_key_id $s3_key
|
||||||
- aws configure set aws_secret_access_key $s3_secret
|
- aws configure set aws_secret_access_key $s3_secret
|
||||||
- if [[ $CI_BUILD_REF_NAME =~ ^(master|beta|stable)$ ]]; then export S3_BUCKET=builds-parity-published; else export S3_BUCKET=builds-parity; fi
|
- if [[ $CI_BUILD_REF_NAME =~ ^(master|beta|stable|nightly)$ ]]; then export S3_BUCKET=builds-parity-published; else export S3_BUCKET=builds-parity; fi
|
||||||
- aws s3 rm --recursive s3://$S3_BUCKET/$CI_BUILD_REF_NAME/$PLATFORM
|
- aws s3 rm --recursive s3://$S3_BUCKET/$CI_BUILD_REF_NAME/$PLATFORM
|
||||||
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$PLATFORM/parity --body target/$PLATFORM/release/parity
|
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$PLATFORM/parity --body target/$PLATFORM/release/parity
|
||||||
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$PLATFORM/parity.md5 --body parity.md5
|
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$PLATFORM/parity.md5 --body parity.md5
|
||||||
@ -291,7 +309,7 @@ linux-arm:
|
|||||||
- md5sum "parity_"$VER"_armhf.deb" > "parity_"$VER"_armhf.deb.md5"
|
- md5sum "parity_"$VER"_armhf.deb" > "parity_"$VER"_armhf.deb.md5"
|
||||||
- aws configure set aws_access_key_id $s3_key
|
- aws configure set aws_access_key_id $s3_key
|
||||||
- aws configure set aws_secret_access_key $s3_secret
|
- aws configure set aws_secret_access_key $s3_secret
|
||||||
- if [[ $CI_BUILD_REF_NAME =~ ^(master|beta|stable)$ ]]; then export S3_BUCKET=builds-parity-published; else export S3_BUCKET=builds-parity; fi
|
- if [[ $CI_BUILD_REF_NAME =~ ^(master|beta|stable|nightly)$ ]]; then export S3_BUCKET=builds-parity-published; else export S3_BUCKET=builds-parity; fi
|
||||||
- aws s3 rm --recursive s3://$S3_BUCKET/$CI_BUILD_REF_NAME/$PLATFORM
|
- aws s3 rm --recursive s3://$S3_BUCKET/$CI_BUILD_REF_NAME/$PLATFORM
|
||||||
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$PLATFORM/parity --body target/$PLATFORM/release/parity
|
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$PLATFORM/parity --body target/$PLATFORM/release/parity
|
||||||
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$PLATFORM/parity.md5 --body parity.md5
|
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$PLATFORM/parity.md5 --body parity.md5
|
||||||
@ -332,7 +350,7 @@ linux-armv6:
|
|||||||
- md5sum target/$PLATFORM/release/parity > parity.md5
|
- md5sum target/$PLATFORM/release/parity > parity.md5
|
||||||
- aws configure set aws_access_key_id $s3_key
|
- aws configure set aws_access_key_id $s3_key
|
||||||
- aws configure set aws_secret_access_key $s3_secret
|
- aws configure set aws_secret_access_key $s3_secret
|
||||||
- if [[ $CI_BUILD_REF_NAME =~ ^(master|beta|stable)$ ]]; then export S3_BUCKET=builds-parity-published; else export S3_BUCKET=builds-parity; fi
|
- if [[ $CI_BUILD_REF_NAME =~ ^(master|beta|stable|nightly)$ ]]; then export S3_BUCKET=builds-parity-published; else export S3_BUCKET=builds-parity; fi
|
||||||
- aws s3 rm --recursive s3://$S3_BUCKET/$CI_BUILD_REF_NAME/$PLATFORM
|
- aws s3 rm --recursive s3://$S3_BUCKET/$CI_BUILD_REF_NAME/$PLATFORM
|
||||||
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$PLATFORM/parity --body target/$PLATFORM/release/parity
|
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$PLATFORM/parity --body target/$PLATFORM/release/parity
|
||||||
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$PLATFORM/parity.md5 --body parity.md5
|
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$PLATFORM/parity.md5 --body parity.md5
|
||||||
@ -376,7 +394,7 @@ linux-aarch64:
|
|||||||
- md5sum "parity_"$VER"_arm64.deb" > "parity_"$VER"_arm64.deb.md5"
|
- md5sum "parity_"$VER"_arm64.deb" > "parity_"$VER"_arm64.deb.md5"
|
||||||
- aws configure set aws_access_key_id $s3_key
|
- aws configure set aws_access_key_id $s3_key
|
||||||
- aws configure set aws_secret_access_key $s3_secret
|
- aws configure set aws_secret_access_key $s3_secret
|
||||||
- if [[ $CI_BUILD_REF_NAME =~ ^(master|beta|stable)$ ]]; then export S3_BUCKET=builds-parity-published; else export S3_BUCKET=builds-parity; fi
|
- if [[ $CI_BUILD_REF_NAME =~ ^(master|beta|stable|nightly)$ ]]; then export S3_BUCKET=builds-parity-published; else export S3_BUCKET=builds-parity; fi
|
||||||
- aws s3 rm --recursive s3://$S3_BUCKET/$CI_BUILD_REF_NAME/$PLATFORM
|
- aws s3 rm --recursive s3://$S3_BUCKET/$CI_BUILD_REF_NAME/$PLATFORM
|
||||||
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$PLATFORM/parity.md5 --body parity.md5
|
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$PLATFORM/parity.md5 --body parity.md5
|
||||||
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$PLATFORM/"parity_"$VER"_arm64.deb" --body "parity_"$VER"_arm64.deb"
|
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$PLATFORM/"parity_"$VER"_arm64.deb" --body "parity_"$VER"_arm64.deb"
|
||||||
@ -416,7 +434,7 @@ darwin:
|
|||||||
md5sum "parity-"$VER"-macos-installer.pkg" >> "parity-"$VER"-macos-installer.pkg.md5"
|
md5sum "parity-"$VER"-macos-installer.pkg" >> "parity-"$VER"-macos-installer.pkg.md5"
|
||||||
aws configure set aws_access_key_id $s3_key
|
aws configure set aws_access_key_id $s3_key
|
||||||
aws configure set aws_secret_access_key $s3_secret
|
aws configure set aws_secret_access_key $s3_secret
|
||||||
if [[ $CI_BUILD_REF_NAME =~ ^(master|beta|stable)$ ]]; then export S3_BUCKET=builds-parity-published; else export S3_BUCKET=builds-parity; fi
|
if [[ $CI_BUILD_REF_NAME =~ ^(master|beta|stable|nightly)$ ]]; then export S3_BUCKET=builds-parity-published; else export S3_BUCKET=builds-parity; fi
|
||||||
aws s3 rm --recursive s3://$S3_BUCKET/$CI_BUILD_REF_NAME/$PLATFORM
|
aws s3 rm --recursive s3://$S3_BUCKET/$CI_BUILD_REF_NAME/$PLATFORM
|
||||||
aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$PLATFORM/parity --body target/release/parity
|
aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$PLATFORM/parity --body target/release/parity
|
||||||
aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$PLATFORM/parity.md5 --body parity.md5
|
aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$PLATFORM/parity.md5 --body parity.md5
|
||||||
@ -473,6 +491,7 @@ windows:
|
|||||||
- echo %CI_BUILD_REF_NAME% | findstr /R "master" >nul 2>&1 && set S3_BUCKET=builds-parity-published || set S3_BUCKET=builds-parity
|
- echo %CI_BUILD_REF_NAME% | findstr /R "master" >nul 2>&1 && set S3_BUCKET=builds-parity-published || set S3_BUCKET=builds-parity
|
||||||
- echo %CI_BUILD_REF_NAME% | findstr /R "beta" >nul 2>&1 && set S3_BUCKET=builds-parity-published || set S3_BUCKET=builds-parity
|
- echo %CI_BUILD_REF_NAME% | findstr /R "beta" >nul 2>&1 && set S3_BUCKET=builds-parity-published || set S3_BUCKET=builds-parity
|
||||||
- echo %CI_BUILD_REF_NAME% | findstr /R "stable" >nul 2>&1 && set S3_BUCKET=builds-parity-published || set S3_BUCKET=builds-parity
|
- echo %CI_BUILD_REF_NAME% | findstr /R "stable" >nul 2>&1 && set S3_BUCKET=builds-parity-published || set S3_BUCKET=builds-parity
|
||||||
|
- echo %CI_BUILD_REF_NAME% | findstr /R "nightly" >nul 2>&1 && set S3_BUCKET=builds-parity-published || set S3_BUCKET=builds-parity
|
||||||
- echo %S3_BUCKET%
|
- echo %S3_BUCKET%
|
||||||
- aws s3 rm --recursive s3://%S3_BUCKET%/%CI_BUILD_REF_NAME%/x86_64-pc-windows-msvc
|
- aws s3 rm --recursive s3://%S3_BUCKET%/%CI_BUILD_REF_NAME%/x86_64-pc-windows-msvc
|
||||||
- aws s3api put-object --bucket %S3_BUCKET% --key %CI_BUILD_REF_NAME%/x86_64-pc-windows-msvc/parity.exe --body target\release\parity.exe
|
- aws s3api put-object --bucket %S3_BUCKET% --key %CI_BUILD_REF_NAME%/x86_64-pc-windows-msvc/parity.exe --body target\release\parity.exe
|
||||||
|
@ -14,10 +14,8 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import {
|
import { inAddress, inAddresses, inBlockNumber, inData, inDeriveHash, inDeriveIndex, inHex, inNumber16, inOptions } from '../../format/input';
|
||||||
inAddress, inAddresses, inData, inHex, inNumber16, inOptions, inBlockNumber, inDeriveHash, inDeriveIndex
|
import { outAccountInfo, outAddress, outAddresses, outBlock, outChainStatus, outHistogram, outHwAccountInfo, outNodeKind, outNumber, outPeers, outRecentDapps, outTransaction, outVaultMeta } from '../../format/output';
|
||||||
} from '../../format/input';
|
|
||||||
import { outAccountInfo, outAddress, outAddresses, outChainStatus, outHistogram, outHwAccountInfo, outNodeKind, outNumber, outPeers, outRecentDapps, outTransaction, outVaultMeta } from '../../format/output';
|
|
||||||
|
|
||||||
export default class Parity {
|
export default class Parity {
|
||||||
constructor (transport) {
|
constructor (transport) {
|
||||||
@ -189,6 +187,12 @@ export default class Parity {
|
|||||||
.execute('parity_generateSecretPhrase');
|
.execute('parity_generateSecretPhrase');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getBlockHeaderByNumber (blockNumber = 'latest') {
|
||||||
|
return this._transport
|
||||||
|
.execute('parity_getBlockHeaderByNumber', inBlockNumber(blockNumber))
|
||||||
|
.then(outBlock);
|
||||||
|
}
|
||||||
|
|
||||||
getDappAddresses (dappId) {
|
getDappAddresses (dappId) {
|
||||||
return this._transport
|
return this._transport
|
||||||
.execute('parity_getDappAddresses', dappId)
|
.execute('parity_getDappAddresses', dappId)
|
||||||
|
@ -43,7 +43,7 @@ export const subscribe = (name, from = 0, to = 'pending') =>
|
|||||||
|
|
||||||
events.forEach((e) => {
|
events.forEach((e) => {
|
||||||
Promise.all([
|
Promise.all([
|
||||||
api.eth.getBlockByNumber(e.blockNumber),
|
api.parity.getBlockHeaderByNumber(e.blockNumber),
|
||||||
api.eth.getTransactionByHash(e.transactionHash)
|
api.eth.getTransactionByHash(e.transactionHash)
|
||||||
])
|
])
|
||||||
.then(([block, tx]) => {
|
.then(([block, tx]) => {
|
||||||
|
@ -158,7 +158,7 @@ export function attachEvents (contract, callback) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function getBlock (blockNumber) {
|
export function getBlock (blockNumber) {
|
||||||
return api.eth.getBlockByNumber(blockNumber);
|
return api.parity.getBlockHeaderByNumber(blockNumber);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function callRegister (instance, id, options = {}) {
|
export function callRegister (instance, id, options = {}) {
|
||||||
|
@ -94,7 +94,7 @@ export default class Event extends Component {
|
|||||||
|
|
||||||
Promise
|
Promise
|
||||||
.all([
|
.all([
|
||||||
api.eth.getBlockByNumber(event.blockNumber),
|
api.parity.getBlockHeaderByNumber(event.blockNumber),
|
||||||
getCoin(event.params.tokenreg, event.params.coin)
|
getCoin(event.params.tokenreg, event.params.coin)
|
||||||
])
|
])
|
||||||
.then(([block, coin]) => {
|
.then(([block, coin]) => {
|
||||||
|
@ -97,8 +97,8 @@ export default class Event extends Component {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
api.eth
|
api.parity
|
||||||
.getBlockByNumber(event.blockNumber)
|
.getBlockHeaderByNumber(event.blockNumber)
|
||||||
.then((block) => {
|
.then((block) => {
|
||||||
this.setState({ block });
|
this.setState({ block });
|
||||||
});
|
});
|
||||||
|
@ -296,6 +296,19 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getBlockHeaderByNumber: {
|
||||||
|
section: SECTION_NET,
|
||||||
|
desc: 'Returns block header information by number (same as eth_getBlockByNumber without transactions and uncles)',
|
||||||
|
params: [
|
||||||
|
{
|
||||||
|
type: BlockNumber,
|
||||||
|
desc: 'integer of a block number, or the string `\'earliest\'`, `\'latest\'` or `\'pending\'`, as in the [default block parameter](#the-default-block-parameter).',
|
||||||
|
example: fromDecimal(436)
|
||||||
|
}
|
||||||
|
],
|
||||||
|
returns: 'See [eth_getBlockByHash](#eth_getblockbyhash) (without transactions and uncles)'
|
||||||
|
},
|
||||||
|
|
||||||
getVaultMeta: {
|
getVaultMeta: {
|
||||||
section: SECTION_VAULT,
|
section: SECTION_VAULT,
|
||||||
desc: 'Returns the metadata for a specific vault',
|
desc: 'Returns the metadata for a specific vault',
|
||||||
|
@ -138,8 +138,8 @@ export default class Status {
|
|||||||
|
|
||||||
this._store.dispatch(statusBlockNumber(blockNumber));
|
this._store.dispatch(statusBlockNumber(blockNumber));
|
||||||
|
|
||||||
this._api.eth
|
this._api.parity
|
||||||
.getBlockByNumber(blockNumber)
|
.getBlockHeaderByNumber(blockNumber)
|
||||||
.then((block) => {
|
.then((block) => {
|
||||||
if (!block) {
|
if (!block) {
|
||||||
return;
|
return;
|
||||||
@ -151,7 +151,7 @@ export default class Status {
|
|||||||
}));
|
}));
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.warn('status._subscribeBlockNumber', 'getBlockByNumber', error);
|
console.warn('status._subscribeBlockNumber', 'getBlockHeaderByNumber', error);
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.then((blockNumberSubscriptionId) => {
|
.then((blockNumberSubscriptionId) => {
|
||||||
|
@ -70,32 +70,37 @@ export default class Store {
|
|||||||
}
|
}
|
||||||
|
|
||||||
loadTransactions (_txhashes) {
|
loadTransactions (_txhashes) {
|
||||||
const { eth } = this._api;
|
|
||||||
|
|
||||||
// Ignore special cases and if the contents of _txhashes && this.sortedHashes are the same
|
// Ignore special cases and if the contents of _txhashes && this.sortedHashes are the same
|
||||||
if (Array.isArray(_txhashes) || this.sameHashList(_txhashes)) {
|
if (Array.isArray(_txhashes) || this.sameHashList(_txhashes)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove any tx that are edited/cancelled
|
// Remove any tx that are edited/cancelled
|
||||||
this.sortedHashes
|
this.sortedHashes.forEach((hash) => {
|
||||||
.forEach((hash) => {
|
|
||||||
if (!_txhashes.includes(hash)) {
|
if (!_txhashes.includes(hash)) {
|
||||||
this.removeHash(hash);
|
this.removeHash(hash);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Add any new tx
|
// Add any new tx
|
||||||
_txhashes
|
_txhashes.forEach((txhash) => {
|
||||||
.forEach((txhash) => {
|
if (this.sortedHashes.includes(txhash)) {
|
||||||
if (this.sortedHashes.includes(txhash)) { return; }
|
return;
|
||||||
eth.getTransactionByHash(txhash)
|
}
|
||||||
|
|
||||||
|
this._api.eth
|
||||||
|
.getTransactionByHash(txhash)
|
||||||
.then((tx) => {
|
.then((tx) => {
|
||||||
if (!tx) { return; }
|
if (!tx) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this.transactions[txhash] = tx;
|
this.transactions[txhash] = tx;
|
||||||
|
|
||||||
// If the tx has a blockHash, let's get the blockNumber, otherwise it's ready to be added
|
// If the tx has a blockHash, let's get the blockNumber, otherwise it's ready to be added
|
||||||
if (tx.blockHash) {
|
if (tx.blockHash) {
|
||||||
eth.getBlockByNumber(tx.blockNumber)
|
this._api.parity
|
||||||
|
.getBlockHeaderByNumber(tx.blockNumber)
|
||||||
.then((block) => {
|
.then((block) => {
|
||||||
this.blocks[tx.blockNumber] = block;
|
this.blocks[tx.blockNumber] = block;
|
||||||
this.addHash(txhash);
|
this.addHash(txhash);
|
||||||
@ -108,10 +113,9 @@ export default class Store {
|
|||||||
}
|
}
|
||||||
|
|
||||||
cancelTransaction = (txComponent, tx) => {
|
cancelTransaction = (txComponent, tx) => {
|
||||||
const { parity } = this._api;
|
|
||||||
const { hash } = tx;
|
const { hash } = tx;
|
||||||
|
|
||||||
parity
|
this._api.parity
|
||||||
.removeTransaction(hash)
|
.removeTransaction(hash)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
txComponent.setState({ canceled: true });
|
txComponent.setState({ canceled: true });
|
||||||
@ -122,13 +126,12 @@ export default class Store {
|
|||||||
}
|
}
|
||||||
|
|
||||||
editTransaction = (txComponent, tx) => {
|
editTransaction = (txComponent, tx) => {
|
||||||
const { parity } = this._api;
|
|
||||||
const { hash, gas, gasPrice, to, from, value, input, condition } = tx;
|
const { hash, gas, gasPrice, to, from, value, input, condition } = tx;
|
||||||
|
|
||||||
parity
|
this._api.parity
|
||||||
.removeTransaction(hash)
|
.removeTransaction(hash)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
parity.postTransaction({
|
return this._api.parity.postTransaction({
|
||||||
from,
|
from,
|
||||||
to,
|
to,
|
||||||
gas,
|
gas,
|
||||||
|
@ -146,7 +146,7 @@ export default class Event extends Component {
|
|||||||
|
|
||||||
Promise
|
Promise
|
||||||
.all([
|
.all([
|
||||||
api.eth.getBlockByNumber(event.blockNumber),
|
api.parity.getBlockHeaderByNumber(event.blockNumber),
|
||||||
api.eth.getTransactionByHash(event.transactionHash)
|
api.eth.getTransactionByHash(event.transactionHash)
|
||||||
])
|
])
|
||||||
.then(([block, transaction]) => {
|
.then(([block, transaction]) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user