Skip to content

Commit

Permalink
Replace photon with alnt token denom (#73)
Browse files Browse the repository at this point in the history
Part of [laconicd testnet validator enrollment](https://www.notion.so/laconicd-testnet-validator-enrollment-6fc1d3cafcc64fef8c5ed3affa27c675)

Co-authored-by: IshaVenikar <ishavenikar7@gmail.com>
Reviewed-on: https://git.vdb.to/cerc-io/laconic-registry-cli/pulls/73
Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
Co-committed-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
  • Loading branch information
2 people authored and nabarun committed Jul 30, 2024
1 parent 901126d commit 70e63c7
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 35 deletions.
42 changes: 21 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ The `gas` and `fees` can be set to some default values in the config, and can be
Example:

```bash
$ laconic registry bond create --type photon --quantity 1000000000 --gas 200000 --fees 200000photon
$ laconic registry bond create --type alnt --quantity 100000000000 --gas 200000 --fees 200000alnt
```

## Operations
Expand Down Expand Up @@ -121,7 +121,7 @@ $ laconic registry account get --address laconic15za32wly5exgcrt2zfr8php4ya49n5y
"sequence": "37",
"balance": [
{
"type": "photon",
"type": "alnt",
"quantity": "89998999999999991999799300"
}
]
Expand All @@ -132,7 +132,7 @@ $ laconic registry account get --address laconic15za32wly5exgcrt2zfr8php4ya49n5y
Send tokens:

```bash
$ laconic registry tokens send --address laconic15za32wly5exgcrt2zfr8php4ya49n5y7masu7k --type photon --quantity 1000000000
$ laconic registry tokens send --address laconic15za32wly5exgcrt2zfr8php4ya49n5y7masu7k --type alnt --quantity 1000000000
[
{
"address": "laconic1pmuxrcnuhhf8qdllzuf2ctj2tnwwcg6yswqnyd",
Expand All @@ -141,7 +141,7 @@ $ laconic registry tokens send --address laconic15za32wly5exgcrt2zfr8php4ya49n5y
"sequence": "16",
"balance": [
{
"type": "photon",
"type": "alnt",
"quantity": "99998999999999997973999700"
}
]
Expand All @@ -153,7 +153,7 @@ $ laconic registry tokens send --address laconic15za32wly5exgcrt2zfr8php4ya49n5y
"sequence": "0",
"balance": [
{
"type": "photon",
"type": "alnt",
"quantity": "1000000000"
}
]
Expand All @@ -177,7 +177,7 @@ record:
Publish record (see below for commands to create/query bonds):

```bash
$ laconic registry record publish --filename watcher.yml --bond-id 58508984500aa2ed18e059fa8203b40fbc9828e3bfa195361335c4e4524c4785 --gas 250000
$ laconic registry record publish --filename watcher.yml --bond-id 58508984500aa2ed18e059fa8203b40fbc9828e3bfa195361335c4e4524c4785 --gas 250000 --fees 250000alnt
{ id: 'bafyreic3auqajvgszh3vfjsouew2rsctswukc346dmlf273ln4g6iyyhba' }
```
Expand Down Expand Up @@ -255,15 +255,15 @@ $ laconic registry authority whois laconic
"commitsEndTime": "2022-04-26T11:44:45.679728594",
"revealsEndTime": "2022-04-26T11:45:45.679728594",
"commitFee": {
"type": "photon",
"type": "alnt",
"quantity": "1000000"
},
"revealFee": {
"type": "photon",
"type": "alnt",
"quantity": "1000000"
},
"minimumBid": {
"type": "photon",
"type": "alnt",
"quantity": "5000000"
},
"winnerAddress": "",
Expand Down Expand Up @@ -294,15 +294,15 @@ $ laconic registry auction get 0294fb2e3659c347b53a6faf4bef041fd934f0f3ab13df6d2
"commitsEndTime": "2022-04-26T11:44:45.679728594",
"revealsEndTime": "2022-04-26T11:45:45.679728594",
"commitFee": {
"type": "photon",
"type": "alnt",
"quantity": "1000000"
},
"revealFee": {
"type": "photon",
"type": "alnt",
"quantity": "1000000"
},
"minimumBid": {
"type": "photon",
"type": "alnt",
"quantity": "5000000"
},
"winnerAddress": "",
Expand All @@ -322,7 +322,7 @@ $ laconic registry auction get 0294fb2e3659c347b53a6faf4bef041fd934f0f3ab13df6d2
Commit an auction bid:
```bash
$ laconic registry auction bid commit 0294fb2e3659c347b53a6faf4bef041fd934f0f3ab13df6d2468d5d63abacd48 25000000 photon
$ laconic registry auction bid commit 0294fb2e3659c347b53a6faf4bef041fd934f0f3ab13df6d2468d5d63abacd48 25000000 alnt
Reveal file: ./out/bafyreiay2rccax64yn4ljhvzvm3jkbebvzheyucuma5jlbpzpzd5i5gjuy.json
```
Expand Down Expand Up @@ -426,7 +426,7 @@ $ laconic registry name resolve lrn://laconic/watcher/erc20
Create bond:
```bash
$ laconic registry bond create --type photon --quantity 1000
$ laconic registry bond create --type alnt --quantity 1000
```
List bonds:
Expand All @@ -439,7 +439,7 @@ $ laconic registry bond list
"owner": "laconic15za32wly5exgcrt2zfr8php4ya49n5y7masu7k",
"balance": [
{
"type": "photon",
"type": "alnt",
"quantity": "698000000"
}
]
Expand All @@ -449,7 +449,7 @@ $ laconic registry bond list
"owner": "laconic15za32wly5exgcrt2zfr8php4ya49n5y7masu7k",
"balance": [
{
"type": "photon",
"type": "alnt",
"quantity": "1000"
}
]
Expand All @@ -467,7 +467,7 @@ $ laconic registry bond get --id 58508984500aa2ed18e059fa8203b40fbc9828e3bfa1953
"owner": "laconic15za32wly5exgcrt2zfr8php4ya49n5y7masu7k",
"balance": [
{
"type": "photon",
"type": "alnt",
"quantity": "691000000"
}
]
Expand All @@ -485,7 +485,7 @@ $ laconic registry bond list --owner laconic15za32wly5exgcrt2zfr8php4ya49n5y7mas
"owner": "laconic15za32wly5exgcrt2zfr8php4ya49n5y7masu7k",
"balance": [
{
"type": "photon",
"type": "alnt",
"quantity": "684000000"
}
]
Expand All @@ -495,7 +495,7 @@ $ laconic registry bond list --owner laconic15za32wly5exgcrt2zfr8php4ya49n5y7mas
"owner": "laconic15za32wly5exgcrt2zfr8php4ya49n5y7masu7k",
"balance": [
{
"type": "photon",
"type": "alnt",
"quantity": "1000"
}
]
Expand All @@ -506,13 +506,13 @@ $ laconic registry bond list --owner laconic15za32wly5exgcrt2zfr8php4ya49n5y7mas
Refill bond:
```bash
$ laconic registry bond refill --id 58508984500aa2ed18e059fa8203b40fbc9828e3bfa195361335c4e4524c4785 --type photon --quantity 1000
$ laconic registry bond refill --id 58508984500aa2ed18e059fa8203b40fbc9828e3bfa195361335c4e4524c4785 --type alnt --quantity 1000
```
Withdraw funds from bond:
```bash
$ laconic registry bond withdraw --id 58508984500aa2ed18e059fa8203b40fbc9828e3bfa195361335c4e4524c4785 --type photon --quantity 500
$ laconic registry bond withdraw --id 58508984500aa2ed18e059fa8203b40fbc9828e3bfa195361335c4e4524c4785 --type alnt --quantity 500
```
Cancel bond:
Expand Down
2 changes: 1 addition & 1 deletion config.example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ services:
bondId:
chainId: laconic_9000-1
gas: 200000
fees: 200000photon
fees: 200000alnt
2 changes: 1 addition & 1 deletion demo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
# userKey: <ALICE_PRIVATE_KEY>

# Create a bond
laconic --config config.yml registry bond create --type photon --quantity 100000000000
laconic --config config.yml registry bond create --type alnt --quantity 100000000000

# Get the bond id
laconic --config config.yml registry bond list | jq -r '.[].id'
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cerc-io/laconic-registry-cli",
"version": "0.2.1",
"version": "0.2.2",
"main": "index.js",
"repository": "git@github.com:cerc-io/laconic-registry-cli.git",
"author": "",
Expand Down Expand Up @@ -29,7 +29,7 @@
"typescript": "^4.6.3"
},
"dependencies": {
"@cerc-io/registry-sdk": "^0.2.2",
"@cerc-io/registry-sdk": "^0.2.5",
"fs-extra": "^10.1.0",
"js-yaml": "^3.14.1",
"lodash": "^4.17.21",
Expand Down
9 changes: 5 additions & 4 deletions test/cli.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ describe('Test laconic CLI commands', () => {
const testAccount = process.env.TEST_ACCOUNT;
assert(testAccount, 'TEST_ACCOUNT not set in env');
const testAccount2 = 'laconic1pmuxrcnuhhf8qdllzuf2ctj2tnwwcg6yswqnyd';
const initialAccountBalance = Number('100000000000000000000000000');
const initialAccountBalance = Number('1000000000000000000000000000000');

const testAuthorityName = 'laconic';
const testRecordFilePath = 'test/data/watcher-record.yml';
Expand Down Expand Up @@ -224,12 +224,13 @@ describe('Test laconic CLI commands', () => {

describe('Record operations', () => {
const gas = 250000;
const fees = `250000${TOKEN_TYPE}`;
const bondBalance = 1000000000;

test('laconic registry record publish --filename <record_file> --bond-id <bond_id> --gas <gas>', async () => {
test('laconic registry record publish --filename <record_file> --bond-id <bond_id> --gas <gas> --fees <fees>', async () => {
// Create a new bond to be associated with the record
({ bondId: testRecordBondId } = createBond(bondBalance));
const result = spawnSync('laconic', ['registry', 'record', 'publish', '--filename', testRecordFilePath, '--bond-id', testRecordBondId, '--gas', gas.toString()]);
const result = spawnSync('laconic', ['registry', 'record', 'publish', '--filename', testRecordFilePath, '--bond-id', testRecordBondId, '--gas', gas.toString(), '--fees', fees]);
const outputObj = checkResultAndRetrieveOutput(result);

// Expect output object to resultant bond id
Expand Down Expand Up @@ -397,7 +398,7 @@ describe('Test laconic CLI commands', () => {
chainId: CHAIN_ID,
auctionId: testAuctionId,
bidderAddress: testAccount,
bidAmount: `${bidAmount}photon`
bidAmount: `${bidAmount}alnt`
});
}, (AUCTION_COMMIT_DURATION + 5) * 1000);
});
Expand Down
2 changes: 1 addition & 1 deletion test/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import yaml from 'js-yaml';
import { SpawnSyncReturns, spawnSync } from 'child_process';

export const CHAIN_ID = 'laconic_9000-1';
export const TOKEN_TYPE = 'photon';
export const TOKEN_TYPE = 'alnt';

export const AUCTION_FEES = {
commit: 1000000,
Expand Down
2 changes: 1 addition & 1 deletion test/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ services:
bondId:
chainId: $cosmos_chain_id
gas: 200000
fees: 200000photon
fees: 200000alnt
EOL
)
echo "$config" > "$config_file"
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -302,10 +302,10 @@
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==

"@cerc-io/registry-sdk@^0.2.2":
version "0.2.2"
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Fregistry-sdk/-/0.2.2/registry-sdk-0.2.2.tgz#2e8a533f069b4bb9f4cd4798e783f52e29167d0d"
integrity sha512-ocRMbWtdewOg02ORfK1U+qbTqB46anHP4ApXokGkY4d+mFSApR3sdUEi2geHcs8oh+SG8YAp7LUJ9AAJneNY8g==
"@cerc-io/registry-sdk@^0.2.5":
version "0.2.5"
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Fregistry-sdk/-/0.2.5/registry-sdk-0.2.5.tgz#9ca19fecb2923520dd6a19946c309ecb2ec780a2"
integrity sha512-/KXAYf9gStaX/rRBMCEeDCexEIpTOFHeHzMK9B3xfCT+SyYZE9WC9GpX299LzBYJKKPsb0/JvnDfip9S1igJtA==
dependencies:
"@cosmjs/amino" "^0.28.1"
"@cosmjs/crypto" "^0.28.1"
Expand Down

0 comments on commit 70e63c7

Please sign in to comment.