Skip to content

Commit

Permalink
update getSerializedAO (#217)
Browse files Browse the repository at this point in the history
  • Loading branch information
iamarifdev authored Dec 13, 2022
1 parent be0a523 commit e221658
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/ao_host.js
Original file line number Diff line number Diff line change
Expand Up @@ -727,16 +727,20 @@ class AOHost extends AsyncEventEmitter {

getSerializedAO (instance) {
const { state = {} } = instance
const { id, alias, gid, createdAt } = state
const { id, name, gid, createdAt } = state
const ao = this.getAO(id)

const { meta = {} } = ao
const { serialize } = meta

state.alias = state.alias || name
state.lastActive = state.lastActive || createdAt

return {
gid,
alias,
alias: state.alias,
createdAt,
lastActive: state.lastActive,
algoID: id,
state: JSON.stringify(serialize(state)),
active: state.active
Expand Down

0 comments on commit e221658

Please sign in to comment.