Skip to content

Commit 9197dc4

Browse files
committed
đź’„ Display proxy icon on proxy contract functions instead of implementation
1 parent d8b2539 commit 9197dc4

File tree

4 files changed

+32
-27
lines changed

4 files changed

+32
-27
lines changed

‎src/sake/webview/dist/sake/webview.js‎

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -27355,7 +27355,7 @@ function create_if_block_4$4(ctx) {
2735527355
return block;
2735627356
}
2735727357

27358-
// (70:30)
27358+
// (70:36)
2735927359
function create_if_block_3$5(ctx) {
2736027360
let span;
2736127361
let radiotowericon;
@@ -27367,7 +27367,7 @@ function create_if_block_3$5(ctx) {
2736727367
span = element("span");
2736827368
create_component(radiotowericon.$$.fragment);
2736927369
attr_dev(span, "slot", "start");
27370-
add_location(span, file$v, 70, 16, 2299);
27370+
add_location(span, file$v, 70, 16, 2311);
2737127371
},
2737227372
m: function mount(target, anchor) {
2737327373
insert_dev(target, span, anchor);
@@ -27393,7 +27393,7 @@ function create_if_block_3$5(ctx) {
2739327393
block,
2739427394
id: create_if_block_3$5.name,
2739527395
type: "if",
27396-
source: "(70:30) ",
27396+
source: "(70:36) ",
2739727397
ctx
2739827398
});
2739927399

@@ -27412,7 +27412,7 @@ function create_if_block_2$8(ctx) {
2741227412
span = element("span");
2741327413
create_component(loadingicon.$$.fragment);
2741427414
attr_dev(span, "slot", "start");
27415-
add_location(span, file$v, 66, 16, 2172);
27415+
add_location(span, file$v, 66, 16, 2178);
2741627416
},
2741727417
m: function mount(target, anchor) {
2741827418
insert_dev(target, span, anchor);
@@ -27471,7 +27471,7 @@ function create_if_block$e(ctx) {
2747127471
div = element("div");
2747227472
if_block.c();
2747327473
attr_dev(div, "class", div_class_value = "flex flex-1 flex-col gap-1 " + (/*expanded*/ ctx[3] ? 'w-full' : '') + " overflow-hidden");
27474-
add_location(div, file$v, 78, 8, 2500);
27474+
add_location(div, file$v, 78, 8, 2512);
2747527475
},
2747627476
m: function mount(target, anchor) {
2747727477
insert_dev(target, div, anchor);
@@ -27777,7 +27777,7 @@ function create_fragment$x(ctx) {
2777727777

2777827778
function select_block_type_1(ctx, dirty) {
2777927779
if (/*loading*/ ctx[5]) return 0;
27780-
if (/*isProxy*/ ctx[2]) return 1;
27780+
if (/*showProxyIcon*/ ctx[2]) return 1;
2778127781
return -1;
2778227782
}
2778327783

@@ -27802,11 +27802,11 @@ function create_fragment$x(ctx) {
2780227802
set_custom_element_data(vscode_button, "class", "flex-1");
2780327803
set_custom_element_data(vscode_button, "disabled", /*loading*/ ctx[5]);
2780427804
set_custom_element_data(vscode_button, "appearance", vscode_button_appearance_value = /*isCalldata*/ ctx[1] ? 'secondary' : 'primary');
27805-
add_location(vscode_button, file$v, 59, 8, 1946);
27805+
add_location(vscode_button, file$v, 59, 8, 1952);
2780627806
attr_dev(div0, "class", div0_class_value = "flex flex-1 gap-1 " + (/*expanded*/ ctx[3] ? 'w-full' : '') + " overflow-hidden");
27807-
add_location(div0, file$v, 51, 4, 1615);
27807+
add_location(div0, file$v, 51, 4, 1621);
2780827808
attr_dev(div1, "class", div1_class_value = "flex flex-1 w-full items-end gap-1 " + (/*expanded*/ ctx[3] ? 'flex-col' : 'flex-row'));
27809-
add_location(div1, file$v, 50, 0, 1525);
27809+
add_location(div1, file$v, 50, 0, 1531);
2781027810
},
2781127811
l: function claim(nodes) {
2781227812
throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
@@ -27978,7 +27978,7 @@ function instance$x($$self, $$props, $$invalidate) {
2797827978
let { onFunctionCall } = $$props;
2797927979
let { isConstructor = false } = $$props;
2798027980
let { isCalldata = false } = $$props;
27981-
let { isProxy = false } = $$props;
27981+
let { showProxyIcon = false } = $$props;
2798227982
let expanded = false;
2798327983
let inputRoot;
2798427984
let loading = false;
@@ -28025,7 +28025,7 @@ function instance$x($$self, $$props, $$invalidate) {
2802528025
}
2802628026
});
2802728027

28028-
const writable_props = ['func', 'onFunctionCall', 'isConstructor', 'isCalldata', 'isProxy'];
28028+
const writable_props = ['func', 'onFunctionCall', 'isConstructor', 'isCalldata', 'showProxyIcon'];
2802928029

2803028030
Object.keys($$props).forEach(key => {
2803128031
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console.warn(`<ContractFunction> was created with unknown prop '${key}'`);
@@ -28049,7 +28049,7 @@ function instance$x($$self, $$props, $$invalidate) {
2804928049
if ('onFunctionCall' in $$props) $$invalidate(7, onFunctionCall = $$props.onFunctionCall);
2805028050
if ('isConstructor' in $$props) $$invalidate(8, isConstructor = $$props.isConstructor);
2805128051
if ('isCalldata' in $$props) $$invalidate(1, isCalldata = $$props.isCalldata);
28052-
if ('isProxy' in $$props) $$invalidate(2, isProxy = $$props.isProxy);
28052+
if ('showProxyIcon' in $$props) $$invalidate(2, showProxyIcon = $$props.showProxyIcon);
2805328053
};
2805428054

2805528055
$$self.$capture_state = () => ({
@@ -28065,7 +28065,7 @@ function instance$x($$self, $$props, $$invalidate) {
2806528065
onFunctionCall,
2806628066
isConstructor,
2806728067
isCalldata,
28068-
isProxy,
28068+
showProxyIcon,
2806928069
expanded,
2807028070
inputRoot,
2807128071
loading,
@@ -28080,7 +28080,7 @@ function instance$x($$self, $$props, $$invalidate) {
2808028080
if ('onFunctionCall' in $$props) $$invalidate(7, onFunctionCall = $$props.onFunctionCall);
2808128081
if ('isConstructor' in $$props) $$invalidate(8, isConstructor = $$props.isConstructor);
2808228082
if ('isCalldata' in $$props) $$invalidate(1, isCalldata = $$props.isCalldata);
28083-
if ('isProxy' in $$props) $$invalidate(2, isProxy = $$props.isProxy);
28083+
if ('showProxyIcon' in $$props) $$invalidate(2, showProxyIcon = $$props.showProxyIcon);
2808428084
if ('expanded' in $$props) $$invalidate(3, expanded = $$props.expanded);
2808528085
if ('inputRoot' in $$props) $$invalidate(4, inputRoot = $$props.inputRoot);
2808628086
if ('loading' in $$props) $$invalidate(5, loading = $$props.loading);
@@ -28104,7 +28104,7 @@ function instance$x($$self, $$props, $$invalidate) {
2810428104
return [
2810528105
func,
2810628106
isCalldata,
28107-
isProxy,
28107+
showProxyIcon,
2810828108
expanded,
2810928109
inputRoot,
2811028110
loading,
@@ -28126,7 +28126,7 @@ class ContractFunction extends SvelteComponentDev {
2812628126
onFunctionCall: 7,
2812728127
isConstructor: 8,
2812828128
isCalldata: 1,
28129-
isProxy: 2
28129+
showProxyIcon: 2
2813028130
});
2813128131

2813228132
dispatch_dev("SvelteRegisterComponent", {
@@ -28169,11 +28169,11 @@ class ContractFunction extends SvelteComponentDev {
2816928169
throw new Error("<ContractFunction>: Props cannot be set directly on the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'");
2817028170
}
2817128171

28172-
get isProxy() {
28172+
get showProxyIcon() {
2817328173
throw new Error("<ContractFunction>: Props cannot be read directly from the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'");
2817428174
}
2817528175

28176-
set isProxy(value) {
28176+
set showProxyIcon(value) {
2817728177
throw new Error("<ContractFunction>: Props cannot be set directly on the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'");
2817828178
}
2817928179
}
@@ -29297,7 +29297,7 @@ function create_if_block$d(ctx) {
2929729297
check_outros();
2929829298
}
2929929299

29300-
if (dirty & /*filteredAbi, _onFunctionCall*/ 48) {
29300+
if (dirty & /*filteredAbi, _onFunctionCall, filteredProxies*/ 52) {
2930129301
each_value = /*filteredAbi*/ ctx[4];
2930229302
validate_each_argument(each_value);
2930329303
let i;
@@ -29382,8 +29382,7 @@ function create_each_block_2(ctx) {
2938229382
contractfunction = new ContractFunction({
2938329383
props: {
2938429384
func: /*func*/ ctx[13],
29385-
onFunctionCall: /*_onFunctionCall*/ ctx[5],
29386-
isProxy: true
29385+
onFunctionCall: /*_onFunctionCall*/ ctx[5]
2938729386
},
2938829387
$$inline: true
2938929388
});
@@ -29532,7 +29531,8 @@ function create_each_block$7(ctx) {
2953229531
contractfunction = new ContractFunction({
2953329532
props: {
2953429533
func: /*func*/ ctx[13],
29535-
onFunctionCall: /*_onFunctionCall*/ ctx[5]
29534+
onFunctionCall: /*_onFunctionCall*/ ctx[5],
29535+
showProxyIcon: /*filteredProxies*/ ctx[2].length > 0
2953629536
},
2953729537
$$inline: true
2953829538
});
@@ -29548,6 +29548,7 @@ function create_each_block$7(ctx) {
2954829548
p: function update(ctx, dirty) {
2954929549
const contractfunction_changes = {};
2955029550
if (dirty & /*filteredAbi*/ 16) contractfunction_changes.func = /*func*/ ctx[13];
29551+
if (dirty & /*filteredProxies*/ 4) contractfunction_changes.showProxyIcon = /*filteredProxies*/ ctx[2].length > 0;
2955129552
contractfunction.$set(contractfunction_changes);
2955229553
},
2955329554
i: function intro(local) {

‎src/sake/webview/dist/sake/webview.js.map‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/sake/webview/src/components/Contract.svelte‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,16 @@
102102
<div class="flex flex-col gap-1">
103103
{#each filteredProxies as proxy}
104104
{#each proxy.abi as func}
105-
<ContractFunction {func} onFunctionCall={_onFunctionCall} isProxy={true} />
105+
<ContractFunction {func} onFunctionCall={_onFunctionCall} />
106106
{/each}
107107
{/each}
108108

109109
{#each filteredAbi as func}
110-
<ContractFunction {func} onFunctionCall={_onFunctionCall} />
110+
<ContractFunction
111+
{func}
112+
onFunctionCall={_onFunctionCall}
113+
showProxyIcon={filteredProxies.length > 0}
114+
/>
111115
{/each}
112116

113117
<CalldataBytes onFunctionCall={_onFunctionCall} />

‎src/sake/webview/src/components/ContractFunction.svelte‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
export let onFunctionCall: (calldata: string, func: AbiFunctionFragment) => Promise<boolean>;
1313
export let isConstructor: boolean = false;
1414
export let isCalldata: boolean = false;
15-
export let isProxy: boolean = false;
15+
export let showProxyIcon: boolean = false;
1616
let expanded: boolean = false;
1717
let inputRoot: RootInputHandler;
1818
$: funcChanged(func);
@@ -70,7 +70,7 @@
7070
<span slot="start">
7171
<LoadingIcon />
7272
</span>
73-
{:else if isProxy}
73+
{:else if showProxyIcon}
7474
<span slot="start">
7575
<RadioTowerIcon />
7676
</span>

0 commit comments

Comments
 (0)