Added test case for null from and blockTag to contract populateTransaction (#860).

This commit is contained in:
Richard Moore 2020-06-03 03:35:24 -04:00
parent d2ca4fb443
commit d2406c42a1
No known key found for this signature in database
GPG Key ID: 665176BE8E9DC651
1 changed files with 14 additions and 0 deletions

View File

@ -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");
});
});
/*