Error executing custom script on local net

Hi. I’m a masters student in India and just playing around with Move. I am new to rust as well. I was able to set up a local node to compile, publish and execute custom scripts.
I am not able to compile custom scripts. This is the module file

module A {
    struct T{v: u64}

    public new(u: u64) : V#Self.T {
        return T{u: move(u)};
    }

    public value(this: V#Self.T): u64 {
        let f: &u64;
        f = &(&mut this).v;
        return *move(f);
    }
}

I was able to publish this under an account address (say 0x1). But I am not able to compile

import 0x1.A;

main(u: u64) {
    let x: V#A.T;
    let x_ref: u64;
    x = A.new(copy(u));
    x_ref = A.value(move(x));
    assert(copy(x_ref) == 5, 42);
    return;
}

I get the error can\'t find module 0x1.A in dependency list. I was not able to trace the code to what might be the problem. Can someone help me out?

1 Like

你可以改变成0*0试试,反正是测试网络!!!

  1. Just to clarify, you’re just using address 0x1 as an example, right? Real account addresses are random (hash of pub key), so if you are submitting the code you posted as is, if unlikely it’s going to work by any chance.

  2. Try import {{sender}}.A. {{sender}} will get replaced by the real address of the account.