Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mvandeberg committed Dec 19, 2019
1 parent ae95066 commit 3d672a2
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ export class Client {
*/
public readonly addressPrefix: string

private seqNo: number = 0
private timeout: number
private backoff: typeof defaultBackoff

Expand Down Expand Up @@ -238,7 +239,7 @@ export class Client {
*/
public async call(api: string, method: string, params: any = []): Promise<any> {
const request: RPCCall = {
id: '0',
id: ++this.seqNo,
jsonrpc: '2.0',
method: 'call',
params: [api, method, params],
Expand Down
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import {EventEmitter} from 'events'
import {PassThrough} from 'stream'
import {VError} from 'verror'

const fetch = global['fetch'] // tslint:disable-line:no-string-literal
const fetch = require( 'node-fetch' ) // tslint:disable-line:no-string-literal

/**
* Return a promise that will resove when a specific event is emitted.
Expand Down
4 changes: 2 additions & 2 deletions test/blockchain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ describe('blockchain', function() {

const client = new Client(TEST_NODE, {agent})

const expectedIds = ['000000016187f2f76ad132a7bc1dbf2ed27d7fe1',
'0000000212e6201f1f51fb04784a30e3aff7a2f4'];
const expectedIds = ['0000000109833ce528d5bbfb3f6225b39ee10086',
'00000002ed04e3c3def0238f693931ee7eebbdf1'];
const expectedOps = ['vote', 'vote', 'comment', 'vote', 'vote', 'vote', 'vote',
'custom_json', 'producer_reward', 'author_reward', 'fill_vesting_withdraw',
'fill_vesting_withdraw', 'comment', 'comment', 'vote', 'vote',
Expand Down
2 changes: 1 addition & 1 deletion test/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ describe('database api', function() {
await client.database.verifyAuthority(client.broadcast.sign(tx, bogusKey))
assert(false, 'should not be reached')
} catch (error) {
assert.equal(error.message, `Missing Posting Authority ${ acc.username }`)
assert(error.message.startsWith(`Missing Posting Authority ${ acc.username }`))
}
})

Expand Down
5 changes: 4 additions & 1 deletion test/rc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ describe('rc_api', function () {
},
vesting_shares: '80241942 VESTS',
delegated_vesting_shares: '60666472 VESTS',
received_vesting_shares: '191002659 VESTS'
received_vesting_shares: '191002659 VESTS',
vesting_withdraw_rate: '0 VESTS',
to_withdraw: 0,
withdrawn: 0
}

let bar = client.rc.calculateVPMana(account)
Expand Down

0 comments on commit 3d672a2

Please sign in to comment.