"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const bignumber_js_1 = __importDefault(require("bignumber.js"));
const internal_1 = require("../../internal");
const mocks_1 = require("../../testUtils/mocks");
const utils_1 = require("../../types/utils");
describe('Polymesh Transaction class', () => {
    let context;
    beforeAll(() => {
        mocks_1.dsMockUtils.initMocks();
    });
    beforeEach(() => {
        context = mocks_1.dsMockUtils.getContextInstance();
    });
    const txSpec = {
        signer: 'signer',
        isCritical: false,
        fee: new bignumber_js_1.default(100),
    };
    afterEach(() => {
        mocks_1.dsMockUtils.reset();
    });
    describe('get: args', () => {
        test('should return unwrapped args', () => {
            const transaction = mocks_1.dsMockUtils.createTxStub('asset', 'registerTicker');
            const args = utils_1.tuple('A_TICKER');
            const tx = new internal_1.PolymeshTransaction(Object.assign(Object.assign({}, txSpec), { transaction,
                args }), context);
            expect(tx.args).toEqual(args);
            expect(tx.args).toEqual(args); // this second call is to cover the case where the internal value is already set
        });
    });
    describe('method: supportsSubsidy', () => {
        test('should return whether the transaction supports subsidy', () => {
            context.supportsSubsidy.onFirstCall().returns(false);
            const transaction = mocks_1.dsMockUtils.createTxStub('identity', 'leaveIdentityAsKey');
            const tx = new internal_1.PolymeshTransaction(Object.assign(Object.assign({}, txSpec), { transaction }), context);
            expect(tx.supportsSubsidy()).toBe(false);
        });
    });
});
//# sourceMappingURL=PolymeshTransaction.js.map