Skip to content

Commit

Permalink
per pr review
Browse files Browse the repository at this point in the history
  • Loading branch information
ahangsu committed Aug 25, 2022
1 parent 35ee2ad commit fb79379
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
4 changes: 1 addition & 3 deletions src/logic/logic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,6 @@ function readPushByteOp(
* check if passed in bytes are Algorand address or is B64 encoded, rather than Teal bytes
*
* @param program - Program bytes to check
* @throws
* @returns
*/
export function sanityCheckProgram(program: Uint8Array) {
if (!program || program.length === 0) throw new Error('empty program');
Expand All @@ -180,7 +178,7 @@ export function sanityCheckProgram(program: Uint8Array) {
);

if (isAsciiPrintable) {
const programStr = Buffer.from(program.buffer).toString();
const programStr = Buffer.from(program).toString();

if (isValidAddress(programStr))
throw new Error('requesting program bytes, get Algorand address');
Expand Down
5 changes: 2 additions & 3 deletions tests/cucumber/steps/steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -4475,9 +4475,8 @@ module.exports = function getSteps(options) {
Then(
'if the heuristic sanity check throws an error, the error contains {string}',
async function (errMsg) {
if (errMsg !== '')
assert.strictEqual(this.actualErrMsg.includes(errMsg), true);
else assert.strictEqual(this.actualErrMsg === undefined, true);
if (errMsg !== '') assert.ok(this.actualErrMsg.includes(errMsg));
else assert.ok(this.actualErrMsg === undefined);
}
);

Expand Down

0 comments on commit fb79379

Please sign in to comment.