Skip to content

Commit

Permalink
fix: format
Browse files Browse the repository at this point in the history
  • Loading branch information
will-break-it committed May 2, 2023
1 parent c0f480f commit 15421a6
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 16 deletions.
4 changes: 3 additions & 1 deletion src/__tests__/minswap/datums/order-datum.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ describe('order datum module', () => {
try {
MinswapOrderDatumBuilder.new().build();
throw new Error('Expected field is missing value error');
} catch (e) {}
} catch (e) {
/** expected */
}
});

test('encode order datum for swap exact in', () => {
Expand Down
4 changes: 3 additions & 1 deletion src/__tests__/muesliswap/datums/order-datum.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ describe('muesliswap order datum module', () => {
try {
MuesliswapOrderDatumBuilder.new().build();
throw new Error('Expected field is missing value error');
} catch (e) {}
} catch (e) {
/** expected */
}
});

// https://cardanoscan.io/transaction/1dd87e1097fb609e404d6b62521790931957fb81695bc2b75a5ecf266da482d4?tab=utxo
Expand Down
16 changes: 8 additions & 8 deletions src/__tests__/utils/address.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,31 @@ import { EncodableAddressBuilder as AddressBuilder, AddressDecoder } from '../..
describe('address module', () => {
test('encode & decode testnet address with payment credential', () => {
const expected = 'addr_test1vz3ppzmmzuz0nlsjeyrqjm4pvdxl3cyfe8x06eg6htj2gwgv02qjt';
const addr_pd_datum = AddressBuilder.new().bech32Address(expected).build().encode().to_hex();
const address = new AddressDecoder('Testnet').decode(addr_pd_datum);
const addrPdDatum = AddressBuilder.new().bech32Address(expected).build().encode().to_hex();
const address = new AddressDecoder('Testnet').decode(addrPdDatum);
expect(address.to_bech32()).toBe(expected);
});

test('encode & decode testnet address with payment & staking credential', () => {
const expected =
'addr_test1qrqcwuw9ju33z2l0zayt38wsthsldyrgyt82p2p3trccucffejwnp8afwa8v58aw7dpj7hpf9dh8txr0qlksqtcsxheqhekxra';
const addr_pd_datum = AddressBuilder.new().bech32Address(expected).build().encode().to_hex();
const address = new AddressDecoder('Testnet').decode(addr_pd_datum);
const addrPdDatum = AddressBuilder.new().bech32Address(expected).build().encode().to_hex();
const address = new AddressDecoder('Testnet').decode(addrPdDatum);
expect(address.to_bech32()).toBe(expected);
});

test('encode & decode mainnet address with payment credential', () => {
const expected = 'addr1vx3ppzmmzuz0nlsjeyrqjm4pvdxl3cyfe8x06eg6htj2gwgh87uaw';
const addr_pd_datum = AddressBuilder.new().bech32Address(expected).build().encode().to_hex();
const address = new AddressDecoder('Mainnet').decode(addr_pd_datum);
const addrPdDatum = AddressBuilder.new().bech32Address(expected).build().encode().to_hex();
const address = new AddressDecoder('Mainnet').decode(addrPdDatum);
expect(address.to_bech32()).toBe(expected);
});

test('encode & decode mainnet address with payment & staking credential', () => {
const expected =
'addr1q8qcwuw9ju33z2l0zayt38wsthsldyrgyt82p2p3trccucffejwnp8afwa8v58aw7dpj7hpf9dh8txr0qlksqtcsxheq50tx0z';
const addr_pd_datum = AddressBuilder.new().bech32Address(expected).build().encode().to_hex();
const address = new AddressDecoder('Mainnet').decode(addr_pd_datum);
const addrPdDatum = AddressBuilder.new().bech32Address(expected).build().encode().to_hex();
const address = new AddressDecoder('Mainnet').decode(addrPdDatum);
expect(address.to_bech32()).toBe(expected);
});

Expand Down
10 changes: 5 additions & 5 deletions src/__tests__/utils/assetclass.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ describe('assetclass builder module', () => {
});

test('test assetclass native asset builder', () => {
const minswap_cs = '29d222ce763455e3d7a09a665ce554f00ac89d2e99a1a83d267170c6';
const minswap_tkn = '4d494e';
const min = AssetClassBuilder.new().currencySymbol(minswap_cs).tokenName(minswap_tkn).build();
const minswapCs = '29d222ce763455e3d7a09a665ce554f00ac89d2e99a1a83d267170c6';
const minswapTkn = '4d494e';
const min = AssetClassBuilder.new().currencySymbol(minswapCs).tokenName(minswapTkn).build();
expect(min).toBeTruthy();
expect(min.currencySymbol).toBe(minswap_cs);
expect(min.tokenName).toBe(minswap_tkn);
expect(min.currencySymbol).toBe(minswapCs);
expect(min.tokenName).toBe(minswapTkn);
});

test('test assetclass native asset builder with invalid currency symbol', () => {
Expand Down
4 changes: 3 additions & 1 deletion src/__tests__/wingriders/datums/order-datum.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ describe('order datum module', () => {
try {
WingridersOrderDatumBuilder.new().build();
throw new Error('Expected field is missing value error');
} catch (e) {}
} catch (e) {
/** expected */
}
});

test('encode order datum for wingriders swap', () => {
Expand Down

0 comments on commit 15421a6

Please sign in to comment.