Skip to content

Commit

Permalink
Added test case for null from and blockTag to contract populateTransa…
Browse files Browse the repository at this point in the history
…ction (#860).
  • Loading branch information
ricmoo committed Jun 3, 2020
1 parent d2ca4fb commit d2406c4
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions packages/tests/src.ts/test-contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,20 @@ describe("Test Contract Transaction Population", function() {
assert.ok(error.operation === "overrides.from");
}
});

it("allows overriding with invalid, but nullish values", async function() {
const contractSigner = contract.connect(testAddress);
const tx = await contractSigner.populateTransaction.unstake({
blockTag: null,
from: null
});
//console.log("Tx", tx);
assert.equal(Object.keys(tx).length, 3, "correct number of keys");
assert.equal(tx.data, "0x2def6620", "data matches");
assert.equal(tx.to, testAddressCheck, "to address matches");
assert.equal(tx.from, testAddressCheck.toLowerCase(), "from address matches");
});

});

/*
Expand Down

0 comments on commit d2406c4

Please sign in to comment.