Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat-near-workspace-issue-354: update nearcore version to 1.37+ #241

Closed

Conversation

fospring
Copy link
Collaborator

@fospring fospring commented Jul 6, 2024

Resolves #214

near/near-workspaces-rs#354

current newest sandox is https://www.npmjs.com/package/near-sandbox/v/0.0.18?activeTab=code
the nearcore version is 1.38.0, which is satisfy 1.37+:
image

@fospring
Copy link
Collaborator Author

fospring commented Jul 6, 2024

workspaces's implementation of devDeploy, it will create a sub account, not a TLA: https://github.com/near/near-workspaces-js/blob/main/packages/js/src/account/account.ts#L233

  async devDeploy(
    wasm: string | URL | Uint8Array | Buffer,
    {
      attachedDeposit = NO_DEPOSIT,
      args = {},
      // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
      gas = DEFAULT_FUNCTION_CALL_GAS,
      initialBalance,
      keyPair,
      method,
      isSubAccount,
    }: {
      args?: Record<string, unknown> | Uint8Array;
      attachedDeposit?: string | BN;
      gas?: string | BN;
      initialBalance?: BN | string;
      keyPair?: KeyPair;
      method?: string;
      isSubAccount?: boolean;
    } = {},
  ): Promise<NearAccount> {
    const accountId = `${randomAccountId('dev-', 5, 5)}.${this.accountId}`;
    let tx = await this.internalCreateAccount(accountId, {
      keyPair,
      initialBalance,
      isSubAccount,
    });
    tx = await tx.deployContractFile(wasm);
    if (method) {
      tx.functionCall(method, args, {gas, attachedDeposit});
    }

    const result = await tx.transact();

    if (result.Failure) {
      throw new Error(`Failure during trasaction excecution, details: ${JSON.stringify(result)}`);
    }

    return this.getAccount(accountId);
  }

@frol
Copy link
Contributor

frol commented Sep 24, 2024

I could not push to this PR, so I took it over in #243

@frol frol closed this Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NEARCORE binary out of date
2 participants