protected override async Task <APIResultCodes> AuthorizeImplAsync <T>(DagSystem sys, T tblock) { if (!(tblock is TokenBurnBlock)) { return(APIResultCodes.InvalidBlockType); } var block = tblock as TokenBurnBlock; if (string.IsNullOrWhiteSpace(block.BurnBy)) { return(APIResultCodes.InvalidTokenBurn); } if (string.IsNullOrWhiteSpace(block.GenesisHash)) { return(APIResultCodes.InvalidTokenBurn); } if (block.BurnAmount <= 0) { return(APIResultCodes.InvalidTokenBurn); } // IDexWallet interface var brkauth = new DexWalletAuthorizer(); var brkret = await brkauth.AuthorizeAsync(sys, tblock); if (brkret == APIResultCodes.Success) { return(await Lyra.Shared.StopWatcher.TrackAsync(() => base.AuthorizeImplAsync(sys, tblock), "DexTokenBurnAuthorizer->TransactionAuthorizer")); } else { return(brkret); } }
protected override async Task <APIResultCodes> AuthorizeImplAsync <T>(DagSystem sys, T tblock) { if (!(tblock is DexReceiveBlock)) { return(APIResultCodes.InvalidBlockType); } var block = tblock as DexReceiveBlock; // IDexWallet interface var brkauth = new DexWalletAuthorizer(); var brkret = await brkauth.AuthorizeAsync(sys, tblock); if (brkret == APIResultCodes.Success) { return(await Lyra.Shared.StopWatcher.TrackAsync(() => base.AuthorizeImplAsync(sys, tblock), "DexReceiveAuthorizer->BrokerAccountRecvAuthorizer")); } else { return(brkret); } }