Skip to content

Commit

Permalink
refactor(agent): namespace Code -> Program
Browse files Browse the repository at this point in the history
- avoid confusion with Core
- better name overall
  • Loading branch information
egasimus committed Jan 13, 2024
1 parent 838691d commit a78a447
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions agent/agent.browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ export * as Core from './core'
export * as Chain from './connect'
export * as Tokens from './token'
export * as Deploy from './deploy'
export * as Code from './code.browser'
export * as Code from './program.browser'
export * as Store from './store'
export * as Stub from './stub'

export type { ChainId, Address, Message, TxHash } from './connect'
export type { CodeHash } from './code.browser'
export type { CodeHash } from './program.browser'
export type { CodeId } from './deploy'
export type { Uint128, Uint256, Decimal128, Decimal256 } from './token'
4 changes: 2 additions & 2 deletions agent/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export * from './agent.browser'

// See note in connect.ts for what this does:
import { _$_HACK_$_ } from './connect'
import { LocalCompiledCode } from './code'
import { LocalCompiledCode } from './program'
_$_HACK_$_.CompiledCode = LocalCompiledCode

export * as Code from './code'
export * as Code from './program'
4 changes: 2 additions & 2 deletions agent/connect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import { ContractInstance } from './deploy'
import { Error, Logged, colors, bold, randomColor, into } from './core'
import { assign, Console } from './core'
import * as Code from './code'
import * as Code from './program'
import * as Deploy from './deploy'
import * as Token from './token'
import * as Store from './store'
Expand All @@ -16,7 +16,7 @@ import * as Store from './store'
// version that can only fetch from URL using the global fetch method, and when
// the library is loaded through the non-browser entrypoint, it gets substituted
// to the version which can also load code from disk. (Ugh.)
import { CompiledCode } from './code.browser'
import { CompiledCode } from './program.browser'
export const _$_HACK_$_ = { CompiledCode }

export type ChainId = string
Expand Down
4 changes: 2 additions & 2 deletions agent/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import { Contract } from './connect'
import type { Connection, ChainId, Label, Message, Address, TxHash } from './connect'
import * as Token from './token'
import type * as Store from './store'
import type { CodeHash, Compiler } from './code.browser'
import { SourceCode, RustSourceCode, CompiledCode } from './code'
import type { CodeHash, Compiler } from './program.browser'
import { SourceCode, RustSourceCode, CompiledCode } from './program'

/** A code ID, identifying uploaded code on a chain. */
export type CodeId = string
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions agent/code.ts → agent/program.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export * from './code.browser'
export * from './program.browser'

import { Console, bold } from './core'
import { CompiledCode } from './code.browser'
import { CompiledCode } from './program.browser'

import { readFile } from 'node:fs/promises'
import { fileURLToPath } from 'node:url'
Expand Down
2 changes: 1 addition & 1 deletion agent/store.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Console } from './core'
import type { CodeHash } from './code.browser'
import type { CodeHash } from './program.browser'
import type { Name, DeploymentState } from './deploy'
import { Deployment, UploadedCode } from './deploy'

Expand Down
4 changes: 2 additions & 2 deletions agent/stub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import { assign, Console, Error, base16, sha256, randomBech32 } from './core'
import type { ChainId, Address, Message, Label, TxHash } from './connect'
import { Connection, Backend, Batch, Identity } from './connect'
import type { CodeHash } from './code.browser'
import { Compiler, SourceCode, CompiledCode } from './code.browser'
import type { CodeHash } from './program.browser'
import { Compiler, SourceCode, CompiledCode } from './program.browser'
import type { CodeId } from './deploy'
import { UploadedCode, ContractInstance } from './deploy'
import * as Token from './token'
Expand Down
4 changes: 2 additions & 2 deletions agent/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"core.ts",
"chain.ts",
"connect.ts",
"code.ts",
"code.browser.ts",
"program.ts",
"program.browser.ts",
"deploy.ts",
"stub.ts",
"store.ts",
Expand Down

0 comments on commit a78a447

Please sign in to comment.