Skip to content

Commit 2a7af85

Browse files
Merge branch 'develop' into refactor/crypto-block/remove-amount
2 parents bbf39db + 21b321c commit 2a7af85

40 files changed

Lines changed: 67 additions & 92 deletions

File tree

packages/api-development/source/controllers/node.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export class NodeController extends Controller {
3030

3131
return {
3232
data: {
33-
constants: this.configuration.getMilestone(this.stateStore.getHeight()),
33+
constants: this.configuration.getMilestone(this.stateStore.getBlockNumber()),
3434
core: {
3535
version: this.app.version(),
3636
},

packages/api-development/source/controllers/round.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ export class RoundController extends Controller {
2323
(_, index) => roundValidators[this.proposerCalculator.getValidatorIndex(index)],
2424
);
2525

26-
const height = this.stateStore.getHeight();
26+
const blockNumber = this.stateStore.getBlockNumber();
2727

2828
return {
29-
height,
30-
...this.roundCalculator.calculateRound(height),
29+
blockNumber,
30+
...this.roundCalculator.calculateRound(blockNumber),
3131
// Map the round validator set (static, vote-weighted, etc.) to actual proposal order
3232
validators: orderedValidators.map((validator) => ({
3333
// rank: validator.getVoteBalance().toFixed(),

packages/api-evm/source/actions/eth-block-number.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ describe<{
1414

1515
beforeEach(async (context) => {
1616
context.store = {
17-
getHeight() {
17+
getBlockNumber() {
1818
return height;
1919
},
2020
};

packages/api-evm/source/actions/eth-block-number.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ export class EthBlockNumberAction implements Contracts.Api.RPC.Action {
1515
};
1616

1717
public async handle(parameters: []): Promise<string> {
18-
return `0x${this.stateStore.getHeight().toString(16)}`;
18+
return `0x${this.stateStore.getBlockNumber().toString(16)}`;
1919
}
2020
}

packages/api-evm/source/actions/eth-get-uncle-by-block-number-and-index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export class EthGetUncleByBlockNumberAndIndex implements Contracts.Api.RPC.Actio
1818
};
1919

2020
public async handle(parameters: [string]): Promise<null> {
21-
if (this.stateStore.getHeight() < Number(parameters[0])) {
21+
if (this.stateStore.getBlockNumber() < Number(parameters[0])) {
2222
throw new Exceptions.RpcError("Block not found");
2323
}
2424

packages/api-evm/source/actions/eth-get-uncle-count-by-block-number.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export class EthGetUncleCountByBlockNumber implements Contracts.Api.RPC.Action {
1818
};
1919

2020
public async handle(parameters: [string]): Promise<string> {
21-
if (this.stateStore.getHeight() < Number(parameters[0])) {
21+
if (this.stateStore.getBlockNumber() < Number(parameters[0])) {
2222
throw new Exceptions.RpcError("Block not found");
2323
}
2424

packages/api-evm/source/utils/resolve-block-tag.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export const resolveBlockTag = async (
1212
case "finalized":
1313
case "latest":
1414
case "safe": {
15-
return stateStore.getHeight();
15+
return stateStore.getBlockNumber();
1616
}
1717
default: {
1818
throw new Error("invalid blockTag:" + tag);

packages/api-evm/source/validation/keywords.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { FuncKeywordDefinition } from "ajv";
33

44
export const makeKeywords = (stateStore: Contracts.State.Store) => {
55
const currentHeight: FuncKeywordDefinition = {
6-
compile: (schema) => (data) => Number(data) === stateStore.getHeight(),
6+
compile: (schema) => (data) => Number(data) === stateStore.getBlockNumber(),
77
errors: false,
88
keyword: "currentHeightHex",
99
metaSchema: {

packages/api-http/test/fixtures/node_configuration.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
"block": {
44
"version": 1,
55
"maxPayload": 2097152,
6-
"maxGasLimit": 10000000,
7-
"maxTransactions": 150
6+
"maxGasLimit": 10000000
87
},
98
"epoch": "2024-05-31T00:00:00.000Z",
109
"evmSpec": "Shanghai",

packages/api-transaction-pool/source/controllers/configuration.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ export class ConfigurationController extends AbstractController {
1616
public async configuration(request: Hapi.Request) {
1717
return {
1818
data: {
19+
blockNumber: this.stateStore.getBlockNumber(),
1920
core: {
2021
version: this.app.version(),
2122
},
22-
height: this.stateStore.getHeight(),
2323
transactionPool: {
2424
maxTransactionAge: this.pluginConfiguration.get("maxTransactionAge"),
2525
maxTransactionBytes: this.pluginConfiguration.get("maxTransactionBytes"),

0 commit comments

Comments
 (0)