Skip to content

Conversation

@boblat
Copy link
Contributor

@boblat boblat commented Nov 6, 2025

  • clone was returning different value for an object with a type definition if the properties are in different order than the type definition
type Obj = {
  a: uint64
  b: boolean
  c: string
}
const x: Obj = {
  a: 1,
  c: 'test',
  b: true
}
const y = clone(x) // x and y have different values

Resolves #110

bwmx added a commit to bwmx/randomness-beacon that referenced this pull request Nov 6, 2025
bwmx added a commit to bwmx/randomness-beacon that referenced this pull request Nov 6, 2025
* chore: update dependencies in package.json and package-lock.json to latest `algorand-typescript` `^1.0.1`

- Updated @algorandfoundation/algorand-typescript to ^1.0.1
- Updated @algorandfoundation/algorand-typescript-testing to ^1.0.1
- Updated @algorandfoundation/puya-ts to ^1.0.1
- Updated algosdk to ^3.5.2
- Updated eslint to ^9.39.0

* Refactor RandomnessBeacon contract, tests and related project to use latest puya-ts

- Updated RandomnessBeacon contract to use uint64 instead of arc4.UintN64 and removing general use of arc4 where possible.
- Refactored internal methods to improve readability.
- Introduced new types for VRF public key, proof, and output.
- Modified event structures to align with new types (no longer dependent on `arc4.Struct` type
- Updated tests to reflect changes in the contract/abi

* fix: remove uneeded `@contract` decorator from `RandomnessBeacon` class, this was causing issues with a bug in `algorand-typescript-testing`

* test: update `RandomnessBeacon` offline unit tests, check box state after creation

* uncomment `createRequest` tests to demonstrate failing tests

* test: fix RandomnessBeacon contract tests with vrfVerify mock, more tests to rule out other issues with error.

* test: `RandomnessBeacon` reformatted to use `algorand-typescript-testing`. Now all tests pass.

Workaround for issue: algorandfoundation/algorand-typescript-testing#109

* Update projects/randomness-beacon/smart_contracts/randomness_beacon/types.algo.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@boblat boblat merged commit 10ec44d into main Nov 12, 2025
1 check passed
@boblat boblat deleted the fix/clone branch November 12, 2025 01:38
@engineering-ci
Copy link
Contributor

🎉 This PR is included in version 1.0.2-beta.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

clone returns different value if properties are defined in different order than type definition

2 participants