entropyxyz / sdk

Official JavaScript SDK for Entropy blockchain.
GNU Affero General Public License v3.0
7 stars 0 forks source link

Better deploy error #328

Open mixmix opened 2 months ago

mixmix commented 2 months ago

Problem

I go to deploy a program and get this error

Error: programs.ProgramAlreadySet: Program already set at hash.
    at file:///home/projects/ENTROPY/sdk/dist/index.js:61:20
    at file:///home/projects/ENTROPY/sdk/node_modules/@polkadot/api/promise/decorateMethod.js:56:28
    at file:///home/projects/ENTROPY/sdk/node_modules/@polkadot/util/nextTick.js:13:13

This is happening because someone already deployed the program. This is all well and good, but now I cannot use the program, because I have zero idea what the programPointer is :skull:

Proposal

few options:

  1. don't error, just give me the pointer That the program is already deployed already is not relevant to me. I just want the pointer please. Get out of my way and let me continue with my work

  2. error, but attach the pointer The advantage of this one is that with an error there is the possibility of putting control logic in (you could still ignore the error if you wanted... but you'd have the thing you need still)