Skip to content

Commit

Permalink
Merge pull request #231 from yusufidimaina9989/txBuilder
Browse files Browse the repository at this point in the history
shallow copy
  • Loading branch information
msinkec authored Feb 6, 2024
2 parents fdcbf78 + af3cd82 commit e74f8c1
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion docs/how-to-test-a-contract.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,19 @@ describe('Test SmartContract `Demo`', () => {
})
```

## Shallow Copy

Sometimes, if you only want to do a shallow copy of some properties, you can pass in the property names as an optional argument like this:

```ts
const nextInstance = instance.next(
{
refCloneProps: ['prop1', 'prop2']
}
)
```
In this context the `next` is designed to create a shallow copy of the specified properties, allowing for selective copy rather than a complete copy of the entire contract instance.

## Run tests


Expand Down Expand Up @@ -287,4 +300,4 @@ or

```sh
npm run test:testnet
```
```

0 comments on commit e74f8c1

Please sign in to comment.