From 4148f441ae5db477d2a75ec9ded147fbc05b2b7b Mon Sep 17 00:00:00 2001 From: Spring Chiu Date: Tue, 4 Jun 2024 00:17:29 +0800 Subject: [PATCH] chore: add link of migration example --- near-sdk-js@2.0.0-diff-1.0.0.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/near-sdk-js@2.0.0-diff-1.0.0.md b/near-sdk-js@2.0.0-diff-1.0.0.md index fb404c3ce..cd0eef94b 100644 --- a/near-sdk-js@2.0.0-diff-1.0.0.md +++ b/near-sdk-js@2.0.0-diff-1.0.0.md @@ -32,6 +32,7 @@ export class StatusMessage { ``` ## js contract migration with data fields +### example1 * using for: contract state migrations * [example](https://github.com/near/near-sdk-js/blob/develop/examples/src/status-message-migrate-add-field.js) ```js @@ -63,6 +64,12 @@ export class StatusMessage { } } ``` +### example2 +* another migration example can be found in [test-basic-updates.ava.js](https://github.com/near/near-sdk-js/blob/feat-migrate-example/examples/__tests__/test-basic-updates.ava.js) with [old state contract](https://github.com/near/near-sdk-js/blob/feat-migrate-example/examples/src/basic-updates-base.js) and new [new state contract](https://github.com/fospring/near-sdk-js/blob/feat-migrate-example/examples/src/basic-updates-update.js). +with the test command in [examples directory](./examples): +```shell +pnpm run test:basic-updates +``` ## auto reconstruct class from object by static json schema * use for contract serialzed by default method(json), the detail document is here: https://github.com/near/near-sdk-js/blob/develop/AUTO_RECONSCTRUCT_BY_JSON_SCHEME.md#the-schema-format