Skip to content
This repository has been archived by the owner on Jul 1, 2024. It is now read-only.

grind snek #25

Merged
merged 28 commits into from
May 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
ce296e5
:construction: Accept offers
vikiival May 21, 2022
c48c35c
:card_file_box: offers will have events
vikiival May 21, 2022
ef14ad3
:card_file_box: added entities for offer
vikiival May 21, 2022
d0ceffa
:card_file_box: codegen for offers
vikiival May 21, 2022
1a7823f
:card_file_box: migration for offers
vikiival May 21, 2022
262c7a9
:zap: create event accepts offer event
vikiival May 21, 2022
957af62
:rofl: rewritten handleOffer
vikiival May 21, 2022
204e77f
:zap: consolidator accepts <T extends AbstractEntity>
vikiival May 21, 2022
95a6ebd
:rofl: handleOfferAccept implemented
vikiival May 21, 2022
47240a1
:zap: offerIdOf
vikiival May 21, 2022
7cd89c2
:rofl: handleOfferWithdraw implemented
vikiival May 21, 2022
e372d18
:memo: Sun Tzu said: In the midst of chaos, there is also opportunity.
vikiival May 21, 2022
05f2b35
:construction: ready for expired offers
vikiival May 21, 2022
cfad66d
:construction: added withdraw and accept offer to processor
vikiival May 22, 2022
0cf764d
:bug: offers failed at wrong nesting
vikiival May 22, 2022
e32cd83
:robot: npm depcheck
vikiival May 22, 2022
3ac76f6
:arrow_up: @subsquid
vikiival May 22, 2022
6f69971
:alembic: wrapper for try catch
vikiival May 22, 2022
b0c99bb
:loud_sound: logs had extra }
vikiival May 22, 2022
eb90c2f
:monocle_face: disabled accepting offers
vikiival May 22, 2022
965c257
:top: typegen v52
vikiival May 23, 2022
7376273
:zap: accept offer event has maker https://github.com/galacticcouncil…
vikiival May 23, 2022
2dcb2c8
:bug: accept offer will return if no maker is present :)
vikiival May 23, 2022
080706b
:tada: enable accept offer
vikiival May 23, 2022
881cfd6
:top: infinity processor
vikiival May 23, 2022
d75b3d7
:card_file_box: some type upgrade
vikiival May 23, 2022
6673a12
:robot: snek renamed to snake
vikiival May 23, 2022
b4f8ad1
:robot: :snake: renamed to snekk
vikiival May 31, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions db/migrations/1653131550969-Data.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
module.exports = class Data1653131550969 {
name = 'Data1653131550969'

async up(db) {
await db.query(`CREATE TABLE "offer_event" ("id" character varying NOT NULL, "block_number" numeric, "caller" text NOT NULL, "current_owner" text, "interaction" character varying(6) NOT NULL, "meta" text NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "offer_id" character varying NOT NULL, CONSTRAINT "PK_292fd2efd338dfd5d627a4310e3" PRIMARY KEY ("id"))`)
await db.query(`CREATE INDEX "IDX_0cbe3e93f04317e2e80d29affc" ON "offer_event" ("offer_id") `)
await db.query(`ALTER TABLE "offer" ADD "created_at" TIMESTAMP WITH TIME ZONE NOT NULL`)
await db.query(`ALTER TABLE "offer" ADD "status" character varying(9) NOT NULL`)
await db.query(`ALTER TABLE "offer" ADD "updated_at" TIMESTAMP WITH TIME ZONE`)
await db.query(`ALTER TABLE "collection_event" DROP COLUMN "interaction"`)
await db.query(`ALTER TABLE "collection_event" ADD "interaction" character varying(11) NOT NULL`)
await db.query(`ALTER TABLE "event" DROP COLUMN "interaction"`)
await db.query(`ALTER TABLE "event" ADD "interaction" character varying(11) NOT NULL`)
await db.query(`ALTER TABLE "offer_event" ADD CONSTRAINT "FK_0cbe3e93f04317e2e80d29affc2" FOREIGN KEY ("offer_id") REFERENCES "offer"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`)
}

async down(db) {
await db.query(`DROP TABLE "offer_event"`)
await db.query(`DROP INDEX "public"."IDX_0cbe3e93f04317e2e80d29affc"`)
await db.query(`ALTER TABLE "offer" DROP COLUMN "created_at"`)
await db.query(`ALTER TABLE "offer" DROP COLUMN "status"`)
await db.query(`ALTER TABLE "offer" DROP COLUMN "updated_at"`)
await db.query(`ALTER TABLE "collection_event" ADD "interaction" character varying(12) NOT NULL`)
await db.query(`ALTER TABLE "collection_event" DROP COLUMN "interaction"`)
await db.query(`ALTER TABLE "event" ADD "interaction" character varying(12) NOT NULL`)
await db.query(`ALTER TABLE "event" DROP COLUMN "interaction"`)
await db.query(`ALTER TABLE "offer_event" DROP CONSTRAINT "FK_0cbe3e93f04317e2e80d29affc2"`)
}
}
8 changes: 4 additions & 4 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,19 @@ test:
npm run test:unit

improve TAG:
npx sqd squid:update snek@{{TAG}}
npx sqd squid:update snekk@{{TAG}}

release TAG:
npx sqd squid:release snek@{{TAG}}
npx sqd squid:release snekk@{{TAG}}

kill TAG:
npx sqd squid:kill "snek@{{TAG}}"
npx sqd squid:kill snekk@{{TAG}}

exec:
docker exec -it snek-db-1 psql -U postgres -d squid

update-deps:
npx taze
npx npm-check-updates -u

where-chain:
echo "https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Fbasilisk-kodadot.hydration.cloud#/explorer" | pbcopy
Loading