wellformat permission

This commit is contained in:
liangping 2023-05-03 18:00:18 +08:00
parent 8fb6a952de
commit 777ba4d5d0
2 changed files with 18 additions and 3 deletions

View File

@ -26,7 +26,10 @@ wasmStore.wasmClient.getWasmCodeList().then(x =>{
<td>{{ v.code_id }}</td>
<td>{{ v.creator }}</td>
<td><RouterLink :to="`/${props.chain}/cosmwasm/${v.code_id}/contracts`"><div class="text-truncate" style="max-width: 200px;">{{ v.data_hash }}</div></RouterLink></td>
<td>{{ v.instantiate_permission }}</td>
<td>
{{ v.instantiate_permission?.permission }}
<span>{{ v.instantiate_permission?.address }}</span>
</td>
</tr>
</tbody>
</VTable>

View File

@ -8,7 +8,7 @@ import updateLocale from 'dayjs/plugin/updateLocale'
import utc from 'dayjs/plugin/utc'
import localeData from 'dayjs/plugin/localeData'
import { useStakingStore } from "./useStakingStore";
import { fromBase64, fromBech32, toHex } from "@cosmjs/encoding";
import { fromBase64, fromBech32, fromHex, toHex } from "@cosmjs/encoding";
import { consensusPubkeyToHexAddress } from "@/libs";
import { useBankStore } from "./useBankStore";
import type { DenomTrace } from "@/types";
@ -183,7 +183,19 @@ export const useFormatter = defineStore('formatter', {
},
multiLine(v: string) {
return v? v.replaceAll("\\n","\n"): ""
}
},
hexToString(hex: string) {
if(hex) {
return new TextDecoder().decode(fromHex(hex))
}
return ""
},
base64ToString(hex: string) {
if(hex) {
return new TextDecoder().decode(fromBase64(hex))
}
return ""
}
}
})