File tree Expand file tree Collapse file tree 3 files changed +19
-0
lines changed
main/kotlin/jp/co/soramitsu/iroha2/transaction
test/kotlin/jp/co/soramitsu/iroha2 Expand file tree Collapse file tree 3 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -230,6 +230,11 @@ object Instructions {
230230 */
231231 fun unregisterAsset (id : AssetId ) = unregisterSome { IdBox .AssetId (id) }
232232
233+ /* *
234+ * Unregister an asset definition
235+ */
236+ fun unregisterAssetDefinition (id : AssetDefinitionId ) = unregisterSome { IdBox .AssetDefinitionId (id) }
237+
233238 /* *
234239 * Unregister an account
235240 */
Original file line number Diff line number Diff line change @@ -215,6 +215,10 @@ class TransactionBuilder(builder: TransactionBuilder.() -> Unit = {}) {
215215 instructions.value.add(Instructions .unregisterAsset(id))
216216 }
217217
218+ fun unregisterAssetDefinition (id : AssetDefinitionId ) = this .apply {
219+ instructions.value.add(Instructions .unregisterAssetDefinition(id))
220+ }
221+
218222 fun unregisterTrigger (id : TriggerId ) = this .apply {
219223 instructions.value.add(
220224 Instructions .unregisterTrigger(id),
Original file line number Diff line number Diff line change @@ -260,6 +260,16 @@ class InstructionsTest : IrohaTest<Iroha2Client>() {
260260 .let { query -> client.sendQuery(query) }
261261 }
262262 }
263+
264+ client.tx { unregisterAssetDefinition(definitionId) }
265+ assertThrows<IrohaClientException > {
266+ runBlocking {
267+ QueryBuilder .findAssetDefinitionById(definitionId)
268+ .account(super .account)
269+ .buildSigned(super .keyPair)
270+ .let { query -> client.sendQuery(query) }
271+ }
272+ }
263273 }
264274
265275 @Test
You can’t perform that action at this time.
0 commit comments