Skip to content

Commit

Permalink
refactor: Update wasmlib in all langs
Browse files Browse the repository at this point in the history
  • Loading branch information
howjmay committed Aug 30, 2023
1 parent d1a98a0 commit f24b600
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 22 deletions.
2 changes: 1 addition & 1 deletion contracts/wasm/corecontracts/test/core_governance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ func TestGetChainOwner(t *testing.T) {
f := coregovernance.ScFuncs.GetChainOwner(ctx)
f.Func.Call()
require.NoError(t, ctx.Err)
require.Equal(t, ctx.ChainOwnerID(), f.Results.ChainOwner().Value())
require.Equal(t, ctx.ChainOwnerID(), f.Results.ChainOwnerID().Value())
}

func TestGetChainNodes(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ export const ParamSetMinSD = 'ms';
export const ResultAccessNodeCandidates = 'an';
export const ResultAccessNodes = 'ac';
export const ResultChainID = 'c';
export const ResultChainOwner = 'o';
export const ResultChainOwnerID = 'o';
export const ResultControllers = 'a';
export const ResultFeePolicy = 'g';
Expand Down
8 changes: 4 additions & 4 deletions packages/wasmvm/wasmlib/as/wasmlib/coregovernance/results.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,15 +174,15 @@ export class MutableGetChainNodesResults extends wasmtypes.ScProxy {

export class ImmutableGetChainOwnerResults extends wasmtypes.ScProxy {
// chain owner
chainOwner(): wasmtypes.ScImmutableAgentID {
return new wasmtypes.ScImmutableAgentID(this.proxy.root(sc.ResultChainOwner));
chainOwnerID(): wasmtypes.ScImmutableAgentID {
return new wasmtypes.ScImmutableAgentID(this.proxy.root(sc.ResultChainOwnerID));
}
}

export class MutableGetChainOwnerResults extends wasmtypes.ScProxy {
// chain owner
chainOwner(): wasmtypes.ScMutableAgentID {
return new wasmtypes.ScMutableAgentID(this.proxy.root(sc.ResultChainOwner));
chainOwnerID(): wasmtypes.ScMutableAgentID {
return new wasmtypes.ScMutableAgentID(this.proxy.root(sc.ResultChainOwnerID));
}
}

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions packages/wasmvm/wasmlib/go/wasmlib/coregovernance/results.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/wasmvm/wasmlib/interfaces/coregovernance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ views:
# Returns the AgentID of the chain owner.
getChainOwner:
results:
chainOwner=o: AgentID # chain owner
chainOwnerID=o: AgentID # chain owner

# fees

Expand Down
1 change: 0 additions & 1 deletion packages/wasmvm/wasmlib/src/coregovernance/consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ pub(crate) const PARAM_SET_MIN_SD : &str = "ms";
pub(crate) const RESULT_ACCESS_NODE_CANDIDATES : &str = "an";
pub(crate) const RESULT_ACCESS_NODES : &str = "ac";
pub(crate) const RESULT_CHAIN_ID : &str = "c";
pub(crate) const RESULT_CHAIN_OWNER : &str = "o";
pub(crate) const RESULT_CHAIN_OWNER_ID : &str = "o";
pub(crate) const RESULT_CONTROLLERS : &str = "a";
pub(crate) const RESULT_FEE_POLICY : &str = "g";
Expand Down
8 changes: 4 additions & 4 deletions packages/wasmvm/wasmlib/src/coregovernance/results.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,8 @@ pub struct ImmutableGetChainOwnerResults {

impl ImmutableGetChainOwnerResults {
// chain owner
pub fn chain_owner(&self) -> ScImmutableAgentID {
ScImmutableAgentID::new(self.proxy.root(RESULT_CHAIN_OWNER))
pub fn chain_owner_id(&self) -> ScImmutableAgentID {
ScImmutableAgentID::new(self.proxy.root(RESULT_CHAIN_OWNER_ID))
}
}

Expand All @@ -272,8 +272,8 @@ impl MutableGetChainOwnerResults {
}

// chain owner
pub fn chain_owner(&self) -> ScMutableAgentID {
ScMutableAgentID::new(self.proxy.root(RESULT_CHAIN_OWNER))
pub fn chain_owner_id(&self) -> ScMutableAgentID {
ScMutableAgentID::new(self.proxy.root(RESULT_CHAIN_OWNER_ID))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ export const ParamSetMinSD = 'ms';
export const ResultAccessNodeCandidates = 'an';
export const ResultAccessNodes = 'ac';
export const ResultChainID = 'c';
export const ResultChainOwner = 'o';
export const ResultChainOwnerID = 'o';
export const ResultControllers = 'a';
export const ResultFeePolicy = 'g';
Expand Down
8 changes: 4 additions & 4 deletions packages/wasmvm/wasmlib/ts/wasmlib/coregovernance/results.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,15 +174,15 @@ export class MutableGetChainNodesResults extends wasmtypes.ScProxy {

export class ImmutableGetChainOwnerResults extends wasmtypes.ScProxy {
// chain owner
chainOwner(): wasmtypes.ScImmutableAgentID {
return new wasmtypes.ScImmutableAgentID(this.proxy.root(sc.ResultChainOwner));
chainOwnerID(): wasmtypes.ScImmutableAgentID {
return new wasmtypes.ScImmutableAgentID(this.proxy.root(sc.ResultChainOwnerID));
}
}

export class MutableGetChainOwnerResults extends wasmtypes.ScProxy {
// chain owner
chainOwner(): wasmtypes.ScMutableAgentID {
return new wasmtypes.ScMutableAgentID(this.proxy.root(sc.ResultChainOwner));
chainOwnerID(): wasmtypes.ScMutableAgentID {
return new wasmtypes.ScMutableAgentID(this.proxy.root(sc.ResultChainOwnerID));
}
}

Expand Down

0 comments on commit f24b600

Please sign in to comment.