Skip to content

Commit

Permalink
fix(tests): update tests for named prop expectation
Browse files Browse the repository at this point in the history
  • Loading branch information
atticusofsparta committed Feb 14, 2024
1 parent 86dc102 commit 4ea04a7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
9 changes: 1 addition & 8 deletions src/common/ArIO.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,35 +14,28 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import Arweave from 'arweave';

import { ContractStateProvider, HTTPServiceInterface } from '../types.js';
import { AxiosHTTPService } from './http.js';
import { DefaultLogger } from './logger.js';

export class ArIO implements ContractStateProvider {
private contractStateProvider: ContractStateProvider;
arweave: Arweave;
http: HTTPServiceInterface;
logger: DefaultLogger;

constructor({
arweave = Arweave.init({}),
contractStateProvider,
logger = new DefaultLogger({
level: 'debug',
logFormat: 'simple',
}),
}: {
arweave: Arweave;
contractStateProvider: ContractStateProvider;
logger?: DefaultLogger;
}) {
const { protocol, host } = arweave.api.config;
this.arweave = arweave;
this.contractStateProvider = contractStateProvider;
this.logger = logger;
this.http = new AxiosHTTPService({ url: `${protocol}://${host}`, logger });
this.http = new AxiosHTTPService({ url: '', logger }); // empty url allows for full url to be passed in get and post requests instead of the endpoint
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/ArNSRemoteCache.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe('ArIO Client', () => {
remoteProvider.getContractState = stubGetContractState;
const contractTxId = ''.padEnd(43, 'a');
await client.getContractState({ contractTxId });
expect(stubGetContractState).toHaveBeenCalledWith(contractTxId);
expect(stubGetContractState).toHaveBeenCalledWith({ contractTxId });
});

it('should call remote state provider and throw on bad contract id', async () => {
Expand Down

0 comments on commit 4ea04a7

Please sign in to comment.