Skip to content

Commit

Permalink
Trying to figure out what I broke in the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Bellamy committed Feb 7, 2023
1 parent 6595c72 commit 48e91ae
Showing 1 changed file with 7 additions and 16 deletions.
23 changes: 7 additions & 16 deletions test/unit/strkey_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -395,24 +395,15 @@ describe('StrKey', function() {
});

describe('#contracts', function() {
const HAPPY_PATHS = [
{
desc: 'valid w/ 32-byte payload',
strkey: 'CA3D5KRYM6CB7OWQ6TWYRR3Z4T7GNZLKERYNZGGA5SOAOPIFY6YQGAXE',
payload:
'363eaa3867841fbad0f4ed88c779e4fe66e56a2470dc98c0ec9c073d05c7b103'
}
];
it('valid w/ 32-byte payload', function() {
const strkey = 'CA3D5KRYM6CB7OWQ6TWYRR3Z4T7GNZLKERYNZGGA5SOAOPIFY6YQGAXE';
const buf = StellarBase.StrKey.decodeContract(strkey);

HAPPY_PATHS.forEach((testCase) => {
it(testCase.desc, function() {
const buf = StellarBase.StrKey.decodeContract(testCase.strkey);

expect(buf.toString('hex')).to.equal(testCase.payload);
expect(buf.toString('hex')).to.equal(
'363eaa3867841fbad0f4ed88c779e4fe66e56a2470dc98c0ec9c073d05c7b103'
);

const str = StellarBase.StrKey.encodeContract(buf);
expect(str).to.equal(testCase.strkey);
});
expect(StellarBase.StrKey.encodeContract(buf)).to.equal(strkey);
});

describe('isValid', function() {
Expand Down

0 comments on commit 48e91ae

Please sign in to comment.