Skip to content

Commit

Permalink
Merge pull request #130 from casper-ecosystem/hotfix/new-transfer-wit…
Browse files Browse the repository at this point in the history
…hout-id

Casper-js-sdk 2.7.6
  • Loading branch information
hoffmannjan authored Jan 21, 2022
2 parents c4d9f00 + 9424612 commit fb76109
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 7 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,19 @@ All notable changes to casper-js-sdk.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 2.7.6

### Fixed

- Fixes wrong logic in newTransferWithOptionalTransferId() method.

## 2.7.5

### Fixed

- Fixes problems with Lists containing multiple Keys containing Hash or ByteArray.
- Fixes problem with ByteArray with size different than 32 bytes.

## 2.7.4

### Fixed
Expand Down
8 changes: 3 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "casper-js-sdk",
"version": "2.7.5",
"version": "2.7.6",
"license": "Apache 2.0",
"description": "SDK to interact with the Casper blockchain",
"homepage": "https://github.com/casper-ecosystem/casper-js-sdk#README.md",
Expand Down
2 changes: 1 addition & 1 deletion src/lib/DeployUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,7 @@ export class ExecutableDeployItem implements ToBytes {
} else {
runtimeArgs.insert(
'id',
CLValueBuilder.option(Some(new CLU64(id!)), new CLU64Type())
CLValueBuilder.option(None, CLTypeBuilder.u64())
);
}

Expand Down
13 changes: 13 additions & 0 deletions test/lib/DeployUtil.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,19 @@ describe('DeployUtil', () => {
expect(badFn).to.throw('transfer-id missing in new transfer.');
});

it('Should be able create new transfer without providing transfer-id using newTransferWithOptionalTransferId()', () => {
const recipientKey = Keys.Ed25519.new();
const transferAmount = 10;

const goodFn = () => DeployUtil.ExecutableDeployItem.newTransferWithOptionalTransferId(
transferAmount,
recipientKey.publicKey,
);

expect(goodFn).to.not.throw();

});

it('newTransferToUniqAddress should construct proper deploy', () => {
const senderKey = Keys.Ed25519.new();
const recipientKey = Keys.Ed25519.new();
Expand Down

0 comments on commit fb76109

Please sign in to comment.