Skip to content

Commit

Permalink
fix: token issuance with 0 decimals works now
Browse files Browse the repository at this point in the history
  • Loading branch information
ohager committed Sep 28, 2023
1 parent 488f999 commit dd69d32
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,29 @@ describe('verifyTransaction', function () {
verifyTransaction(requestType, formData, testResponse);
}).not.toThrow();
});
it('should pass verification as expected - with zero decimals', () => {
const requestType = 'issueAsset';
const formData = {
name: 'ZERODEC',
description: 'Non fractional test token',
quantityQNT: '100',
decimals: '0',
mintable: 'true',
feeNQT: '15000000000',
publicKey: 'c213e4144ba84af94aae2458308fae1f0cb083870c8f3012eea58147f3b09d4a',
deadline: 1440
};

const testResponse = {
'broadcasted': false,
'unsignedTransactionBytes': '02209c392d11a005c213e4144ba84af94aae2458308fae1f0cb083870c8f3012eea58147f3b09d4a0000000000000000000000000000000000d6117e0300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000271409005d41bec0f8ba17a304cfe1531b543c7c02075a45524f44454319004e6f6e206672616374696f6e616c207465737420746f6b656e64000000000000000001',
'transactionJSON': {},
'requestProcessingTime': 8
};
expect(() => {
verifyTransaction(requestType, formData, testResponse);
}).not.toThrow();
});
});
describe('sendMessage', function () {
it('should pass verification as expected - for encrypted messages', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ function processSpecialCases(requestType: string, rebuiltData: any) {
} else {
rebuiltData.mintable = 'false';
}
if(!rebuiltData.decimals) {
rebuiltData.decimals = '0';
}
break;
case 'createATProgram':
delete rebuiltData.creationBytes;
Expand Down

0 comments on commit dd69d32

Please sign in to comment.