Skip to content

Commit

Permalink
refactor!: remove deprecated topBlock
Browse files Browse the repository at this point in the history
  • Loading branch information
davidyuk committed Jan 28, 2022
1 parent 509cdf2 commit 4535c07
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 16 deletions.
1 change: 0 additions & 1 deletion src/chain/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ const Chain = stampit({
sendTransaction: required,
height: required,
awaitHeight: required,
topBlock: required,
poll: required,
balance: required,
getBalance: required,
Expand Down
8 changes: 0 additions & 8 deletions src/chain/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,6 @@ async function awaitHeight (
throw new RequestTimedOutError((attempts - 1) * interval, currentHeight, height)
}

/**
* @deprecated
*/
async function topBlock () {
return this.api.getTopHeader()
}

async function poll (th, { blocks = 10, interval = this._getPollInterval('microblock') } = {}) {
const max = await this.height() + blocks
do {
Expand Down Expand Up @@ -301,7 +294,6 @@ const ChainNode = Chain.compose(NodePool, {
balance,
getBalance,
getAccount,
topBlock,
tx,
height,
awaitHeight,
Expand Down
6 changes: 0 additions & 6 deletions test/integration/chain.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,6 @@ describe('Node Chain', function () {
expect(await error.verifyTx()).to.have.lengthOf(1)
})

it('Get top block', async () => {
const top = await sdk.topBlock()
top.should.has.property('hash')
top.should.has.property('height')
})

it('Get pending transaction', async () => {
const mempool = await sdk.mempool()
mempool.should.has.property('transactions')
Expand Down
2 changes: 1 addition & 1 deletion test/integration/contract.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ describe('Contract', function () {
})

it('Call-Static deploy transaction on specific hash', async () => {
const { hash } = await sdk.topBlock()
const { hash } = await sdk.api.getTopHeader()
const compiled = bytecode.bytecode
const res = await sdk.contractCallStatic(identityContract, null, 'init', [], { bytecode: compiled, top: hash })
res.result.should.have.property('gasUsed')
Expand Down

0 comments on commit 4535c07

Please sign in to comment.