HeliosLang / compiler

Helios is a DSL for writing Cardano smart contracts. This library lets you compile Helios scripts and build Cardano transactions.
https://www.hyperion-bt.org/helios-book
BSD 3-Clause "New" or "Revised" License
142 stars 31 forks source link

Override IS_TESTNET var: setting helios for mainnet #70

Closed nemo83 closed 1 year ago

nemo83 commented 1 year ago

Hey,

I've recently noticed that address generation is defaulted to testnet, and that makes sense to me, and that it depends on the IS_TESTNET var in the helios module.

Unfortunately, despite being a var the IS_TESTNET cannot be changed in nextjs, and I would expect to be the same in the major frontend frameworks.

Now, I think that the intent was to make the value of IS_TESTNET to be customised by the developer (var instead of const). So I was wondering if it was possible to wrap IS_TESTNET along w/ the other customiseable flag, in another object, itself declared as const (as it can't be overriden anyway) and that has vars inside that can be changed.

In the app I'm developing I'm seeing something similar is done by the fontawesome lib.

Example

import { config } from "@fortawesome/fontawesome-svg-core";
config.autoAddCss = false;
christianschmitz commented 1 year ago

I learned something new about Javascript: imported variables are read-only.

I will change it so the modifiable global variables are in an object called config instead

christianschmitz commented 1 year ago

v0.13.4 should fix this.

https://www.hyperion-bt.org/helios-book/api/reference/globals.html

nemo83 commented 1 year ago

it worked. nice one and thanks as usual for the super quick fix