Skip to content

Commit

Permalink
[shuffle] fix deno lint errors on main/mod.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
dimroc authored and bors-libra committed Dec 1, 2021
1 parent c074d82 commit 98dbc85
Showing 1 changed file with 18 additions and 17 deletions.
35 changes: 18 additions & 17 deletions shuffle/move/examples/main/mod.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) The Diem Core Contributors
// SPDX-License-Identifier: Apache-2.0

// deno-lint-ignore-file no-explicit-any
import * as DiemHelpers from "./helpers.ts";
import * as DiemTypes from "./generated/diemTypes/mod.ts";
import * as codegen from "./generated/diemStdlib/mod.ts";
Expand Down Expand Up @@ -109,10 +110,10 @@ export async function initializeTestNFT() {
export async function createTestNFTScriptFunction(
contentUri: string,
) {
let scriptFunction: string = defaultUserContext.address +
const scriptFunction: string = defaultUserContext.address +
"::TestNFT::create_nft";
let typeArguments: string[] = [];
let args: any[] = [contentUri];
const typeArguments: string[] = [];
const args: any[] = [contentUri];
return await DiemHelpers.invokeScriptFunction(
scriptFunction,
typeArguments,
Expand All @@ -125,15 +126,15 @@ export async function createTestNFTScriptFunction(
export async function transferNFTScriptFunction(
to: string,
creator: string,
creation_num: number,
creationNum: number,
) {
let scriptFunction: string = defaultUserContext.address +
const scriptFunction: string = defaultUserContext.address +
"::NFTStandard::transfer";

let typeArgument = defaultUserContext.address + "::TestNFT::TestNFT";
let typeArguments: string[] = [typeArgument];
const typeArgument = defaultUserContext.address + "::TestNFT::TestNFT";
const typeArguments: string[] = [typeArgument];

let args: any[] = [to, creator, creation_num];
const args: any[] = [to, creator, creationNum];
return await DiemHelpers.invokeScriptFunction(
scriptFunction,
typeArguments,
Expand All @@ -142,13 +143,13 @@ export async function transferNFTScriptFunction(
}

export async function initializeNFTScriptFunction(userContext: UserContext) {
let scriptFunction: string = defaultUserContext.address +
const scriptFunction: string = defaultUserContext.address +
"::NFTStandard::initialize_nft_collection";

let typeArgument = defaultUserContext.address + "::TestNFT::TestNFT";
let typeArguments: string[] = [typeArgument];
const typeArgument = defaultUserContext.address + "::TestNFT::TestNFT";
const typeArguments: string[] = [typeArgument];

let args: any[] = [];
const args: any[] = [];
return await DiemHelpers.invokeScriptFunctionForContext(
userContext,
scriptFunction,
Expand All @@ -165,16 +166,16 @@ export async function decodedMessages(addr?: string) {

export async function decodedNFTs(addr?: string) {
addr = addressOrDefault(addr);
let decoded_nfts: any[] = [];
const decodedNfts: any[] = [];
const nfts = (await devapi.resourcesWithName("NFTStandard", addr))
.filter((entry) => entry.data && entry.data.nfts)
.map((entry) => {
return entry.data.nfts;
});
nfts.forEach((nft_type: any) => {
nft_type.forEach((nft: any) => {
decoded_nfts.push(nft);
nfts.forEach((nftType: any) => {
nftType.forEach((nft: any) => {
decodedNfts.push(nft);
});
});
return decoded_nfts;
return decodedNfts;
}

0 comments on commit 98dbc85

Please sign in to comment.