Skip to content

Commit

Permalink
fixes after review
Browse files Browse the repository at this point in the history
  • Loading branch information
popenta committed Oct 26, 2023
1 parent 8951aea commit 167c620
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe("test transfer transcations factory", function () {
const alice = Address.fromBech32("erd1qyu5wthldzr8wx5c9ucg8kjagg0jfs53s8nr3zpz3hypefsdd8ssycr6th");
const bob = Address.fromBech32("erd1spyavw0956vq68xj8y4tenjpq2wd5a9p2c6j8gsz7ztyrnpxrruqzu66jx");

it.only("should throw error, no token transfer provided", async () => {
it("should throw error, no token transfer provided", async () => {
let transfers: any = [];

assert.throw(
Expand Down
6 changes: 4 additions & 2 deletions src/transactionsFactories/transferTransactionsFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,11 @@ export class TransferTransactionsFactory {
let extraGasForTransfer = new BigNumber(0);
const tokenComputer = new TokenComputer();

if (numberOfTransfers == 0) {
if (numberOfTransfers === 0) {
throw new ErrBadUsage("No token transfer has been provided");
} else if (numberOfTransfers == 1) {
}

if (numberOfTransfers === 1) {
const transfer = options.tokenTransfers[0];

if (tokenComputer.isFungible(transfer.token)) {
Expand Down

0 comments on commit 167c620

Please sign in to comment.