Skip to content

Commit

Permalink
deprecate cip8 commands for offchain storage. (#231)
Browse files Browse the repository at this point in the history
* deprecate cip8 commands for offchain storage.

Co-authored-by: Arthur Gousset <[email protected]>

---------

Co-authored-by: Arthur Gousset <[email protected]>
  • Loading branch information
aaronmgdr and arthurgousset authored Apr 19, 2024
1 parent 0c61e7e commit e7ac487
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/slimy-cups-listen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@celo/celocli': patch
---

Add deprecation notice about future removal of `account:offchain-read` and `account:offchain-write` commands. These were created to showcase ["CIP8: Expand Metadata to general off-chain storage"](https://github.com/celo-org/celo-proposals/blob/8260b49b2ec9a87ded6727fec7d9104586eb0752/CIPs/cip-0008.md), which has been abandond and they are presenting a high maintainence burden.
6 changes: 4 additions & 2 deletions packages/cli/src/commands/account/offchain-read.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { BasicDataWrapper } from '@celo/identity/lib/offchain-data-wrapper'
import { PrivateNameAccessor, PublicNameAccessor } from '@celo/identity/lib/offchain/accessors/name'
import { Flags } from '@oclif/core'
import { Flags, ux } from '@oclif/core'
import { BaseCommand } from '../../base'
import { CustomArgs, CustomFlags } from '../../utils/command'
import { OffchainDataCommand } from '../../utils/off-chain-data'
import { DEPRECATION_NOTICE, OffchainDataCommand } from '../../utils/off-chain-data'

export default class OffchainRead extends BaseCommand {
static description = 'DEV: Reads the name from offchain storage'
Expand All @@ -23,6 +23,8 @@ export default class OffchainRead extends BaseCommand {
static examples = ['offchain-read 0x...', 'offchain-read 0x... --from 0x... --privateKey 0x...']

async run() {
ux.warn(DEPRECATION_NOTICE)

const kit = await this.getKit()
const {
args: { arg1: address },
Expand Down
6 changes: 4 additions & 2 deletions packages/cli/src/commands/account/offchain-write.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { PrivateNameAccessor, PublicNameAccessor } from '@celo/identity/lib/offchain/accessors/name'
import { privateKeyToAddress } from '@celo/utils/lib/address'
import { Flags } from '@oclif/core'
import { Flags, ux } from '@oclif/core'
import { binaryPrompt } from '../../utils/cli'
import { OffchainDataCommand } from '../../utils/off-chain-data'
import { DEPRECATION_NOTICE, OffchainDataCommand } from '../../utils/off-chain-data'
export default class OffchainWrite extends OffchainDataCommand {
static description = 'DEV: Writes a name to offchain storage'

Expand All @@ -24,6 +24,8 @@ export default class OffchainWrite extends OffchainDataCommand {
]

async run() {
ux.warn(DEPRECATION_NOTICE)

const kit = await this.getKit()
const {
flags: { encryptTo, name, privateDEK, privateKey },
Expand Down
3 changes: 3 additions & 0 deletions packages/cli/src/utils/off-chain-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,6 @@ export abstract class OffchainDataCommand extends BaseCommand {
: new LocalStorageWriter(directory)
}
}

export const DEPRECATION_NOTICE =
'offchain-read and offchain-write commands are deprecated as CIP8 was abandonded. They will be removed next major release.'

0 comments on commit e7ac487

Please sign in to comment.