From d2406c42a18c123205918eb46bf24de0ff97ee23 Mon Sep 17 00:00:00 2001 From: Richard Moore Date: Wed, 3 Jun 2020 03:35:24 -0400 Subject: [PATCH] Added test case for null from and blockTag to contract populateTransaction (#860). --- packages/tests/src.ts/test-contract.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/packages/tests/src.ts/test-contract.ts b/packages/tests/src.ts/test-contract.ts index a5470b808..80289f490 100644 --- a/packages/tests/src.ts/test-contract.ts +++ b/packages/tests/src.ts/test-contract.ts @@ -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"); + }); + }); /*