Skip to content

Problem: missing property-base testing (fix #857)#862

Open
leejw51crypto wants to merge 4 commits into
crypto-com:devfrom
leejw51crypto:feature/857
Open

Problem: missing property-base testing (fix #857)#862
leejw51crypto wants to merge 4 commits into
crypto-com:devfrom
leejw51crypto:feature/857

Conversation

@leejw51crypto
Copy link
Copy Markdown
Contributor

add fast-check testing

import sdk from '@crypto-org-chain/chain-jslib';
import { Units, Secp256k1KeyPair } from '../../utils/ChainJsLib';

test('should declare coin in ledger correctly', () => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the property here? cro.Coin not throwing an exception?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whether coin can be created to the maximum, that will not throw any exception

},
phrase,
);
expect(transferTxSignedHex !== '').to.eq(true);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could also check transferTxSignedHex can be parsed into a transaction?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

package.json

@crypto-matto
Copy link
Copy Markdown
Contributor

There are also some eslint error in CI to be fixed as well

 src/service/signers/LedgerSigner.spec.ts:2:10
  ✖   2:10  expect is defined but never used.               @typescript-eslint/no-unused-vars
  ✖   4:10  Big is defined but never used.                  @typescript-eslint/no-unused-vars
  ✖   7:17  Secp256k1KeyPair is defined but never used.     @typescript-eslint/no-unused-vars
  ✖  13:15  networkFee is assigned a value but never used.  @typescript-eslint/no-unused-vars
  ✖  15:13  fee is assigned a value but never used.         @typescript-eslint/no-unused-vars

  src/service/signers/TransactionSigner.spec.ts:4:10
  ✖   4:10  Big is defined but never used.                  @typescript-eslint/no-unused-vars

@leejw51crypto
Copy link
Copy Markdown
Contributor Author

fixing lint issue

@leejw51crypto leejw51crypto force-pushed the feature/857 branch 2 times, most recently from 9f199ae to 5c6a7fb Compare December 9, 2021 11:25
crypto-matto and others added 3 commits December 9, 2021 22:03
add fast-check testing

add tx rlp decoding

tidy up

fix lint and tidy up

fix lint

remove else
Copy link
Copy Markdown

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

checked

);
const decodedTransaction = RLP.decode(transferTxSignedHex);
expect(transferTxSignedHex !== '').to.eq(true);
expect(BigInt(decodedTransaction[4]) === amount).to.eq(true);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • [ ]

},
phrase,
);
expect(transferTxSignedHex !== '').to.eq(true);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

package.json

},
phrase,
);
const decodedTransaction = RLP.decode(transferTxSignedHex);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • [ ]

phrase,
);
const decodedTransaction = RLP.decode(transferTxSignedHex);
expect(transferTxSignedHex !== '').to.eq(true);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • (True)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants