Skip to content

Argument order of BlockchainStorageInfo constructor is shifted #29

@planethouki

Description

@planethouki

1. Expected behavior and actual behavior.

BlockchainStorageInfo obtained by blockchainHttp.getDiagnosticStorage() has invalid key-value pair.

numAccounts shows number of blocks
numBlocks shows number of transactions
numTransactions shows number of accounts

Expected behavior

BlockchainStorageInfo { 
	numBlocks: 89263, 
	numTransactions: 444, 
	numAccounts: 81 
}

Actual behavior

BlockchainStorageInfo { 
	numAccounts: 89263, 
	numBlocks: 444, 
	numTransactions: 81 
}

To compare, rest api of /diagnostic/storage returns

{
	"numBlocks": 89263,
	"numTransactions": 444,
	"numAccounts": 81
}

2. Steps to reproduce the problem.

Run this code.

const nem2Sdk = require("nem2-sdk");
const BlockchainHttp = nem2Sdk.BlockchainHttp;
const host = <something host>;
const blockchainHttp = new BlockchainHttp(host);
blockchainHttp.getDiagnosticStorage().subscribe(
    x => console.log(x)
);

3. Specifications like the version of the project, operating system, or hardware.

node: v10.11.0
nem2-sdk: 0.10.1
rest-gateway is docker image: techbureau/catapult-rest-server:1.0.7
catapult node is docker image: techbureau/catapult-server:gcc-0.1.0.2

4. More information

https://github.com/nemtech/nem2-sdk-typescript-javascript/blob/master/src/model/blockchain/BlockchainStorageInfo.ts

constructor(
	public readonly numAccounts: number,
	public readonly numBlocks: number,
	public readonly numTransactions: number) {
}

is should be

constructor(
	public readonly numBlocks: number,
	public readonly numTransactions: number,
	public readonly numAccounts: number) {
}

and also test

https://github.com/nemtech/nem2-sdk-typescript-javascript/blob/master/test/model/blockchain/BlockchainStorageInfo.spec.ts

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions