return response.response.directives; }); return expect(subject).to.eventually.contain(customDirective); });
describe("RaiClient.account_key()", done => { it("should retrieve the public key for an account", () => { expect(client.account_key(WALLET_ADDRESS)).to.eventually.contain('"key"'); }); });
it("should retrieve account informations WITHOUT arguments", () => { expect(client.account_info(WALLET_ADDRESS)) .to.eventually.contain('"frontier"') .and.to.eventually.contain('"open_block"') .and.to.eventually.contain('"representative_block"') .and.to.eventually.contain('"balance"') .and.to.eventually.contain('"modified_timestamp"') .and.to.eventually.contain('"block_count"'); });
it("should retrieve account informations WITH all arguments to true", () => { expect(client.account_info(WALLET_ADDRESS, true, true, true)) .to.eventually.contain('"frontier"') .and.to.eventually.contain('"open_block"') .and.to.eventually.contain('"representative_block"') .and.to.eventually.contain('"balance"') .and.to.eventually.contain('"modified_timestamp"') .and.to.eventually.contain('"block_count"') .and.to.eventually.contain('"representative"') .and.to.eventually.contain('"weight"') .and.to.eventually.contain('"pending"') .notify(done); });
describe("RaiClient.chain()", done => { it("should retrieves a list of block hashes in the account chain", () => { expect(client.chain(SINGLE_BLOCK_HASH)).to.eventually.contain('"blocks"'); }); it("should retrieves a list of block hashes in the account chain starting at block up to count", () => { expect(client.chain(SINGLE_BLOCK_HASH, 2)).to.eventually.contain( '"blocks"' ); }); });
describe("RaiClient.account_block_count()", done => { it("should retrieve account block count", () => { expect(client.account_block_count(WALLET_ADDRESS)) .to.eventually.contain('"block_count"') .notify(done); }); });
it("should retrieve account informations WITH representative", () => { expect(client.account_info(WALLET_ADDRESS, true)) .to.eventually.contain('"frontier"') .and.to.eventually.contain('"open_block"') .and.to.eventually.contain('"representative_block"') .and.to.eventually.contain('"balance"') .and.to.eventually.contain('"modified_timestamp"') .and.to.eventually.contain('"block_count"') .and.to.eventually.contain('"representative"') .notify(done); });
describe("RaiClient.history()", done => { it("should the number of accounts in the ledger", () => { expect(client.history(SINGLE_BLOCK_HASH)).to.eventually.contain( '"history"' ); }); it("should the number of accounts in the ledger WITH count", () => { expect(client.history(SINGLE_BLOCK_HASH, 2)).to.eventually.contain( '"history"' ); }); });
describe("RaiClient.account_remove()", done => { it("should remove an account from the wallet", () => { expect( client.account_remove("myXRBWallet", WALLET_ADDRESS) ).to.eventually.contain('"removed"'); }); });
describe("RaiClient.accounts_create()", done => { it("should creates new accounts in wallet up to count WITHOUT work generation", () => { expect( client.accounts_create([WALLET_ADDRESS, "myOtherAccountAddress"]) ).to.eventually.contain('"balances"'); }); it("should creates new accounts in wallet up to count WITH work generation", () => { expect( client.accounts_create([WALLET_ADDRESS, "myOtherAccountAddress"], true) ).to.eventually.contain('"balances"'); }); });
describe("RaiClient.block()", done => { it("should retrieves a block", () => { expect(client.block(SINGLE_BLOCK_HASH)).to.eventually.contain('"contents"'); }); });
describe("RaiClient.frontiers_count()", done => { it("should the number of accounts in the ledger", () => { expect(client.frontiers_count()).to.eventually.contain('"count"'); }); });
describe("RaiClient.account_representative()", done => { it("should retrieve the representative for an account", () => { expect(client.account_representative(WALLET_ADDRESS)).to.eventually.contain( '"representative"' ); }); });
describe("RaiClient.accounts_balances()", done => { it("should retrieve the balances for a list of accounts", () => { expect( client.accounts_balances([WALLET_ADDRESS, "myOtherAccountAddress"]) ).to.eventually.contain('"balances"'); }); });