Skip to content

Instantly share code, notes, and snippets.

@Alexey-N-Chernyshov
Alexey-N-Chernyshov / test.kt
Created August 16, 2018 12:26
Quorum example in Iroha
@Test
fun testQuorum() {
var keypair1 = ModelCrypto().generateKeypair()
var keypair2 = ModelCrypto().generateKeypair()
var txBuilder = ModelUtil.getModelTransactionBuilder()
var tx = txBuilder
.createdTime(ModelUtil.getCurrentTime())
.creatorAccountId("test@notary")
.createAccount("multisig", "notary", keypair1.publicKey())
.appendRole("multisig@notary", "tester")
@Alexey-N-Chernyshov
Alexey-N-Chernyshov / gist:a2be64e76920b7b3ac0ed0b7b560587f
Last active June 10, 2024 08:16
Web changes for Kensetsu configurable stables
async subscribeOnAverageCollateralPrices(context): Promise<void> {
const { commit, state } = vaultActionContext(context);
const { collaterals, averageCollateralPriceSubscriptions } = state;
const newIds: string[] = [];
const idsToRemove: string[] = [];
// Check if there are new collateral assets or some of them were removed
// TODO Please, check - stablecoins may be different as well as collaterals
for (const collateralId in collaterals) {
if (!(collateralId in averageCollateralPriceSubscriptions)) {
newIds.push(collateralId);