Skip to content

Commit

Permalink
fix: 🐛 fix old references
Browse files Browse the repository at this point in the history
  • Loading branch information
timbrinded committed Jan 28, 2025
1 parent f10653f commit fc2dd77
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 56 deletions.
2 changes: 1 addition & 1 deletion test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"private": true,
"type": "module",
"scripts": {
"bundle-types": "cd ../moonbeam-types-bundle && pnpm build; cd ../test",
"bundle-types": "cd ../types-bundle && pnpm build; cd ../test",
"typegen": "pnpm bundle-types && cd ../typescript-api && pnpm scrape && pnpm generate && pnpm build; cd ../test",
"clean": "rm -rf node_modules",
"fmt": "biome format .",
Expand Down
6 changes: 3 additions & 3 deletions test/scripts/update-local-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ const executeUpdateAPIScript = async () => {
await checkBinary();

// Bundle types
await executeScript("../../moonbeam-types-bundle", "pnpm i");
await executeScript("../../moonbeam-types-bundle", "pnpm build");
await executeScript("../../moonbeam-types-bundle", "pnpm check:fix");
await executeScript("../../types-bundle", "pnpm i");
await executeScript("../../types-bundle", "pnpm build");
await executeScript("../../types-bundle", "pnpm check:fix");

// Generate types
console.log("Extracting metadata for all runtimes...");
Expand Down
2 changes: 1 addition & 1 deletion tools/test-scripts/test-alpha.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ApiPromise, WsProvider } from "@polkadot/api";
import Web3 from "web3";
import { typesBundlePre900 } from "../../moonbeam-types-bundle/dist";
import { typesBundlePre900 } from "moonbeam-types-bundle";
import { FAITH } from "../test-constants";
const wsProviderUrl = `wss://wss.testnet.moonbeam.network`;

Expand Down
2 changes: 1 addition & 1 deletion tools/test-scripts/test-staking.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ApiPromise, Keyring, WsProvider } from "@polkadot/api";
import { start } from "polkadot-launch";
import { typesBundlePre900 } from "../../moonbeam-types-bundle/dist";
import { typesBundlePre900 } from "moonbeam-types-bundle";
import {
ALITH,
GERALD,
Expand Down
48 changes: 0 additions & 48 deletions types-bundle/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,54 +3,6 @@
Exports npm package `@moonbeam-network/types-bundle`, formated as per polkadot-js specification to use
with the app or the API.

## ⚠️Warning: Types deprecation⚠️

Following runtime upgrade 900 (include substrate v0.9.11), types are now retrieved from the node, in
a **camelCase** format

A **new version** has been released `[email protected]`.

The default export `typesBundle` has **been removed** to avoid confusion.

**2 new typesBundles** are available:

* `import { typesBundlePre900 } from "@moonbeam-network/types-bundle"` to use the new naming convention
* `import { typesBundleDeprecated } from "@moonbeam-network/types-bundle"` to keep using old naming convention that isn't camelCase (This will break at runtime 1000)

### Breaking changes in typesBundlePre900

Those types are being changed:

```
AssetRegistrarMetadata: {
...
isFrozen: "bool", // was is_frozen
},
RewardInfo: {
totalReward: "Balance", // was total_reward
claimedReward: "Balance", // was claimed_reward
contributedRelayAddresses: "Vec<RelayChainAccountId>", // was contributed_relay_addresses
},
Nominator2: {
...
scheduledRevocationsCount: "u32", // was scheduled_revocations_count
scheduledRevocationsTotal: "Balance", // was scheduled_revocations_total
},
ExitQ: {
...
nominatorsLeaving: "Vec<AccountId>", // was nominators_leaving
candidateSchedule: "Vec<(AccountId, RoundIndex)>", // was candidate_schedule
nominatorSchedule: "Vec<(AccountId, Option<AccountId>, RoundIndex)>", // was nominator_schedule
},
Collator2: {
...
topNominators: "Vec<Bond>", // was top_nominators
bottomNominators: "Vec<Bond>", // was bottom_nominators
totalCounted: "Balance", // was total_counted
totalBacking: "Balance", // was total_backing
}
```

# Development

`typesBundlePre900` is of type OverrideBundleType to associate runtime names with correct definitions.
Expand Down
4 changes: 2 additions & 2 deletions types-bundle/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@
],
"author": "Moonsong Labs",
"license": "GPL-3.0-only",
"homepage": "https://github.com/moonbeam-foundation/moonbeam/tree/master/moonbeam-types-bundle#readme",
"homepage": "https://github.com/moonbeam-foundation/moonbeam/tree/master/types-bundle#readme",
"repository": {
"type": "git",
"url": "https://github.com/moonbeam-foundation/moonbeam.git",
"url": "git+https://github.com/moonbeam-foundation/moonbeam.git",
"directory": "typescript-api"
},
"dependencies": {
Expand Down

0 comments on commit fc2dd77

Please sign in to comment.