-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
149 additions
and
7 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 |
---|---|---|
|
@@ -9,9 +9,9 @@ The Symbol SDK for TypeScript / JavaScript allows you to develop web, mobile, an | |
|
||
## Important Notes | ||
|
||
### _Gorilla.1_ Network Compatibility ([email protected].2) | ||
### _Gorilla.1_ Network Compatibility ([email protected].4) | ||
|
||
Due to a network upgrade with [catapult-server@Gorilla](https://github.com/nemtech/catapult-server/releases/tag/v0.9.6.2) version, **it is recommended to use this package's 0.20.6 version and upwards to use this package with Fushicho versioned networks**. | ||
Due to a network upgrade with [catapult-server@Gorilla](https://github.com/nemtech/catapult-server/releases/tag/v0.9.6.4) version, **it is recommended to use this package's 0.20.7 version and upwards to use this package with Fushicho versioned networks**. | ||
|
||
The upgrade to this package's [version v0.20.6](https://github.com/nemtech/symbol-sdk-typescript-javascript/releases/tag/v0.20.6) is mandatory for **_Gorilla compatibility**. | ||
|
||
|
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,126 @@ | ||
/* | ||
* Copyright 2018 NEM | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import { Account } from '../../src/model/account/Account'; | ||
import { NetworkType } from '../../src/model/network/NetworkType'; | ||
import { Deadline } from '../../src/model/transaction/Deadline'; | ||
import { IntegrationTestHelper } from './IntegrationTestHelper'; | ||
import { LinkAction } from '../../src/model/transaction/LinkAction'; | ||
import { AccountKeyLinkTransaction } from '../../src/model/transaction/AccountKeyLinkTransaction'; | ||
import { PersistentDelegationRequestTransaction } from '../../src/model/transaction/PersistentDelegationRequestTransaction'; | ||
import { VrfKeyLinkTransaction } from '../../src/model/transaction/VrfKeyLinkTransaction'; | ||
import { NodeKeyLinkTransaction } from '../../src/model/transaction/NodeKeyLinkTransaction'; | ||
|
||
describe('PersistentHarvesting', () => { | ||
const helper = new IntegrationTestHelper(); | ||
let account: Account; | ||
let generationHash: string; | ||
let networkType: NetworkType; | ||
let remoteAccount: Account; | ||
const vrfKeyPair = Account.createFromPrivateKey( | ||
'82798EA9A2D2D202AFCCC82C40A287780BCA3C7F7A2FD5B754832804C6BE1BAA', | ||
NetworkType.MIJIN_TEST, | ||
); | ||
|
||
before(() => { | ||
return helper.start().then(() => { | ||
remoteAccount = Account.generateNewAccount(helper.networkType); | ||
console.log(remoteAccount.privateKey, remoteAccount.publicAccount); | ||
account = helper.harvestingAccount; | ||
generationHash = helper.generationHash; | ||
networkType = helper.networkType; | ||
}); | ||
}); | ||
before(() => { | ||
return helper.listener.open(); | ||
}); | ||
|
||
after(() => { | ||
helper.listener.close(); | ||
}); | ||
|
||
/** | ||
* ========================= | ||
* Setup test data | ||
* ========================= | ||
*/ | ||
|
||
describe('AccountKeyLinkTransaction', () => { | ||
it('standalone', () => { | ||
const accountLinkTransaction = AccountKeyLinkTransaction.create( | ||
Deadline.create(), | ||
remoteAccount.publicKey, | ||
LinkAction.Link, | ||
networkType, | ||
helper.maxFee, | ||
); | ||
const signedTransaction = accountLinkTransaction.signWith(account, generationHash); | ||
|
||
return helper.announce(signedTransaction); | ||
}); | ||
}); | ||
|
||
describe('VrfKeyLinkTransaction', () => { | ||
it('standalone', () => { | ||
const vrfKeyLinkTransaction = VrfKeyLinkTransaction.create( | ||
Deadline.create(), | ||
vrfKeyPair.publicKey, | ||
LinkAction.Link, | ||
networkType, | ||
helper.maxFee, | ||
); | ||
const signedTransaction = vrfKeyLinkTransaction.signWith(account, generationHash); | ||
|
||
return helper.announce(signedTransaction); | ||
}); | ||
}); | ||
|
||
describe('NodeKeyLinkTransaction', () => { | ||
it('standalone', () => { | ||
const nodeKeyLinkTransaction = NodeKeyLinkTransaction.create( | ||
Deadline.create(), | ||
'cfd84eca83508bbee954668e4aecca736caefa615367da76afe6985d695381db', | ||
LinkAction.Link, | ||
networkType, | ||
helper.maxFee, | ||
); | ||
const signedTransaction = nodeKeyLinkTransaction.signWith(account, generationHash); | ||
|
||
return helper.announce(signedTransaction); | ||
}); | ||
}); | ||
/** | ||
* ========================= | ||
* Tests | ||
* ========================= | ||
*/ | ||
|
||
describe('transactions', () => { | ||
it('should create delegated harvesting transaction', () => { | ||
const tx = PersistentDelegationRequestTransaction.createPersistentDelegationRequestTransaction( | ||
Deadline.create(), | ||
remoteAccount.privateKey, | ||
vrfKeyPair.privateKey, | ||
'cfd84eca83508bbee954668e4aecca736caefa615367da76afe6985d695381db', | ||
NetworkType.MIJIN_TEST, | ||
helper.maxFee, | ||
); | ||
|
||
const signedTransaction = tx.signWith(account, generationHash); | ||
return helper.announce(signedTransaction); | ||
}); | ||
}); | ||
}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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