rooch-network / rooch

VApp Container with Move Language
https://rooch.network
Apache License 2.0
128 stars 54 forks source link

Make tx order type from u128 to u64 #1148

Closed baichuan3 closed 6 months ago

baichuan3 commented 6 months ago

part of https://github.com/rooch-network/rooch/pull/1136

Summary

Make tx order type from u128 to u64

vercel[bot] commented 6 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment | Name | Status | Preview | Comments | Updated (UTC) | | :--- | :----- | :------ | :------- | :------ | | **rooch** | ⬜️ Ignored ([Inspect](https://vercel.com/rooch/rooch/8QGJWvD5wsGoc6HMVQDnx6p2BJEU)) | [Visit Preview](https://rooch-git-maketxorderu64-rooch.vercel.app) | | Nov 15, 2023 2:04pm |
baichuan3 commented 6 months ago

This is a broken update, the Rooch dev environment needs to be restarted after execute rooch server clean -n dev. @yourmoonlight

The tx order parameter type related to RPC has also changed, @wow-sven knows about it.

baichuan3 commented 6 months ago

When exec run pnpm sdk build in CI encounter an error.

DTS Build start
Error: src/provider/json-rpc-provider.ts(14,3): error TS2724: '"../types"' has no exported member named 'TransactionWithInfoPageView'. Did you mean 'TransactionWithInfoView'?

Error: error occured in dts build
    at Worker.<anonymous> (/runner/_work/rooch/rooch/node_modules/.pnpm/tsup@6.7.0_typescript@5.2.2/node_modules/tsup/dist/index.js:2281:26)
    at Worker.emit (node:events:517:28)
    at MessagePort.<anonymous> (node:internal/worker:243:53)
    at [nodejs.internal.kHybridDispatch] (node:internal/event_target:757:20)
    at exports.emitMessage (node:internal/per_context/messageport:23:28)
DTS Build error
RollupError: Failed to compile. Check the logs above.

The TransactionWithInfoPageView compiled in the sdk has the following prefix. How to solve this? @wow-sven

// `next_cursor` points to the last item in the page; Reading with `next_cursor` will start from the next item after `next_cursor` if `next_cursor` is `Some`, otherwise it will start from the first item.
export type PageView_for_TransactionWithInfoView_and_uint64 = {
  data: TransactionWithInfoView[];
  has_next_page: boolean;
  next_cursor: number | null;
};
jolestar commented 6 months ago

@baichuan3 You need to update the name_mapping.json file

https://github.com/rooch-network/rooch/blob/main/sdk/typescript/tools/generator/template/name_mapping.json

"PageView_for_TransactionWithInfoView_and_uint128": "TransactionWithInfoPageView",
baichuan3 commented 6 months ago

@baichuan3 You need to update the name_mapping.json file

https://github.com/rooch-network/rooch/blob/main/sdk/typescript/tools/generator/template/name_mapping.json

"PageView_for_TransactionWithInfoView_and_uint128": "TransactionWithInfoPageView",

But make_tx_order_u64 branch checkout from the latest master branch, the name_mapping.json file is already up to date.

https://github.com/rooch-network/rooch/blob/make_tx_order_u64/sdk/typescript/tools/generator/template/name_mapping.json

"PageView_for_TransactionWithInfoView_and_uint128": "TransactionWithInfoPageView",
jolestar commented 6 months ago

PageView_for_TransactionWithInfoView_and_uint128 should be PageView_for_TransactionWithInfoView_and_uint64, because you changed the u128 to u64.