Skip to content

Commit

Permalink
feat: replace DataItem and Signer classes with warp-arbundles impleme…
Browse files Browse the repository at this point in the history
…ntation (#434)
  • Loading branch information
asiaziola authored Jun 30, 2023
1 parent 2c68d7c commit 0863c25
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 50 deletions.
1 change: 0 additions & 1 deletion src/contract/HandlerBasedContract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,6 @@ export class HandlerBasedContract<State> implements Contract<State> {
await interactionDataItem.sign(bundlerSigner);
}

// TODO: for ethereum owner is set to public key and not the address!!
if (!this._evaluationOptions.internalWrites && strict) {
await this.checkInteractionInStrictMode(interactionDataItem.owner, input, tags, transfer, strict, vrf);
}
Expand Down
6 changes: 3 additions & 3 deletions src/contract/deploy/CreateContract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { JWKInterface } from 'arweave/node/lib/wallet';
import { WarpPluginType } from '../../core/WarpPlugin';
import { EvaluationOptions } from '../../core/modules/StateEvaluator';
import { Source } from './Source';
import { BundlerSigner } from './DataItem';
import { Signer } from 'warp-arbundles';
import { CustomSignature } from '../Signature';
import { Tag } from '../../utils/types/arweave-types';

Expand Down Expand Up @@ -31,13 +31,13 @@ export const BUNDLR_NODES = ['node1', 'node2'] as const;
export type BundlrNodeType = (typeof BUNDLR_NODES)[number];

export interface CommonContractData {
wallet: ArWallet | CustomSignature | BundlerSigner;
wallet: ArWallet | CustomSignature | Signer;
initState: string;
tags?: Tags;
transfer?: ArTransfer;
data?: {
'Content-Type': string;
body: string | Uint8Array;
body: string | Buffer;
};
evaluationManifest?: EvaluationManifest;
}
Expand Down
41 changes: 0 additions & 41 deletions src/contract/deploy/DataItem.ts

This file was deleted.

4 changes: 2 additions & 2 deletions src/contract/deploy/Source.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ArWallet } from './CreateContract';
import { CustomSignature } from '../../contract/Signature';
import { Transaction } from '../../utils/types/arweave-types';
import { BundlerSigner, DataItem } from './DataItem';
import { Signer, DataItem } from 'warp-arbundles';

export interface SourceData {
src: string | Buffer;
Expand All @@ -23,7 +23,7 @@ export interface Source {
*/
createSource(
sourceData: SourceData,
wallet: ArWallet | CustomSignature | BundlerSigner,
wallet: ArWallet | CustomSignature | Signer,
disableBundling?: boolean
): Promise<DataItem | Transaction>;

Expand Down
4 changes: 2 additions & 2 deletions src/core/Warp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import { Transaction } from '../utils/types/arweave-types';
import { DEFAULT_LEVEL_DB_LOCATION, WARP_GW_URL } from './WarpFactory';
import { LevelDbCache } from '../cache/impl/LevelDbCache';
import { SourceData } from '../contract/deploy/Source';
import { BundlerSigner, DataItem } from '../contract/deploy/DataItem';
import { Signer, DataItem } from 'warp-arbundles';
import { BasicSortKeyCache } from '../cache/BasicSortKeyCache';

export type WarpEnvironment = 'local' | 'testnet' | 'mainnet' | 'custom';
Expand Down Expand Up @@ -121,7 +121,7 @@ export class Warp {

async createSource(
sourceData: SourceData,
wallet: ArWallet | CustomSignature | BundlerSigner,
wallet: ArWallet | CustomSignature | Signer,
disableBundling = false
): Promise<Transaction | DataItem> {
return await this.createContract.createSource(sourceData, wallet, disableBundling);
Expand Down
1 change: 0 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ export * from './contract/Signature';
export * from './contract/EvaluationOptionsEvaluator';
export * from './contract/deploy/Source';
export * from './contract/deploy/CreateContract';
export * from './contract/deploy/DataItem';

export * from './legacy/gqlResult';
export * from './legacy/smartweave-global';
Expand Down

0 comments on commit 0863c25

Please sign in to comment.