Small fixes in operation (#200)
* Small fixes in operation * Move length encoding to Extrinsic
This commit is contained in:
@@ -52,7 +52,7 @@ export default class ApiBase {
|
||||
try {
|
||||
const meta = await this._api.state.getMetadata().toPromise();
|
||||
|
||||
this._genesisHash = await this._api.state.getBlockHash(0).toPromise();
|
||||
this._genesisHash = await this._api.chain.getBlockHash(0).toPromise();
|
||||
ApiBase.extrinsics = extrinsicsFromMeta(meta);
|
||||
ApiBase.storage = storageFromMeta(meta);
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the ISC license. See the LICENSE file for details.
|
||||
|
||||
import u8aToHex from '@polkadot/util/u8a/toHex';
|
||||
import blake2Asu8a from '@polkadot/util-crypto/blake2/asU8a';
|
||||
|
||||
import Bytes from './Bytes';
|
||||
@@ -18,4 +19,12 @@ export default class Extrinsic extends Bytes {
|
||||
blake2Asu8a(this.toU8a(), 256)
|
||||
);
|
||||
}
|
||||
|
||||
toHex (): string {
|
||||
return u8aToHex(this.toU8a());
|
||||
}
|
||||
|
||||
toJSON (): any {
|
||||
return this.toHex();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user