Skip to content

Commit

Permalink
⬆️ Update eRPC + fix role cleanup post update
Browse files Browse the repository at this point in the history
  • Loading branch information
KONFeature committed Sep 2, 2024
1 parent 9de0a00 commit a1a8e1d
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 17 deletions.
2 changes: 1 addition & 1 deletion packages/erpc/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Base image is erpc
FROM ghcr.io/erpc/erpc:0.0.18
FROM ghcr.io/erpc/erpc:0.0.19

# Copy the config
COPY erpc.yaml /root/erpc.yaml
Expand Down
2 changes: 2 additions & 0 deletions packages/erpc/erpc-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,11 @@ export default buildErpcConfig({
server: {
httpPort: 8080,
maxTimeout: "60s",
listenV6: false,
},
metrics: {
enabled: true,
listenV6: false,
},
projects: [ponderProject, nexusProject],
rateLimiters: {
Expand Down
4 changes: 4 additions & 0 deletions packages/erpc/erpc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,15 @@ server:
httpPort: 8080
httpHostV4: 0.0.0.0
httpHostV6: "[::]"
listenV4: true
listenV6: false
maxTimeout: 60s
metrics:
port: 4001
hostV4: 0.0.0.0
hostV6: "[::]"
listenV4: true
listenV6: false
enabled: true
projects:
- rateLimitBudget: ""
Expand Down
2 changes: 1 addition & 1 deletion packages/erpc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"devDependencies": {
"@biomejs/biome": "1.8.3",
"@konfeature/erpc-config-generator": "0.0.8",
"@konfeature/erpc-config-generator": "0.0.9",
"@types/aws-lambda": "8.10.138",
"@types/node": "^22.4.0",
"aws-cdk-lib": "2.142.1",
Expand Down
13 changes: 3 additions & 10 deletions packages/ponder/src/productAdministrator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,11 @@ import {
ponder.on("ProductRegistry:Transfer", async ({ event, context }) => {
const { ProductAdministrator } = context.db;

// Delete the previous administrator
if (!isAddressEqual(event.args.from, zeroAddress)) {
await ProductAdministrator.delete({
id: productAdministratorId(event.args.id, event.args.from),
});
}

const productId = event.args.id;

// Remove the previous administrator
if (!isAddressEqual(event.args.from, zeroAddress)) {
ProductAdministrator.upsert({
await ProductAdministrator.upsert({
id: productAdministratorId(event.args.id, event.args.from),
create: {
isOwner: false,
Expand All @@ -42,7 +35,7 @@ ponder.on("ProductRegistry:Transfer", async ({ event, context }) => {

// Create the new administrator
if (!isAddressEqual(event.args.to, zeroAddress)) {
ProductAdministrator.upsert({
await ProductAdministrator.upsert({
id: productAdministratorId(event.args.id, event.args.to),
create: {
isOwner: true,
Expand All @@ -66,7 +59,7 @@ ponder.on(
async ({ event, context }) => {
const { ProductAdministrator } = context.db;

ProductAdministrator.upsert({
await ProductAdministrator.upsert({
id: productAdministratorId(event.args.product, event.args.user),
create: {
isOwner: false,
Expand Down
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a1a8e1d

Please sign in to comment.