Skip to content

Commit d3111d7

Browse files
Seulgi Kimsgkim126
authored andcommitted
Make Block in RPC use PlatformAddress
1 parent 397b6e1 commit d3111d7

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/core/Block.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { H160 } from "./H160";
1+
import { PlatformAddress } from "../key/PlatformAddress";
22
import { H256 } from "./H256";
33
import { U256 } from "./U256";
44
import { SignedParcel } from "./SignedParcel";
@@ -7,7 +7,7 @@ export type BlockData = {
77
parentHash: H256;
88
timestamp: number;
99
number: number;
10-
author: H160;
10+
author: PlatformAddress;
1111
extraData: Buffer;
1212
parcelsRoot: H256;
1313
stateRoot: H256;
@@ -24,7 +24,7 @@ export class Block {
2424
parentHash: H256;
2525
timestamp: number;
2626
number: number;
27-
author: H160;
27+
author: PlatformAddress;
2828
extraData: Buffer;
2929
parcelsRoot: H256;
3030
stateRoot: H256;
@@ -58,7 +58,7 @@ export class Block {
5858
parentHash: new H256(parentHash),
5959
timestamp,
6060
number,
61-
author: new H160(author),
61+
author: PlatformAddress.fromString(author),
6262
extraData,
6363
parcelsRoot: new H256(parcelsRoot),
6464
stateRoot: new H256(stateRoot),
@@ -77,7 +77,7 @@ export class Block {
7777
parentHash: parentHash.value,
7878
timestamp,
7979
number,
80-
author: author.value,
80+
author: author.toString(),
8181
extraData,
8282
parcelsRoot: parcelsRoot.value,
8383
stateRoot: stateRoot.value,

src/core/__test__/Block.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ test("toJSON", () => {
1717
parentHash: new H256("0000000000000000000000000000000000000000000000000000000000000000"),
1818
timestamp: 1,
1919
number: 2,
20-
author: PlatformAddress.fromAccountId("1111111111111111111111111111111111111111").getAccountId(),
20+
author: PlatformAddress.fromAccountId("1111111111111111111111111111111111111111"),
2121
extraData: Buffer.from([]),
2222
parcelsRoot: new H256("1111111111111111111111111111111111111111111111111111111111111111"),
2323
stateRoot: new H256("2222222222222222222222222222222222222222222222222222222222222222"),

0 commit comments

Comments
 (0)