-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Renamed ExecutionResultV2 'effect' field to 'effects'. Changes type o…
…f 'effects' to a newly introduced type 'TransformV2'. Fixed interface 'Effect' to include 'operations' field
- Loading branch information
Jakub Zajkowski
committed
Aug 28, 2024
1 parent
1124678
commit ca87f62
Showing
3 changed files
with
110 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import chai, { expect } from 'chai'; | ||
import chaiAsPromised from 'chai-as-promised'; | ||
import { Operation, OpKind } from './types'; | ||
|
||
chai.use(chaiAsPromised); | ||
|
||
describe('CasperServiceByJsonRPC', () => { | ||
it('should deserialize operations', async () => { | ||
let operationRaw = '{"key":"key","kind":"Read"}'; | ||
let operation: Operation = JSON.parse(operationRaw); | ||
let expected: Operation = { key: 'key', kind: OpKind.Read }; | ||
expect(operation).to.deep.eq(expected); | ||
|
||
operationRaw = '{"key":"key2","kind":"Write"}'; | ||
operation = JSON.parse(operationRaw); | ||
expected = { key: 'key2', kind: OpKind.Write }; | ||
expect(operation).to.deep.eq(expected); | ||
|
||
operationRaw = '{"key":"key3","kind":"Add"}'; | ||
operation = JSON.parse(operationRaw); | ||
expected = { key: 'key3', kind: OpKind.Add }; | ||
expect(operation).to.deep.eq(expected); | ||
|
||
operationRaw = '{"key":"key4","kind":"NoOp"}'; | ||
operation = JSON.parse(operationRaw); | ||
expected = { key: 'key4', kind: OpKind.NoOp }; | ||
expect(operation).to.deep.eq(expected); | ||
|
||
operationRaw = '{"key":"key5","kind":"Prune"}'; | ||
operation = JSON.parse(operationRaw); | ||
expected = { key: 'key5', kind: OpKind.Prune }; | ||
expect(operation).to.deep.eq(expected); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters